Route app viewport scissor through renderer GL
This commit is contained in:
@@ -281,6 +281,51 @@ pp::foundation::Status clear_panopainter_default_target(OpenGlClearDispatch disp
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_opengl_viewport(
|
||||
OpenGlViewportRect viewport,
|
||||
OpenGlViewportDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.viewport == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument("OpenGL viewport dispatch callback must not be null");
|
||||
}
|
||||
|
||||
dispatch.viewport(viewport.x, viewport.y, viewport.width, viewport.height);
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_opengl_scissor_rect(
|
||||
OpenGlScissorRect scissor,
|
||||
OpenGlScissorDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.enable == nullptr || dispatch.disable == nullptr || dispatch.scissor == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument("OpenGL scissor dispatch callbacks must not be null");
|
||||
}
|
||||
|
||||
if (scissor.enabled != 0U) {
|
||||
dispatch.enable(scissor_test_state());
|
||||
dispatch.scissor(scissor.x, scissor.y, scissor.width, scissor.height);
|
||||
} else {
|
||||
dispatch.disable(scissor_test_state());
|
||||
}
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_opengl_scissor_test(
|
||||
bool enabled,
|
||||
OpenGlScissorTestDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.enable == nullptr || dispatch.disable == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument("OpenGL scissor test dispatch callbacks must not be null");
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
dispatch.enable(scissor_test_state());
|
||||
} else {
|
||||
dispatch.disable(scissor_test_state());
|
||||
}
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
std::uint32_t extension_count_query() noexcept
|
||||
{
|
||||
return gl_num_extensions;
|
||||
|
||||
Reference in New Issue
Block a user