Akash
11-25-2001, 07:29 AM
Hi
I am making a litle paint program, rendering the scene using opengl, i only call the funtion to draw when i receive WM_PAINT thinking that it wont use the cpu at 100% but it still does.
Is there any way i can only render when i need too so my cpu dosent get used at 100%
case WM_ACTIVATE:
if ( ! HIWORD(wParam) )
g_bActive = TRUE;
else
g_bActive = FALSE;
break;
case WM_PAINT:
if ( g_bActive )
OnPaint();
break;
i only call onpaint if the window is active, and my cpu gets used at 100% even when the window is not active...
I am making a litle paint program, rendering the scene using opengl, i only call the funtion to draw when i receive WM_PAINT thinking that it wont use the cpu at 100% but it still does.
Is there any way i can only render when i need too so my cpu dosent get used at 100%
case WM_ACTIVATE:
if ( ! HIWORD(wParam) )
g_bActive = TRUE;
else
g_bActive = FALSE;
break;
case WM_PAINT:
if ( g_bActive )
OnPaint();
break;
i only call onpaint if the window is active, and my cpu gets used at 100% even when the window is not active...