Route GL runtime info through renderer GL
This commit is contained in:
@@ -245,6 +245,22 @@ pp::foundation::Status apply_panopainter_initial_state(OpenGlStateDispatch dispa
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Result<OpenGlRuntimeInfo> query_opengl_runtime_info(
|
||||
OpenGlRuntimeInfoDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.get_string == nullptr) {
|
||||
return pp::foundation::Result<OpenGlRuntimeInfo>::failure(
|
||||
pp::foundation::Status::invalid_argument("OpenGL runtime info string callback must not be null"));
|
||||
}
|
||||
|
||||
return pp::foundation::Result<OpenGlRuntimeInfo>::success(OpenGlRuntimeInfo {
|
||||
.version = dispatch.get_string(version_string_name()),
|
||||
.vendor = dispatch.get_string(vendor_string_name()),
|
||||
.renderer = dispatch.get_string(renderer_string_name()),
|
||||
.shading_language_version = dispatch.get_string(shading_language_version_string_name()),
|
||||
});
|
||||
}
|
||||
|
||||
std::uint32_t extension_count_query() noexcept
|
||||
{
|
||||
return gl_num_extensions;
|
||||
|
||||
@@ -135,6 +135,19 @@ struct OpenGlStateDispatch {
|
||||
OpenGlBlendEquationSeparateFn blend_equation_separate = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlRuntimeInfo {
|
||||
const char* version = "";
|
||||
const char* vendor = "";
|
||||
const char* renderer = "";
|
||||
const char* shading_language_version = "";
|
||||
};
|
||||
|
||||
using OpenGlStringQueryFn = const char* (*)(std::uint32_t name) noexcept;
|
||||
|
||||
struct OpenGlRuntimeInfoDispatch {
|
||||
OpenGlStringQueryFn get_string = nullptr;
|
||||
};
|
||||
|
||||
[[nodiscard]] OpenGlCapabilities detect_opengl_capabilities(
|
||||
std::span<const std::string_view> extensions,
|
||||
OpenGlRuntime runtime) noexcept;
|
||||
@@ -142,6 +155,8 @@ struct OpenGlStateDispatch {
|
||||
OpenGlCapabilities capabilities) noexcept;
|
||||
[[nodiscard]] OpenGlInitialState panopainter_initial_state() noexcept;
|
||||
[[nodiscard]] pp::foundation::Status apply_panopainter_initial_state(OpenGlStateDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Result<OpenGlRuntimeInfo> query_opengl_runtime_info(
|
||||
OpenGlRuntimeInfoDispatch 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