Results 1 to 3 of 3

Thread: OpenGL Window ID's

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2006
    Posts
    2

    OpenGL Window ID's

    A co-worker and I are developing an OpenGL 2D Plotting class using the Qt GUI library. The application that we are using the plots in switch between displaying a couple plots to multiple plots at one time, each time destroying and creating a new openGL plot each time. This is creating a new problem, after a while of destroying and redrawing the plots we get the error:
    Code :
    X Error: GLXBadContext 146
       Major opcode: 154
       Minor opcode: 3
       Resource ID: 0x7000484
    QGLContex: makeCurrent( ): Failed
    This is on a Solaris machine. My co-worker believes that we are running out of window ID's for the system. How do you completely "delete" an OpenGL context and free the window ID's. Or are we completely wrong is with the window id's running out?

    Thanks

  2. #2
    Super Moderator OpenGL Guru imported_dorbie's Avatar
    Join Date
    Jul 2000
    Location
    Bay Area, CA, USA
    Posts
    3,966

    Re: OpenGL Window ID's

    Well you seem to be using a wrapper called QGLContext.

    makeCurrent failed but creation probably failed before this.

    Make sure you're deleting the QGLContext. I did a quick check and it doesn't look like it has an ability to destroy it's context explicitly, so don't keep calling the create method in a single QGLContext. Delete it and use a new QGLContext.

    I haven't checked the internals to see if the delete will destroy the context it should.

    Alternatively use one QGLContext and only call create once on initialization, that wold be my strong recommendation unless you're opening & closing a rendering window and want to free resources.

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2005
    Location
    Dayton
    Posts
    148

    Re: OpenGL Window ID's

    Your problem is similar to one I encountered earlier. It sounds like you are not properly deleting your QGLWidgets. Qt appears to wait until the end to delete all its QGLWidgets so if you are just discarding them without actually calling delete you will run out of contexts because all the widgets will still exist even though your program thinks they are all gone. I traced this problem by setting a break point in my subclassed QGLWidget's destructor and it wasn't entering it until termination of the program at which time it freed every QGLWidget I created. Hopefully this will help you.

Similar Threads

  1. Window is redrawn inside the OpenGL area instead of the whole window
    By Visual act in forum OpenGL: User Software
    Replies: 0
    Last Post: 09-18-2015, 06:31 AM
  2. Get the window coordinates when you clic on the OpenGL window
    By tiregarfio in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 10-17-2006, 01:26 PM
  3. Attaching a glut window to window's window
    By jowins in forum OpenGL: Windows
    Replies: 2
    Last Post: 11-17-2005, 02:24 AM
  4. How to implement an openGL window into a "Windows-window"
    By evian in forum OpenGL: Advanced Coding
    Replies: 1
    Last Post: 06-12-2005, 11:09 AM
  5. overlay a semi-transparent window on an OpenGL window
    By Coconut in forum OpenGL: Advanced Coding
    Replies: 2
    Last Post: 02-17-2002, 07:01 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