Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: draw triangles primitives as wires?  (Read 1021 times)

0 Members and 1 Guest are viewing this topic.

happy11

  • Newbie
  • *
  • Posts: 7
    • View Profile
draw triangles primitives as wires?
« on: August 11, 2023, 05:40:32 am »
I noticed that opening and drawing through RenderWindow with VertexArray and the primitive TRIANGLES produces a filled triangle.

How can I make it draw the triangle as wires/lines instead?

obviously I can draw using lines or linestrips but it is importent for me the keep the structure of the array so using these primitives defeats the purpose.

looking for something similar to 'glPolygonMode'

fallahn

  • Hero Member
  • *****
  • Posts: 504
  • Buns.
    • View Profile
    • Trederia
Re: draw triangles primitives as wires?
« Reply #1 on: August 11, 2023, 10:27:23 am »
There's nothing like that in the SFML api as far as I know, but you can probably expose the OpenGL function by including <SFML/OpenGL.hpp> then calling it around your vertex array

Code: [Select]
glPolygonMode(GL_FRONT_AND_BACK, GL_LINE);
myArray.draw();
myOtherArray.draw();
glPolygonMode(GL_FRONT_AND_BACK, GL_FILL);

 

anything