openglsuperbible / sb7code

Source code and supporting material for the 7th Edition of OpenGL SuperBible
727 stars 251 forks source link

Fixed logical bug in spinnycube example #5

Closed saleem-mirza closed 5 years ago

saleem-mirza commented 9 years ago

Spinnycube example code doesn't display any animation unless window is manually re-sized. I'm forcing projection matrix calculation at startup to render cube correctly.

@grahamsellers for your eyes please.

coreyabshire commented 8 years ago

This issue hit me as well and caused quite a bit of head scratching, but I came to a similar conclusion as this. It seems in the glfw with sb6 that calling glfwSetWindowSizeCallback also called the callback at the same time, whereas in the one with sb7 it does not. Not sure if it causes the same issue in any other sb7 examples, but in case it does might be worth calling glfw_onResize(window, info.windowWidth, info.windowHeight); just after setting it as the callback in run() in sb7.h instead of just it in spinnycube.cpp.

mattgruenke commented 6 years ago

Thanks for this.

BTW, in my fork, I'm porting these examples to use OGLplus.