PDA

View Full Version : Draw a simple OpenGL line with Qt 5.5



lamb
15th July 2015, 22:53
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

d_stranz
15th July 2015, 23:31
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 :-)