Added a update function to the level which rotates the bunny.
This commit is contained in:
parent
f5a1864472
commit
16f4890458
@ -38,8 +38,11 @@ void deleteCustomResources()
|
||||
// we have memory management via reference counting, so nothing to do here
|
||||
}
|
||||
|
||||
void draw( float runTime )
|
||||
void draw(float runTime)
|
||||
{
|
||||
// update Level first TODO: move this with the rest of the stuff that doesn't belong here to main
|
||||
level.update(runTime);
|
||||
|
||||
// clear the framebuffer:
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
|
@ -13,7 +13,7 @@ void initCustomResources();
|
||||
void deleteCustomResources();
|
||||
|
||||
// gets called ech frame, runTime is in seconds:
|
||||
void draw( float runTime );
|
||||
void draw(float runTime);
|
||||
|
||||
// gets called at window resize:
|
||||
void resizeCallback( GLFWwindow *, int newWidth, int newHeight );
|
||||
|
5
level.cc
5
level.cc
@ -41,6 +41,11 @@ void Level::render() {
|
||||
this->terrain.render();
|
||||
}
|
||||
|
||||
void Level::update(float runTime) {
|
||||
// rotate bunny
|
||||
objects[0].setRotation(glm::vec3(0.0f, 1.0472f * runTime, 0.0f));
|
||||
}
|
||||
|
||||
glm::vec3 Level::getAmbientLight() {
|
||||
return ambientLight;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user