Code:
WPARAM MainLoop()
{
MSG msg;
while(1) // Do our infinate loop
{ // Check if there was a message
if (PeekMessage(&msg, NULL, 0, 0, PM_REMOVE))
{
if (ControlDialog == 0 || !IsDialogMessage(ControlDialog,&msg))
{
if(msg.message == WM_QUIT) // If the message wasnt to quit
break;
TranslateMessage(&msg); // Find out what the message does
DispatchMessage(&msg); // Execute the message
}k
}
else // if there wasn't a message
{
for (int i = 0; i < MAX_GLOBES;i++)
{
globe[i].RotateAroundPoint(globe[0].Position, SPEED * g_FrameInterval, 0, 1, 0);
}
g_Camera.Update(); // Update the camera every frame
RenderScene(); // Render the scene every frame
}
}
DeInit(); // Clean up and free all allocated memory
return(msg.wParam); // Return from the program
}
Control dialog being the handle to my dialog box, the otherstuff involving my opengl.