Forgot to mention (but that was obvious): you of course can enumerate supported screen resolutions with corresponding method (not implemented yet for X11 as explained). I used it in my project and that's nice because I now can auto-find the closest supported fullscreen resolution using a simple search function (Ex: 1600x1024 not supported? It will try 1600x1200 or something similar). Morover, it avoids the ugly 60 Hz default by using the highest refresh rate available. :)
Sukender PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ Le Tue, 16 Dec 2008 00:49:11 +0100, Sukender <[email protected]> a écrit: > Hi Robert, hi all, > > As discussed on osg-users, I changed > GraphicsContext::WindowingSystemInterface. The main problem is that I need > testing under OSX and Linux. Here is what has been done: > > I created a ScreenResolution structure to take as argument (instead of > references on integers) for > WindowingSystemInterface::get/setScreenResolution(). It contains: > - screen size > - color depth > - and refresh rate > This structure may be extended later if needed, but it seems to fit what's > possible with Win32/Carbon/X11. > > Please note that I kept the previous prototypes of get/setScreenResolution() > for backward compatibility (they are marked as deprecated though). But I > removed the setScreenRefreshRate() since I don't find it logical to set the > refresh rate without the resolution. If that decision is wrong, you just need > to uncomment the setScreenRefreshRate() declaration and definitions. If it is > right, then commented lines can be deleted. > > The behaviour of the setScreenResolution() method is to set parameters that > don't have a 0 value. For instance, if you set the refresh rate but not the > screen size not the color depth, then it is as calling the (commented out) > setScreenRefreshRate(). > > Here is the detail for each windowsing system: > - Win32: Almost everything ok, except setting color depth that seem to have > trouble with OpenGL (maybe my video driver?). That works but I have a strange > behaviour when setting my screen to 8 or 16 bits. > - Carbon: Everything has been coded, thanks to Apple's online documentation, > but I just can't compile (I'm under Win32). > - X11: I got lost in X11 and XRANDR, so some things were coded, some not: you > can't *Get* the refresh rate, you can't *Set* the color depth, and you can't > enumerate your supported resolutions. > > So, what is needed: > - Test Carbon code. > - Finish X11 code, and test it. > > Attached: > - A 7-Zip archive containing modified files against rev. 9357 of the SVN > trunk. > - An OpenOffice 3 spread sheet that sums up what I coded/tested (The one I > used). > > Sukender > PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/ _______________________________________________ osg-submissions mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
