summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gfx/include/gfx/render_backend.h3
-rw-r--r--gfx/src/render/render_backend.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/gfx/include/gfx/render_backend.h b/gfx/include/gfx/render_backend.h
index 722ea5e..8d3c42b 100644
--- a/gfx/include/gfx/render_backend.h
+++ b/gfx/include/gfx/render_backend.h
@@ -338,6 +338,9 @@ void gfx_set_culling(RenderBackend*, bool enable);
338/// Set polygon offset. 338/// Set polygon offset.
339void gfx_set_polygon_offset(RenderBackend*, float scale, float bias); 339void gfx_set_polygon_offset(RenderBackend*, float scale, float bias);
340 340
341/// Reset the polygon offset.
342void gfx_reset_polygon_offset(RenderBackend*);
343
341// ----------------------------------------------------------------------------- 344// -----------------------------------------------------------------------------
342// Buffers. 345// Buffers.
343// ----------------------------------------------------------------------------- 346// -----------------------------------------------------------------------------
diff --git a/gfx/src/render/render_backend.c b/gfx/src/render/render_backend.c
index 4e783f8..8e88feb 100644
--- a/gfx/src/render/render_backend.c
+++ b/gfx/src/render/render_backend.c
@@ -130,6 +130,12 @@ void gfx_set_polygon_offset(
130 glPolygonOffset(scale, bias); 130 glPolygonOffset(scale, bias);
131} 131}
132 132
133void gfx_reset_polygon_offset(RenderBackend* render_backend) {
134 assert(render_backend);
135 glPolygonOffset(0, 0);
136 glDisable(GL_POLYGON_OFFSET_FILL);
137}
138
133// ----------------------------------------------------------------------------- 139// -----------------------------------------------------------------------------
134// Buffers. 140// Buffers.
135// ----------------------------------------------------------------------------- 141// -----------------------------------------------------------------------------