Cleanup and tweaks for nanogui

- clean up main-gui.cpp
- Add Primitive constructor from vector
- move ubo bindbufferbase to correct location
This commit is contained in:
David Allemang
2020-10-11 18:00:38 -04:00
parent 7fb70dbae6
commit c164c319fc
3 changed files with 5 additions and 201 deletions

View File

@@ -39,10 +39,6 @@ struct Matrices {
auto pwidth = aspect * pheight;
mat4 proj = ortho(-pwidth, pwidth, -pheight, pheight, -10.0f, 10.0f);
// if (!glfwGetKey(window, GLFW_KEY_LEFT_SHIFT)) {
// state.st += state.time_delta / 8;
// }
auto view = mat4::Identity();
return Matrices(proj, view);
}
@@ -138,7 +134,6 @@ public:
prop = std::make_unique<Prop<4, vec4>>(make_slice<4>(*group, root, {}, combos, exclude));
ubo = std::make_unique<cgl::Buffer<Matrices>>();
glBindBufferBase(GL_UNIFORM_BUFFER, 1, *ubo);
ren = std::make_unique<SliceRenderer<4, vec4>>();
}
@@ -162,6 +157,7 @@ public:
std::get<0>(prop->vbos).put(points(*group, root, time));
Matrices mats = Matrices::build(*this);
glBindBufferBase(GL_UNIFORM_BUFFER, 1, *ubo);
ubo->put(mats);
ren->draw(*prop);
}