View Full Version : OpenGL and callback function
12-03-2002, 09:41 AM
In a normal hello world Win32 program, the drawing is usually done in the callback function (under the handler of WM_PAINT message), but in some OpenGL sample code I saw, the drawing is done in the message loop (located in the WinMain function). Is this difference radical? Or is there an equivalent way of doing OpenGL drawing in the callback function? Thanks a lot for help.
12-03-2002, 10:38 PM
Putting it in the message loop gives you a little more control over the rendering, if you only have it in the paint handler then it depends on Windows redrawing the screen (using InvalidateRect or user interaction), when you do it yourself in the messageloop you can control the animation speed better, for example in a game.
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.