Toggling between windowed mode and fullscreen mode sometimes leaves my fullscreen black. Dragging the window and then switching to fullscreen makes the fullscreen usable again. Help.
I am using this code:
if(!theScreenContexes.IsInWindowMode){
error = DSpContext_SetState(theScreenContexes.SC_DrawSprocket,kDSpContextState_Inactive);//kDSpContextState_Active
succes = aglSetCurrentContext(theScreenContexes.WindowContext);
ShowWindow(theScreenContexes.WindowModeWindow);
theScreenContexes.IsInWindowMode = 1;
}
else{
HideWindow(theScreenContexes.WindowModeWindow);
error = DSpContext_SetState(theScreenContexes.SC_DrawSprocket,kDSpContextState_Active);//kDSpContextState_Active
error = DSpContext_GetFrontBuffer(theScreenContexes.SC_DrawSprocket,&outFrontBuffer); //,kDSpBufferKind_Normal
theScreenContexes.SwapContext = theScreenContexes.SC_AGLContext;
theScreenContexes.SC_AGLDrawable = outFrontBuffer;
succes = aglSetDrawable ( theScreenContexes.SC_AGLContext,outFrontBuffer/theScreenContexes.SC_AGLDrawable/ );
succes = aglSetCurrentContext(theScreenContexes.SC_AGLContext);
SetPort(outFrontBuffer);
theScreenContexes.IsInWindowMode = 0;
}