float rotation, |
MyWindow::MyWindow(int
width, int height, char* title) : Fl_Gl_Window(width, height, title) |
. . . |
glRotatef() takes the
angle to rotate (in degrees) and the axis to rotate around (the
positive y axis in our case). Our cube is all set to
rotate. We just
need to modify the horizontal and vertical angles while our program is
running. We'll let the user do this with the arrow keys.
. . . |
int
MyWindow::handle(int event) |
#include
<Fl/Fl.h> |
Choose Build -> Build Solution to compile and link the program and Debug -> Start Without Debugging to run it. You should see an OpenGL window just like this. By pressing the left or right arrow keys the cube should now rotate and you should see the other sides of the cube rendered in different colors. |
. . . |
void
IdleCallback(void* pData) |
MyWindow::MyWindow(int
width, int height, char* title) : Fl_Gl_Window(width, height, title) |
int
MyWindow::handle(int event) |
To test the new version of out program we choose Build -> Build Solution to compile and link the program and Debug -> Start Without Debugging to run it. |