parent
f985322db9
commit
2d7ec92923
1 changed files with 8 additions and 2 deletions
|
|
@ -407,6 +407,8 @@ public:
|
||||||
|
|
||||||
void updateUniformBuffers()
|
void updateUniformBuffers()
|
||||||
{
|
{
|
||||||
|
camera.setPerspective(60.0f, ((float)width / 3.0f) / (float)height, 0.1f, 512.0f);
|
||||||
|
|
||||||
uboVS.projection = camera.matrices.perspective;
|
uboVS.projection = camera.matrices.perspective;
|
||||||
uboVS.modelView = camera.matrices.view;
|
uboVS.modelView = camera.matrices.view;
|
||||||
|
|
||||||
|
|
@ -440,12 +442,16 @@ public:
|
||||||
|
|
||||||
virtual void render()
|
virtual void render()
|
||||||
{
|
{
|
||||||
if (!prepared)
|
if (!prepared) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
draw();
|
draw();
|
||||||
|
if (camera.updated) {
|
||||||
|
updateUniformBuffers();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void viewChanged()
|
virtual void windowResized()
|
||||||
{
|
{
|
||||||
updateUniformBuffers();
|
updateUniformBuffers();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue