Results 1 to 7 of 7

Thread: [openGL with Qt] updating of screen when paintGL is updated

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    May 2011
    Posts
    122
    Thanks
    34
    Platforms
    Windows

    Default [openGL with Qt] updating of screen when paintGL is updated

    Hello all,

    I have a problem with the display in OpenGL. Currently I have a program that plot little by little some things in an openGL window.

    => i want to update screen each time that i go in the method "plotGL" but i don't know how i can do that

    => I noticed that openGL screen is updated if I increase the size of the openGL window but this update of the display is not automatically

    So, How can I update my screen each time that i go in the paintGL function?

    thank you in advance for your help

    ps: I tried repaint () and updateGL () but it does not work then call these methods paintGL, it makes me so all block

    this is my code:
    Qt Code:
    1. void myGLWidget::paintGL()
    2. {
    3. glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
    4. glClearColor(1.0f,1.0f,1.0f,1.0f);
    5. glMatrixMode( GL_MODELVIEW );
    6. glLoadIdentity( );
    7. gluLookAt( 1.2, 1.7, 1.0, 0, 0, 0, 0, 0, 1);
    8. glBegin(GL_LINES);
    9. //plot
    10. glEnd();
    11. // updateSCREEN();
    12. }
    To copy to clipboard, switch view to plain text mode 

    i have tried to decomment the line "updateSCREEN();" and put this method
    Qt Code:
    1. void myGLWidget::updateSCREEN()
    2. {
    3. updateGL();
    4. //repaint(); //i have tried this too
    5. }
    To copy to clipboard, switch view to plain text mode 

    but it don't works, it creates a general blocage of alls my windows

    Can you help me please? thanks a lot
    Last edited by 21did21; 6th July 2011 at 01:26.

Similar Threads

  1. Qt + opengl+opencv black screen
    By loose in forum Qt Programming
    Replies: 1
    Last Post: 11th April 2011, 15:49
  2. Capture OpenGL screen pixels
    By Windsoarer in forum Qt Programming
    Replies: 3
    Last Post: 5th May 2009, 04:24
  3. QGraphicsView, OpenGL and repainting/updating
    By Amargedon in forum Qt Programming
    Replies: 2
    Last Post: 19th January 2009, 12:03
  4. Help on OpenGL in PaintGL
    By mickey in forum Newbie
    Replies: 1
    Last Post: 15th April 2006, 22:17
  5. Question about updating an image on screen
    By SkripT in forum Qt Programming
    Replies: 1
    Last Post: 24th February 2006, 19:01

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
  •  
Qt is a trademark of The Qt Company.