Skip to content

Commit

Permalink
Optimize line width and line colors
Browse files Browse the repository at this point in the history
  • Loading branch information
scheibel committed Mar 6, 2018
1 parent e4d7813 commit 31d1733
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
17 changes: 9 additions & 8 deletions source/unifiedmemory/Rendering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,14 @@ void Rendering::uninitialize()
void Rendering::render()
{
static const auto colors = std::array<glm::vec3, 8>({{
glm::vec3(228,26,28) / glm::vec3(255),
glm::vec3(55,126,184) / glm::vec3(255),
glm::vec3(77,175,74) / glm::vec3(255),
glm::vec3(152,78,163) / glm::vec3(255),
glm::vec3(255,127,0) / glm::vec3(255),
glm::vec3(255,255,51) / glm::vec3(255),
glm::vec3(166,86,40) / glm::vec3(255),
glm::vec3(247,129,191) / glm::vec3(255)
glm::vec3(27,158,119) / glm::vec3(255),
glm::vec3(217,95,2) / glm::vec3(255),
glm::vec3(117,112,179) / glm::vec3(255),
glm::vec3(231,41,138) / glm::vec3(255),
glm::vec3(102,166,30) / glm::vec3(255),
glm::vec3(230,171,2) / glm::vec3(255),
glm::vec3(166,118,29) / glm::vec3(255),
glm::vec3(102,102,102) / glm::vec3(255)
}});

const auto numIterations = m_dataBuffer->size() / m_sensorCount;
Expand All @@ -208,6 +208,7 @@ void Rendering::render()
gl::glUseProgram(0);

gl::glPointSize(m_sensorCount > 8 ? 2.0f : 4.0f);
gl::glLineWidth(m_sensorCount > 16 ? 1.0f : 2.0f);

gl::glBindVertexArray(m_plotVAO);
gl::glBindBuffer(gl::GL_ARRAY_BUFFER, m_dataBuffer->gpuIdentifier());
Expand Down
3 changes: 2 additions & 1 deletion source/unifiedmemory/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,8 @@ int main(int argc, char ** argv)
glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 4);
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 5);
glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, true);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
//glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_COMPAT_PROFILE);

GLFWwindow * window = nullptr;

Expand Down

0 comments on commit 31d1733

Please sign in to comment.