diff --git a/src/Framebuffer.h b/src/Framebuffer.h index f9eb59fce..268714b0d 100644 --- a/src/Framebuffer.h +++ b/src/Framebuffer.h @@ -53,6 +53,20 @@ class MAGNUM_EXPORT Framebuffer { Framebuffer& operator=(Framebuffer&& other) = delete; public: + /** + * @brief Affected polygon facing for culling, stencil operations and masks + * + * @see setFaceCullingMode(), + * setStencilFunction(PolygonFacing, StencilFunction, GLint, GLuint), + * setStencilOperation(PolygonFacing, StencilOperation, StencilOperation, StencilOperation), + * setStencilMask(PolygonFacing, GLuint) + */ + enum class PolygonFacing: GLenum { + Front = GL_FRONT, /**< Front-facing polygons */ + Back = GL_BACK, /**< Back-facing polygons */ + FrontAndBack = GL_FRONT_AND_BACK /**< Front- and back-facing polygons */ + }; + /** @{ @name Framebuffer features */ /** @@ -100,6 +114,17 @@ class MAGNUM_EXPORT Framebuffer { enabled ? glEnable(static_cast(feature)) : glDisable(static_cast(feature)); } + /** + * @brief Which polygon facing to cull + * + * Initial value is `PolygonFacing::Back`. If set to both front and + * back, only points and lines are drawn. + * @attention You have to also enable face culling with setFeature(). + */ + inline static void setFaceCullingMode(PolygonFacing mode) { + glCullFace(static_cast(mode)); + } + /** * @brief Set viewport size * @@ -190,19 +215,6 @@ class MAGNUM_EXPORT Framebuffer { /** @{ @name Stencil operations */ - /** - * @brief Affected polygon facing for stencil operations and masks - * - * @see setStencilFunction(PolygonFacing, StencilFunction, GLint, GLuint), - * setStencilOperation(PolygonFacing, StencilOperation, StencilOperation, StencilOperation), - * setStencilMask(PolygonFacing, GLuint) - */ - enum class PolygonFacing: GLenum { - Front = GL_FRONT, /**< Front-facing polygons */ - Back = GL_BACK, /**< Back-facing polygons */ - FrontAndBack = GL_FRONT_AND_BACK /**< Front- and back-facing polygons */ - }; - /** * @brief Stencil function *