GLX Pixmap problem on SGI O2

GLX Pixmap problem on SGI O2

Post by Dado Coluss » Tue, 13 Apr 1999 04:00:00



I'm trying to create a GLX Pixmap for off-screen rendering.
On an SGI O2 with IRIX 6.3 the following error is generated
when calling glXMakeCurrent:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  141 (GLX)
  Minor opcode of failed request:  17 (X_GLXVendorPrivateWithReply)
  Serial number of failed request:  23
  Current serial number in output stream:  23

What's going on?

Here are the interesting parts of the code:

int
init_glx(unsigned width, unsigned height)
{
        Colormap cmap;
        XSetWindowAttributes swa;
        int     visual_attrs[] = {
            GLX_USE_GL,
            GLX_RGBA,
            GLX_RED_SIZE, 1,
            GLX_GREEN_SIZE, 1,
            GLX_BLUE_SIZE, 1,
            None };

        /* Open connection to the X-server */
        if ((dpy = XOpenDisplay(NULL)) == NULL) {
                fprintf(stderr, "%s %d: Can't open display: %s\n",
                    __FILE__, __LINE__, strerror(errno));
                return -1;
        }

        /* Get an appropriate visual */
        if ((vi = glXChooseVisual(dpy, DefaultScreen(dpy),
visual_attrs))
            == NULL) {
                fprintf(stderr, "%s %d: Can't choose visual: %s\n",
                    __FILE__, __LINE__, strerror(errno));
                return -1;
        }

        /* Create a GLX context */
        if ((context = glXCreateContext(dpy, vi, NULL, GL_TRUE)) ==
NULL) {
                fprintf(stderr, "%s %d: glXCreateContext: %s\n",
                    __FILE__, __LINE__, strerror(errno));
                return -1;
        }

        /* Create a color map */
        cmap = XCreateColormap(dpy, RootWindow(dpy, vi->screen),
            vi->visual, AllocNone);

        /* Create a window */
        swa.colormap = cmap;
        swa.border_pixel = 0;
        swa.event_mask = StructureNotifyMask | KeyPressMask;
        win = XCreateWindow(dpy, RootWindow(dpy, vi->screen), 0, 0,
            width, height, 0, vi->depth, InputOutput, vi->visual,
            CWBorderPixel | CWColormap | CWEventMask, &swa);

        return 0;

Quote:}

int
init_glx_pixmap(unsigned width, unsigned height)
{

        if (init_glx(width, height) != 0)
                return -1;

        pixmap = XCreatePixmap(dpy, win, width, height, vi->depth);
        glxpixmap = glXCreateGLXPixmap(dpy, vi, pixmap);

        return 0;

Quote:}

--
Dado Colussi                         Xenetic Ltd.


direct +358-9-61268126               fax +358-9-61268110
gsm    +358-40-5005501

 
 
 

GLX Pixmap problem on SGI O2

Post by Dado Coluss » Tue, 13 Apr 1999 04:00:00


Four-hour sleep makes miracles!

Converting the last parameter of glXCreateContext to
GL_FALSE made it work.

Quote:>         /* Create a GLX context */
>         if ((context = glXCreateContext(dpy, vi, NULL, GL_TRUE)) ==
> NULL) {
>                 fprintf(stderr, "%s %d: glXCreateContext: %s\n",
>                     __FILE__, __LINE__, strerror(errno));
>                 return -1;
>         }

--
Dado Colussi                         Xenetic Ltd.


direct +358-9-61268126               fax +358-9-61268110
gsm    +358-40-5005501