Advertisement

need help, but maybe this is a C++ question

Started by July 11, 2001 05:19 AM
0 comments, last by guille 23 years, 7 months ago
Hello, Sorry for my English... I don''t know if my question is a C++ question or a OpenGL one, but here is it: From a dialog, I create (using WinAPI) a normal Window where I display all my objects (using OpenGL). When I change some visualization options in my dialog, I would like that my Window showes the changes that I have done inmediatly, but it shows those changes only when I click on the window (when it gets the focus, I guess). There is no Paint routine that draws the objects everytime. I call a Paint routine when it is necessary (for example, when I make changes from my dialog). If it is painting in my window (I know because debugging it goes inside my Paint function )at the time that I am doing changes, why the window doesn''t show those changes unless it receives the focus?? Could it be related with the process that created the window?
Hey, I''m not very clear on exactly what the problem is. But I think you are only getting the painting because you debug the process. Debugging it will make it need to be repainted, as VC++ will come in front, then your app will go in front, so it will need painting. But when you don''t debug, this doesn''t happen. Try a call to RedrawWindow():

  RedrawWindow(hWnd, NULL, NULL, RDW_INVALIDATE);  


Have a look at the documentation for the right parameter values to use, I can''t remember all of them . The SDK docs say not to send WM_PAINT messages and I think that''s good advice, as I''ve found things can get very screwed when doing that. And RedrawWindow() seems to work much better anyway.

Hope that helps you,

FatalXC

This topic is closed to new replies.

Advertisement