Move render debug state setup into GL backend
This commit is contained in:
@@ -485,6 +485,32 @@ pp::foundation::Status apply_opengl_capability(
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_opengl_render_platform_hints(
|
||||
OpenGlRenderPlatformHintDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.enable == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument(
|
||||
"OpenGL render platform hint dispatch callback must not be null");
|
||||
}
|
||||
|
||||
dispatch.enable(program_point_size_state());
|
||||
dispatch.enable(line_smooth_state());
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_opengl_debug_output_states(
|
||||
OpenGlDebugOutputStateDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.enable == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument(
|
||||
"OpenGL debug output state dispatch callback must not be null");
|
||||
}
|
||||
|
||||
dispatch.enable(debug_output_state());
|
||||
dispatch.enable(debug_output_synchronous_state());
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status clear_opengl_buffers(
|
||||
std::uint32_t mask,
|
||||
OpenGlBufferClearDispatch dispatch) noexcept
|
||||
|
||||
@@ -512,6 +512,14 @@ struct OpenGlCapabilityDispatch {
|
||||
OpenGlCapabilityFn disable = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlRenderPlatformHintDispatch {
|
||||
OpenGlCapabilityFn enable = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlDebugOutputStateDispatch {
|
||||
OpenGlCapabilityFn enable = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlBufferClearDispatch {
|
||||
OpenGlClearFn clear = nullptr;
|
||||
};
|
||||
@@ -731,6 +739,10 @@ struct OpenGlMeshDeleteDispatch {
|
||||
std::uint32_t state,
|
||||
bool enabled,
|
||||
OpenGlCapabilityDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status apply_opengl_render_platform_hints(
|
||||
OpenGlRenderPlatformHintDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status apply_opengl_debug_output_states(
|
||||
OpenGlDebugOutputStateDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status clear_opengl_buffers(
|
||||
std::uint32_t mask,
|
||||
OpenGlBufferClearDispatch dispatch) noexcept;
|
||||
|
||||
Reference in New Issue
Block a user