From f947c96ba400784090aa36c5bde469c92843083d Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Fri, 3 Mar 2023 17:28:19 +0100 Subject: editor: add rendering clickables --- main/draw.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'main') diff --git a/main/draw.cpp b/main/draw.cpp index 2c8ebc7b..57623eef 100644 --- a/main/draw.cpp +++ b/main/draw.cpp @@ -107,7 +107,6 @@ void main_impl::draw_world() noexcept _floor_mesh.draw(_shader, c); } - _clickable_scenery.clear(); GL::Renderer::enable(GL::Renderer::Feature::DepthTest); GL::defaultFramebuffer.clearDepthStencil(0, 0); for (std::int16_t y = miny; y <= maxy; y++) @@ -122,7 +121,10 @@ void main_impl::draw_world() noexcept _wall_mesh.draw(_shader, c); } + _clickable_scenery.clear(); + GL::Renderer::setDepthMask(false); + for (std::int16_t y = miny; y <= maxy; y++) for (std::int16_t x = minx; x <= maxx; x++) { @@ -142,6 +144,7 @@ void main_impl::draw_world() noexcept } } } + GL::Renderer::setDepthMask(true); GL::Renderer::disable(GL::Renderer::Feature::DepthTest); -- cgit v1.2.3