Find the answer to your Linux question:
Results 1 to 4 of 4
I am new to X-Windows/Linux programming, so this is probably a dumb question, but... I am working on an application that only needs a valid GL context. I don't actually ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    May 2006
    Posts
    9

    X-Windows/XOpenDisplay question (Possibly a dumb one)


    I am new to X-Windows/Linux programming, so this is probably a dumb question, but...

    I am working on an application that only needs a valid GL context. I don't actually need visible rendering window. The example apps I have seen call XOpenDisplay to connect to the X-Server. Is this necessary to get a GL context?

    CD

  2. #2
    Just Joined! Sykotik's Avatar
    Join Date
    Mar 2002
    Location
    Cape Town, South Africa
    Posts
    54
    From the function reference, it seems that glXCreateContext does require a Display object, so you will have to call XOpenDisplay to get a display.

    ~P

  3. #3
    Just Joined!
    Join Date
    May 2006
    Posts
    9
    Once I have a valid context, can I call XCloseDisplay and kill the server?

    CD

    Quote Originally Posted by Sykotik
    From the function reference, it seems that glXCreateContext does require a Display object, so you will have to call XOpenDisplay to get a display.

    ~P

  4. #4
    Just Joined! Sykotik's Avatar
    Join Date
    Mar 2002
    Location
    Cape Town, South Africa
    Posts
    54
    Quote Originally Posted by CelticDaddio
    Once I have a valid context, can I call XCloseDisplay and kill the server?
    I would say no. With GLX, the OpenGL commands/data are part of the X Window Specification proper (as an extension), so you actually do need the display to operate on your back-buffer. You'll probably only be able to close the connection to the X server once you're done with whatever you need to do with the OpenGL context.

    Reason for this is the whole network transparency shebang of X, I think: execute the application on the server, have it display (or in your case, render in the off-screen pixmap) on the client -- that kind of thing.

    Of course, I'm just speaking off the top of my head and from prior experience with X and/or OpenGL, so I'm open to being corrected.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •