Results 1 to 2 of 2

Thread: Multiple glWidgets with Lists and Textures.

  1. #1
    Join Date
    Apr 2010
    Posts
    1
    Qt products
    Qt4
    Platforms
    MacOS X

    Default Multiple glWidgets with Lists and Textures.

    Hello,

    I need to make a program with 4 different QGLWidget().
    There isn't any problem as long as I don't use glNewList() or glGenTexture()... but when I try to use one of these functions (my model contain more than 10^6 triangles and I must display the texture, so I don't have the choice) all gone wrong... the glwidgets stop displaying anything.
    I think the problem comes from the function makecurrent() but if I don't do the makecurrent I can't create the new lists.


    So I want to know if anybody had met the same problem, and how to fix it.


    You can find my code and more informations (in French) there.


    Thank you for everything.

  2. #2
    Join Date
    Aug 2007
    Posts
    13
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Multiple glWidgets with Lists and Textures.

    You need to share a gl context with each of your gl widgets.
    i.e.

    Qt Code:
    1. void CreateGLWidgets(QWidget *parent_widget)
    2. {
    3. QGLContext * my_context new QGLContext;
    4. QGLWidget * widget_1 = new QGLWidget( parent_widget,my_context);
    5. QGLWidget * widget_2 = new QGLWidget( parent_widget,my_context);
    6. QGLWidget * widget_3 = new QGLWidget( parent_widget,my_context);
    7. QGLWidget * widget_4 = new QGLWidget( parent_widget,my_context);
    8. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. [QGLWidget] Cannot bind texture
    By Macok in forum Qt Programming
    Replies: 1
    Last Post: 5th April 2009, 20:53
  2. Single slot for multiple list boxes
    By Sheetal in forum Qt Programming
    Replies: 1
    Last Post: 15th April 2008, 07:53
  3. multiple selection of list view items
    By samirg in forum Qt Programming
    Replies: 2
    Last Post: 30th October 2007, 20:05
  4. Texture in QGLWidget
    By showhand in forum Qt Programming
    Replies: 5
    Last Post: 28th October 2006, 09:47
  5. renderPixmap and texture
    By techno in forum Qt Programming
    Replies: 1
    Last Post: 2nd March 2006, 13:13

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.