Results 1 to 5 of 5

Thread: Context OpenGL

  1. #1
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Context OpenGL

    Hi,
    my app has 5 widgets with the same cube. Every widget calls its initializeGL() paintGL()....but....I don't understand good what is a context openGL: every widget have a context (in this case the context it's the same)? Should widgets shared the same context? How do I code it (idea)?

    Thanks
    Regards

  2. #2
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Context OpenGL

    Any hints?
    Regards

  3. #3
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Context OpenGL

    1. What is a "cube" that you are referring to? Is this a drawn cube, or do you mean a square arrangement of widgets?

    2. The OpenGL context stores the state for that window - all your matrices (projection, modelview, etc.) are associated with a device context. To have multiple OpenGL windows, you need multiple unique device contexts.

    3. There are some things that can be shared. These include textures and display lists. Everything else should be unique.
    Life without passion is death in disguise

  4. #4
    Join Date
    Jan 2006
    Posts
    976
    Thanks
    53
    Qt products
    Qt3
    Platforms
    Windows

    Default Re: Context OpenGL

    cube is my drawn object (with openGL). I insert 5 drawn 5 widget from qtDesinger.
    Are there 5 different GL context? Each widgetx dislplay the same scene.So in my program 5 instance of myGLWidget starts. All widgets refere to the same context or have they one? thanks
    Regards

  5. #5
    Join Date
    Feb 2006
    Location
    USA
    Posts
    142
    Thanks
    24
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Context OpenGL

    They each get their own unique contexts. Each widget will have to re-draw the scene independently. They can use the same data to build the scene, but the OpenGL context must be different.
    Life without passion is death in disguise

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. context of opengl is changing on mac os x
    By Sandip in forum Qt Programming
    Replies: 1
    Last Post: 4th April 2008, 12:25
  3. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21
  4. help on openGL context
    By mickey in forum Qt Programming
    Replies: 1
    Last Post: 29th March 2006, 19:21
  5. Qt's optimized OpenGL context switching
    By sverhoff in forum Qt Programming
    Replies: 0
    Last Post: 28th March 2006, 16:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.