Hi
What about adding this to the OpenGL component ?
Currently fullscreen mode is possible by emulating the behaviour, but it’s not real full screen mode.
For linux, the idea is to rebuild the context with :
screen = getCurrentScreenIndex();
if (fullscreen)
{
XF86VidModeModeInfo **modes;
int modeNum, vmMajor, vmMinor;
XF86VidModeQueryVersion(display, &vmMajor, &vmMinor);
XF86VidModeGetAllModeLines(display, screen, &modeNum, &modes);
// Choose visual here and try to find the attributes for the fullscreen mode
int bestMode = [... from visual selection ...]
// switch to fullscreen
XF86VidModeSwitchToMode(display, screen, modes[bestMode]);
XF86VidModeSetViewPort(display, screen, 0, 0);
dpyWidth = modes[bestMode]->hdisplay;
dpyHeight = modes[bestMode]->vdisplay;
XFree(modes);
winAttr.override_redirect = True;
winAttr.event_mask = ExposureMask | StructureNotifyMask;
window = XCreateWindow(display, RootWindow(display, vi->screen),
0, 0, dpyWidth, dpyHeight, 0, vi->depth, InputOutput, vi->visual,
CWBorderPixel | CWColormap | CWEventMask | CWOverrideRedirect,
&winAttr);
}
else // Actual code
Under windows, use CDS_FULLSCREEN when creating the context, like this:
if (fullscreen)
{
DEVMODE dmScreenSettings; // Device Mode
memset(&dmScreenSettings,0,sizeof(dmScreenSettings)); // Makes Sure Memory's Cleared
dmScreenSettings.dmSize=sizeof(dmScreenSettings); // Size Of The Devmode Structure
dmScreenSettings.dmPelsWidth = width; // Selected Screen Width
dmScreenSettings.dmPelsHeight = height; // Selected Screen Height
dmScreenSettings.dmBitsPerPel = bits; // Selected Bits Per Pixel
dmScreenSettings.dmFields=DM_BITSPERPEL|DM_PELSWIDTH|DM_PELSHEIGHT;
// Try To Set Selected Mode And Get Results. NOTE: CDS_FULLSCREEN Gets Rid Of Start Bar.
if (ChangeDisplaySettings(&dmScreenSettings,CDS_FULLSCREEN)!=DISP_CHANGE_SUCCESSFUL)
{
dwExStyle=WS_EX_APPWINDOW; // Window Extended Style
dwStyle=WS_POPUP; // Windows Style
ShowCursor(FALSE); // Hide Mouse Pointer
}
}
else // Actual code
Under Mac, it has something to do with obj-c, but I don’t really understand this language. Anyway, the link is here:
http://developer.apple.com/mac/library/documentation/GraphicsImaging/Conceptual/OpenGL-MacProgGuide/opengl_fullscreen/opengl_cgl.html
