Results 1 to 2 of 2

Thread: Help on OpenGL in PaintGL

Threaded View

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

    Default Help on OpenGL in PaintGL

    Hi I don't undesrtand a thing: I draw with OpenGl a line and I put it in paintGL (and it is OK):
    Qt Code:
    1. //initializeGL()
    2. .....
    3. glEnable(GL_BLEND);
    4. glEnable(GL_LINE_SMOOTH);
    5. glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
    6. glHint(GL_LINE_SMOOTH_HINT, GL_DONT_CARE);
    7.  
    8. //paintGL
    9. glLineWidth(3.0);
    10. glColor3f(.9f, .1f, .9f);
    11. glBegin(GL_LINES);
    12. glNormal3f(0.0f, 1.0f, 1.0f);
    13. glVertex3f(X, Y, Z);
    14. glVertex3f(X, Y+3, Z);
    15. glEnd();
    To copy to clipboard, switch view to plain text mode 
    Then I tried to put above instructions inside a function of onother object (scene::drawLine()
    And I tried this:
    Qt Code:
    1. //paintGL()
    2. scene.drawLine(); // this is OK
    3. scene.drawScene();
    To copy to clipboard, switch view to plain text mode 
    Qt Code:
    1. Scene::drawScene() {
    2. drawSquare();
    3. }
    To copy to clipboard, switch view to plain text mode 
    Otherwise:
    Qt Code:
    1. //paintGL()
    2. scene.drawScene() //my line appear aliased!!!
    To copy to clipboard, switch view to plain text mode 
    Where:
    Qt Code:
    1. Scene::drawScene() {
    2. drawLine();
    3. drawSquare();
    4. }
    To copy to clipboard, switch view to plain text mode 
    Anyone can tell me about this behavior?
    Thaks
    Last edited by mickey; 14th April 2006 at 16:33.
    Regards

Similar Threads

  1. OpenGL and Qt Question
    By ToddAtWSU in forum Qt Programming
    Replies: 2
    Last Post: 18th April 2009, 18:04
  2. Qt Embedded + OpenGL problem
    By EeroS in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 7th October 2008, 14:32
  3. QT + OpenGL + Thread => aaaahhhhh !
    By anthibug in forum Qt Programming
    Replies: 7
    Last Post: 26th July 2008, 13:36
  4. Qtopia Core & OpenGL ES?
    By zelko in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 28th May 2007, 07:21
  5. paintGL() and initializeGL() help
    By mickey in forum Newbie
    Replies: 14
    Last Post: 26th February 2006, 17:15

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.