diff --git a/CMakeLists.txt b/CMakeLists.txt index eff7834..a222b43 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.25) -set(BLT_GRAPHICS_VERSION 0.13.23) +set(BLT_GRAPHICS_VERSION 0.13.24) set(BLT_GRAPHICS_TEST_VERSION 0.0.1) project(BLT_WITH_GRAPHICS VERSION ${BLT_GRAPHICS_VERSION}) diff --git a/src/blt/gfx/renderer/batch_2d_renderer.cpp b/src/blt/gfx/renderer/batch_2d_renderer.cpp index 8a2594f..1530c4a 100644 --- a/src/blt/gfx/renderer/batch_2d_renderer.cpp +++ b/src/blt/gfx/renderer/batch_2d_renderer.cpp @@ -182,42 +182,53 @@ namespace blt::gfx render_reset(); } +// void batch_renderer_2d::draw_objects() +// { +// pre_reset(); +// const f32 denominator = 1.0f / (draw.z_max - draw.z_min); +// +// glEnable(GL_STENCIL_TEST); +// glClear(GL_STENCIL_BUFFER_BIT); +// glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); +// glStencilMask(0xFF); +// +// glStencilFunc(GL_ALWAYS, 1, 0xFF); +// draw_points(true, false, denominator); +// +// glDisable(GL_DEPTH_TEST); +// glStencilFunc(GL_EQUAL, 1, 0xFF); +// draw_points(false, true, denominator); +// glEnable(GL_DEPTH_TEST); +// +// glStencilFunc(GL_ALWAYS, 2, 0xFF); +// draw_rectangles(true, false, denominator); +// +// glDisable(GL_DEPTH_TEST); +// glStencilFunc(GL_EQUAL, 2, 0xFF); +// draw_rectangles(false, true, denominator); +// glEnable(GL_DEPTH_TEST); +// +// glStencilFunc(GL_ALWAYS, 4, 0xFF); +// draw_lines(true, false, denominator); +// +// glDisable(GL_DEPTH_TEST); +// glStencilFunc(GL_EQUAL, 4, 0xFF); +// draw_lines(false, true, denominator); +// glEnable(GL_DEPTH_TEST); +// +// glStencilMask(0x00); +// glDisable(GL_STENCIL_TEST); +// post_reset(); +// } void batch_renderer_2d::draw_objects() { pre_reset(); const f32 denominator = 1.0f / (draw.z_max - draw.z_min); - glEnable(GL_STENCIL_TEST); glClear(GL_STENCIL_BUFFER_BIT); - glStencilOp(GL_KEEP, GL_KEEP, GL_REPLACE); - glStencilMask(0xFF); - - glStencilFunc(GL_ALWAYS, 1, 0xFF); - draw_points(true, false, denominator); - - glDisable(GL_DEPTH_TEST); - glStencilFunc(GL_EQUAL, 1, 0xFF); - draw_points(false, true, denominator); - glEnable(GL_DEPTH_TEST); - - glStencilFunc(GL_ALWAYS, 2, 0xFF); - draw_rectangles(true, false, denominator); - - glDisable(GL_DEPTH_TEST); - glStencilFunc(GL_EQUAL, 2, 0xFF); - draw_rectangles(false, true, denominator); - glEnable(GL_DEPTH_TEST); - - glStencilFunc(GL_ALWAYS, 4, 0xFF); - draw_lines(true, false, denominator); - - glDisable(GL_DEPTH_TEST); - glStencilFunc(GL_EQUAL, 4, 0xFF); - draw_lines(false, true, denominator); - glEnable(GL_DEPTH_TEST); - - glStencilMask(0x00); - glDisable(GL_STENCIL_TEST); + draw_points(false, false, denominator); + draw_rectangles(false, false, denominator); + draw_lines(false, false, denominator); post_reset(); }