|
-
April 28th, 2009, 03:11 AM
#1
Paint outside of WNDPROC
Basically i have a standard window where i want to draw some balls too, but the painting messages will not be handled in the Window Processor as WM_PAINT or WM_TIMER messages, instead i have a message loop like this:
while(true)
{
starting_point = GetTickCount();//frame limiter
if(PeekMessage (&msg, NULL, 0, 0, PM_REMOVE))
{
if (msg.message == WM_QUIT)
break;
else if( !TranslateAccelerator (hwnd, hAccel, &msg) )
{
TranslateMessage (&msg) ;
DispatchMessage (&msg) ;
}
}
if(!opt.bPause );//simulation is not on pause
//RENDER FRAME() !!!PROBLEM AREA
while ((GetTickCount() - starting_point) < 1000/opt.REFRESH); //frame limiter
}
in the RenderFrame function i want to make a GDI back buffer, draw to it and swap it with a front buffer, but for that i need a DC. The problem is that all the functions for getting a DC, like GetDC and BeginPaint need a handle to the window. My question is, is it possible to save the windows handle global, or is it changing all the time, and if it is, are there any other optios to paint a window outside of it's WindowProc?
Thanks in advance
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|