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 | 1ad6bc34323f5b30d463ebe47a58d47ff9d4f328 (patch) | |
| tree | 535774e6db8e03fdb204c27734ca9fa43ab30a61 /src/Platform/OpenGL/OpenGLRendererAPI.cpp | |
| parent | 8cf6858a6cd958f31521c4ce680cf2011bfb7cc3 (diff) | |
[add]: Texture and Pixel buffers
Diffstat (limited to 'src/Platform/OpenGL/OpenGLRendererAPI.cpp')
| -rw-r--r-- | src/Platform/OpenGL/OpenGLRendererAPI.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/Platform/OpenGL/OpenGLRendererAPI.cpp b/src/Platform/OpenGL/OpenGLRendererAPI.cpp index 3660555..5ee7d8d 100644 --- a/src/Platform/OpenGL/OpenGLRendererAPI.cpp +++ b/src/Platform/OpenGL/OpenGLRendererAPI.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::SetViewport(uint32_t x, uint32_t y, uint32_t width, uint32_t height) @@ -30,6 +35,18 @@ namespace Donut glEnable(GL_DEPTH_TEST); } + void OpenGLRendererAPI::SetFaceCulling(bool enabled) + { + if (enabled) + { + glEnable(GL_CULL_FACE); + glCullFace(GL_BACK); + glFrontFace(GL_CCW); + } + else + glDisable(GL_CULL_FACE); + } + void OpenGLRendererAPI::DrawIndexed(const std::shared_ptr<VertexArray>& vertexArray, uint32_t indexCount) { uint32_t count = indexCount ? indexCount : vertexArray->GetIndexBuffer()->GetCount(); |
