diff options
| author | hachem <im@hachem.wtf> | 2025-08-12 19:17:50 +0200 |
|---|---|---|
| committer | hachem <im@hachem.wtf> | 2025-08-12 19:17:50 +0200 |
| commit | 3b02022fd79ad0e130b8c49e7707d221bfc97bb5 (patch) | |
| tree | 0da9ee9559969a7f40d92611a3b1c234e38ae36f /src/platform/opengl/opengl_renderer_api.cpp | |
| parent | 7e06a916e6a385c37075abcb83d14b8c1fef7bc0 (diff) | |
feat: texture and pixel buffers
Diffstat (limited to 'src/platform/opengl/opengl_renderer_api.cpp')
| -rw-r--r-- | src/platform/opengl/opengl_renderer_api.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/platform/opengl/opengl_renderer_api.cpp b/src/platform/opengl/opengl_renderer_api.cpp index 49b4e53..3a147b9 100644 --- a/src/platform/opengl/opengl_renderer_api.cpp +++ b/src/platform/opengl/opengl_renderer_api.cpp @@ -8,6 +8,11 @@ namespace Donut glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_DEPTH_TEST); + glDepthFunc(GL_LESS); + + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glFrontFace(GL_CCW); } void OpenGLRendererAPI::set_viewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) @@ -30,6 +35,18 @@ namespace Donut glEnable(GL_DEPTH_TEST); } + void OpenGLRendererAPI::set_face_culling(bool enabled) + { + if (enabled) + { + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glFrontFace(GL_CCW); + } + else + glDisable(GL_CULL_FACE); + } + void OpenGLRendererAPI::draw_indexed(const std::shared_ptr<VertexArray>& vertex_array, uint32_t index_count) { uint32_t count = index_count ? index_count : vertex_array->get_index_buffer()->get_count(); |
