SFML community forums

General => Feature requests => Topic started by: jorne22 on March 18, 2019, 06:12:23 pm

Title: Graphics: Support for more PrimitiveTypes
Post by: jorne22 on March 18, 2019, 06:12:23 pm
Using geometry shaders, I would like to implement silhouette testing of geometry as demonstrated here (http://ogldev.atspace.co.uk/www/tutorial39/tutorial39.html). To do this, the geometry shader requires adjacency data modes which SFML currently doesn't have support for.

RenderTarget::drawPrimitives(...) can be modified to accomodate adjacency modes by adding

Code: [Select]
GL_LINE_STRIP_ADJACENCY,
GL_LINES_ADJACENCY,
GL_TRIANGLE_STRIP_ADJACENCY,
GL_TRIANGLES_ADJACENCY

to the modes[] GLEnum inside the drawPrimitives(...) function. To access these modes, the PrimitiveType enum can be modified appropriately. This makes these new modes easy to access via window.draw(...)

The main caveat with this is that the above modes require OpenGL 3.2 or higher (https://www.khronos.org/registry/OpenGL-Refpages/gl4/html/glDrawArrays.xhtml). I take it this would affect compatibility across devices?