I am creating a Win32 application with OpenGL in the main window (not using GLUT) when I call swapbuffers So, I have just drawn my drawing code because it is automatically being invalid because it is constantly using the reader and many CPU resources, while using GDI, I can only provide it when it Really received WM_PAINT The literacy?
Thanks
WM_PAINT message sent until the dirty area of the window is not valid Used to be. The API is the 'endpoint' to reset the dirty area.
The calling swapbuffers should not affect the invalid window area at all.
Your WM_PAINT handler should be like the following:
Case WM_PAINT: HDC HDC; Painting ps; HDC = Plainpaint (HWND, PS); WglMakeCurrent (hdc, scene.m_oglContext); Scene.Render (); // wglSwapBuffers (hdc); WglMakeCurrent (hdc, 0); EndPaint (hWnd, & amp; ps); Return 0;
Many sample code applications for Open GL programming have a single HDC and OpenGL context setup initially. Although this simplifies the sample code, this means that the code can not work correctly with many open Gail references. This WM_PAINT handler assumes that the OpenGL reference is made for a view, and then is essentially turned on.
The side effect of swapping the OpenGL reference as required is that, the HDC derived from the StartPan is a render (and a swapfuffer) goal, which means that the OpenGL app will now paint the synchronous if and when the other window app Pull over the window.
Comments
Post a Comment