Results 1 to 2 of 2

Thread: DRI error

  1. #1
    Junior Member Newbie
    Join Date
    Sep 2005
    Location
    Boston
    Posts
    2

    DRI error

    I am trying to run a program that will overlay openGL lines and text on a video picture. The system I am using has a proprietary linux video board that will not allow direct rendering. The linux version is Red Hat 9.

    I am trying to use the program odg_glx_sample, by Kevin Harris as a starting point, and interleave its commands with those needed to bring in the video.

    The program fails at the command:

    XmapWindow( g_pDisplay, g_window);

    with the message:

    Xlib: extension "XFree86-DRI" missing on display ":0.0"

    The program up to this point is as follows:

    int main( int argc, char **argv )
    {
    XSetWindowAttributes windowAttributes;
    // seems to be needed for video
    XVisualInfo *visualInfo = NULL;
    XEvent event;
    Colormap colorMap;
    GLXContext glxContext;
    KeySym keysym;

    int errorBase;
    int eventBase;
    // default to PAL input for video
    int nStandard=ID_PAL;

    // Open a connection to the X server
    g_pDisplay = XOpenDisplay( NULL );
    scr= DefaultScreenOfDisplay(g_pDisplay);

    if( g_pDisplay == NULL )
    {
    fprintf(stderr, "glxsimple: %s\n", "could not open display");
    exit(1);
    }

    // Make sure OpenGL's GLX extension supported
    if( !glXQueryExtension( g_pDisplay, &errorBase, &eventBase ) )
    {
    fprintf(stderr, "glxsimple: %s\n", "X server has no OpenGL GLX
    extension");
    exit(1);
    }

    // Find an appropriate visual

    int doubleBufferVisual[] =
    {
    GLX_RGBA, // Needs to support OpenGL
    GLX_DEPTH_SIZE, 16, // Needs to support a 16 bit depth buffer
    GLX_DOUBLEBUFFER, // Needs to support double-buffering
    None // end of list
    };

    int singleBufferVisual[] =
    {
    GLX_RGBA, // Needs to support OpenGL
    GLX_DEPTH_SIZE, 16, // Needs to support a 16 bit depth buffer
    None // end of list
    };

    // Try for the double-bufferd visual first
    visualInfo = glXChooseVisual( g_pDisplay, DefaultScreen(g_pDisplay),
    doubleBufferVisual );

    if( visualInfo == NULL )
    {
    fprintf(stderr, "No dobule buffer.\n");
    // If we can't find a double-bufferd visual, try for a single-buffered
    visual...
    visualInfo = glXChooseVisual( g_pDisplay, DefaultScreen(g_pDisplay),
    singleBufferVisual );

    if( visualInfo == NULL )
    {
    fprintf(stderr, "glxsimple: %s\n", "no RGB visual with depth
    buffer");
    exit(1);
    }

    g_bDoubleBuffered = false;
    }

    WM_PROTOCOLS = XInternAtom(g_pDisplay,"WM_PROTOCOLS",false);
    WM_DELETE_WINDOW = XInternAtom(g_pDisplay,"WM_DELETE_WINDOW",false);

    // Create an OpenGL rendering context
    glxContext = glXCreateContext( g_pDisplay,
    visualInfo,
    NULL, // No sharing of display lists
    GL_FALSE ); // Direct rendering if possible

    if( glxContext == NULL )
    {
    fprintf(stderr, "glxsimple: %s\n", "could not create rendering
    context");
    exit(1);
    }

    // Create an X colormap since we're probably not using the default visual
    colorMap = XCreateColormap( g_pDisplay,
    RootWindow(g_pDisplay, visualInfo->screen),
    visualInfo->visual,
    AllocNone );

    windowAttributes.colormap = colorMap;
    windowAttributes.border_pixel = 0;
    windowAttributes.event_mask = ExposureMask |
    VisibilityChangeMask |
    KeyPressMask |
    KeyReleaseMask |
    ButtonPressMask |
    ButtonReleaseMask |
    PointerMotionMask |
    StructureNotifyMask |
    SubstructureNotifyMask |
    FocusChangeMask;

    // Create an X window with the selected visual
    g_window = XCreateWindow( g_pDisplay,
    RootWindow(g_pDisplay, visualInfo->screen),
    0, 0, // x/y position of top-left outside
    corner of the window
    640, 480, // Width and height of window
    0, // Border width
    visualInfo->depth,
    InputOutput,
    visualInfo->visual,
    CWBorderPixel | CWColormap | CWEventMask,
    &windowAttributes );
    // win=RootWindowOfScreen(scr);

    XChangeProperty(g_pDisplay,g_window, WM_PROTOCOLS, XA_ATOM, 32,
    PropModeReplace,
    (unsigned char *) &WM_DELETE_WINDOW, 1);
    printf("before InitVAC.\n");
    // intialize for video display
    InitVAC(g_window,g_pDisplay);
    printf("after InitVAC.\n");

    XSetStandardProperties( g_pDisplay,
    g_window,
    "GLX Sample",
    "GLX Sample",
    None,
    argv,
    argc,
    NULL );
    printf("before MakeCurrent.\n");
    // Bind the rendering context to the window
    glXMakeCurrent( g_pDisplay, g_window, glxContext );
    printf("after MakeCurrent, but before XMap.\n");
    // Request the X window to be displayed on the screen
    XMapWindow( g_pDisplay, g_window );
    printf("after Xmap.\n");

    What can I do to avoid the need for DRI?

    Thank you,

    Rex

  2. #2
    Senior Member Regular Contributor
    Join Date
    Aug 2005
    Posts
    145

    Re: DRI error

    You'll probably get more responses in the Linux forum.

Similar Threads

  1. Shader Compile Error: ERROR: 0:1: '' : syntax error #version
    By Blakeasd in forum OpenGL: Basic Coding
    Replies: 12
    Last Post: 07-25-2013, 07:35 PM
  2. Replies: 2
    Last Post: 05-31-2013, 01:06 PM
  3. ERROR: 0:17:'f' : syntax error parse error
    By hopeless in forum OpenGL: GLSL
    Replies: 1
    Last Post: 08-23-2010, 01:05 PM
  4. Replies: 1
    Last Post: 09-24-2007, 04:02 AM
  5. Replies: 3
    Last Post: 02-07-2003, 05:06 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean