Query for OpenGL Stereo Capability

crjjrc crjjrc at gmail.com
Thu Dec 6 05:57:32 PST 2007


On Dec 5, 2:56 pm, va... at wxwidgets.org (Vadim Zeitlin) wrote:
> On Wed, 5 Dec 2007 12:28:21 -0800 (PST) crjjrc <crj... at gmail.com> wrote:
>
> c> > static method checking for a concrete attribute support -- I'm pretty sure
> c> > there was a way to do it in OpenGL, wasn't there?
> c>
> c> Not in OpenGL, no.  You can't issue any OpenGL commands without an
> c> OpenGL context, and you can't get a context if you can't get a visual
> c> from GTK or whichever windowing system is present.  If you're at all
> c> familiar with GLUT, a simple cross-platform windowing toolkit, it
> c> allows querying for a supported visual through this call:
> c>
> c>    int visual_supported = glutGet(GLUT_DISPLAY_MODE_POSSIBLE);
>
>  But how is this implemented?

This is the relevant section from the freeglut source:

-----------
    case GLUT_DISPLAY_MODE_POSSIBLE:
    {
        /*  We should not have to call fgChooseFBConfig again here.
*/
        GLXFBConfig * fbconfig;
        int isPossible;

        fbconfig = fgChooseFBConfig();

        if (fbconfig == NULL)
        {
            isPossible = 0;
        }
        else
        {
            isPossible = 1;
            XFree(fbconfig);
        }

        return isPossible;
    }
----------------

So, it checks that a valid framebuffer was created.  fbChooseFBConfig
behaves much like wxWidget's ChooseGLFBC function.

- Chris






More information about the wx-users mailing list