Search code examples
c++openglglslopengl-3

OpenGL 3.3 glDrawArrays for triangles


I have to draw a height map and when I use: glDrawArrays(GL_TRIANGLES, 0, vertexCount); the program draws filled triangles. But I need only contours of triangles(3 lines). I tried almost every mode for glDrawArray (from here) but there isn't appropriate solution. Of course I can draw three lines for each triangle. But maybe is it possible to draw empty triangles in the better way?


Solution

  • Try changing glPolygonMode to GL_LINE, that should do the trick.