January 3, 2013

c.buss c.buss
Lab Rat
1 posts

Set LineWith using Qt5 on Windows with OpenGL

 

Hi,

today I was successful drawing lines with OpenGL using Qt5 on Windows. However I was not able to change the OpenGL line width.

Minimum example:
Started with the project gui/openglwindow. In the file main.cpp I changed the command to draw the triangle from glDrawArrays(GL_TRIANGLES, 0, 3);
to glDrawArrays(GL_LINE_STRIP, 0, 3);
which results in two lines being drawn that change colors between the vertex points.

Question: How do I change the width of the lines being drawn? Is there a simple solution using Qt or OpenGL methods (glLineWidth does not seem to work but gives no error either)? Can shaders be employed? If so, how? Does the behaviour differ if desktop OpenGL is used instead of OpenGL ES with the ANGLE library?

Thanks in advance for your help.

Best regards,
Christian

0 replies

 
  ‹‹ Converting colored image to black-white image      Issues migrating from Qt 4.8.1 to Qt 5 ››

You must log in to post a reply. Not a member yet? Register here!