Route VR render state through renderer GL
This commit is contained in:
@@ -326,6 +326,35 @@ pp::foundation::Status apply_opengl_scissor_test(
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_opengl_capability(
|
||||
std::uint32_t state,
|
||||
bool enabled,
|
||||
OpenGlCapabilityDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.enable == nullptr || dispatch.disable == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument("OpenGL capability dispatch callbacks must not be null");
|
||||
}
|
||||
|
||||
if (enabled) {
|
||||
dispatch.enable(state);
|
||||
} else {
|
||||
dispatch.disable(state);
|
||||
}
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status clear_opengl_buffers(
|
||||
std::uint32_t mask,
|
||||
OpenGlBufferClearDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.clear == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument("OpenGL buffer clear dispatch callback must not be null");
|
||||
}
|
||||
|
||||
dispatch.clear(mask);
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
std::uint32_t extension_count_query() noexcept
|
||||
{
|
||||
return gl_num_extensions;
|
||||
|
||||
@@ -178,6 +178,15 @@ struct OpenGlScissorTestDispatch {
|
||||
OpenGlCapabilityFn disable = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlCapabilityDispatch {
|
||||
OpenGlCapabilityFn enable = nullptr;
|
||||
OpenGlCapabilityFn disable = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlBufferClearDispatch {
|
||||
OpenGlClearFn clear = nullptr;
|
||||
};
|
||||
|
||||
[[nodiscard]] OpenGlCapabilities detect_opengl_capabilities(
|
||||
std::span<const std::string_view> extensions,
|
||||
OpenGlRuntime runtime) noexcept;
|
||||
@@ -198,6 +207,13 @@ struct OpenGlScissorTestDispatch {
|
||||
[[nodiscard]] pp::foundation::Status apply_opengl_scissor_test(
|
||||
bool enabled,
|
||||
OpenGlScissorTestDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status apply_opengl_capability(
|
||||
std::uint32_t state,
|
||||
bool enabled,
|
||||
OpenGlCapabilityDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status clear_opengl_buffers(
|
||||
std::uint32_t mask,
|
||||
OpenGlBufferClearDispatch dispatch) noexcept;
|
||||
|
||||
[[nodiscard]] std::uint32_t extension_count_query() noexcept;
|
||||
[[nodiscard]] std::uint32_t extension_string_name() noexcept;
|
||||
|
||||
Reference in New Issue
Block a user