Route default clear through renderer GL
This commit is contained in:
24
src/app.cpp
24
src/app.cpp
@@ -55,6 +55,16 @@ void set_opengl_blend_equation_separate(std::uint32_t color_equation, std::uint3
|
||||
glBlendEquationSeparate(static_cast<GLenum>(color_equation), static_cast<GLenum>(alpha_equation));
|
||||
}
|
||||
|
||||
void clear_opengl_color(float r, float g, float b, float a) noexcept
|
||||
{
|
||||
glClearColor(r, g, b, a);
|
||||
}
|
||||
|
||||
void clear_opengl_buffers(std::uint32_t mask) noexcept
|
||||
{
|
||||
glClear(static_cast<GLbitfield>(mask));
|
||||
}
|
||||
|
||||
[[nodiscard]] GLint rgba8_internal_format() noexcept
|
||||
{
|
||||
return static_cast<GLint>(pp::renderer::gl::rgba8_internal_format());
|
||||
@@ -85,11 +95,6 @@ void set_opengl_blend_equation_separate(std::uint32_t color_equation, std::uint3
|
||||
return static_cast<GLuint>(pp::renderer::gl::default_framebuffer_id());
|
||||
}
|
||||
|
||||
[[nodiscard]] GLbitfield framebuffer_color_buffer_mask() noexcept
|
||||
{
|
||||
return static_cast<GLbitfield>(pp::renderer::gl::framebuffer_color_buffer_mask());
|
||||
}
|
||||
|
||||
}
|
||||
std::thread App::render_thread;
|
||||
std::thread::id App::render_thread_id;
|
||||
@@ -208,8 +213,13 @@ bool App::request_close()
|
||||
|
||||
void App::clear()
|
||||
{
|
||||
glClearColor(.1f, .1f, .1f, 1.f);
|
||||
glClear(framebuffer_color_buffer_mask());
|
||||
const auto status = pp::renderer::gl::clear_panopainter_default_target(
|
||||
pp::renderer::gl::OpenGlClearDispatch {
|
||||
.clear_color = clear_opengl_color,
|
||||
.clear = clear_opengl_buffers,
|
||||
});
|
||||
if (!status.ok())
|
||||
LOG("OpenGL clear failed: %s", status.message);
|
||||
}
|
||||
|
||||
void App::initAssets()
|
||||
|
||||
Reference in New Issue
Block a user