Results 1 to 2 of 2

Thread: Draw a simple OpenGL line with Qt 5.5

  1. #1
    Join Date
    Mar 2012
    Posts
    30
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Draw a simple OpenGL line with Qt 5.5

    Hello,

    the example with the triangle and vertex shaders is fine.
    See: http://doc.qt.io/qt-5/qtgui-openglwindow-example.html
    But how can I change it to draw a simple OpenGL line?

    Greetings,
    TheLamb

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,305
    Thanks
    243
    Thanked 678 Times in 668 Posts
    Qt products
    Qt5
    Platforms
    Windows Android

    Default Re: Draw a simple OpenGL line with Qt 5.5

    You need to change the vertices to reflect the endpoints of your line, and you need to change glDrawArrays to use GL_LINES instead of GL_TRIANGLES (and the correct number of vertices). And then figure out why that doesn't work either :-)

Similar Threads

  1. To draw a line
    By vinayaka in forum Qt Quick
    Replies: 1
    Last Post: 6th June 2011, 11:53
  2. Replies: 3
    Last Post: 22nd October 2009, 08:46
  3. Draw Line
    By aloysiusjegan in forum Qwt
    Replies: 4
    Last Post: 12th February 2009, 12:02
  4. Best way to draw a Line
    By JimDaniel in forum Qt Programming
    Replies: 1
    Last Post: 19th January 2008, 10:57
  5. Writing a simple Draw program
    By neomax in forum General Discussion
    Replies: 1
    Last Post: 23rd November 2006, 07:53

Tags for this Thread

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.