Map renderer viewport and scissor to OpenGL
This commit is contained in:
@@ -669,6 +669,18 @@ std::uint32_t viewport_query() noexcept
|
||||
return gl_viewport;
|
||||
}
|
||||
|
||||
OpenGlViewportRect viewport_for_renderer_viewport(pp::renderer::Viewport viewport) noexcept
|
||||
{
|
||||
return OpenGlViewportRect {
|
||||
.x = viewport.x,
|
||||
.y = viewport.y,
|
||||
.width = static_cast<std::int32_t>(viewport.width),
|
||||
.height = static_cast<std::int32_t>(viewport.height),
|
||||
.min_depth = viewport.min_depth,
|
||||
.max_depth = viewport.max_depth,
|
||||
};
|
||||
}
|
||||
|
||||
std::uint32_t color_clear_value_query() noexcept
|
||||
{
|
||||
return gl_color_clear_value;
|
||||
@@ -749,6 +761,17 @@ std::uint32_t scissor_test_state() noexcept
|
||||
return gl_scissor_test;
|
||||
}
|
||||
|
||||
OpenGlScissorRect scissor_rect_for_renderer_scissor(pp::renderer::ScissorRect scissor) noexcept
|
||||
{
|
||||
return OpenGlScissorRect {
|
||||
.enabled = scissor.enabled ? gl_boolean_true : gl_boolean_false,
|
||||
.x = scissor.x,
|
||||
.y = scissor.y,
|
||||
.width = static_cast<std::int32_t>(scissor.width),
|
||||
.height = static_cast<std::int32_t>(scissor.height),
|
||||
};
|
||||
}
|
||||
|
||||
std::uint32_t program_point_size_state() noexcept
|
||||
{
|
||||
return gl_program_point_size;
|
||||
|
||||
@@ -34,6 +34,23 @@ struct OpenGlTextureParameter {
|
||||
std::uint32_t value = 0;
|
||||
};
|
||||
|
||||
struct OpenGlViewportRect {
|
||||
std::int32_t x = 0;
|
||||
std::int32_t y = 0;
|
||||
std::int32_t width = 0;
|
||||
std::int32_t height = 0;
|
||||
float min_depth = 0.0F;
|
||||
float max_depth = 1.0F;
|
||||
};
|
||||
|
||||
struct OpenGlScissorRect {
|
||||
std::uint8_t enabled = 0;
|
||||
std::int32_t x = 0;
|
||||
std::int32_t y = 0;
|
||||
std::int32_t width = 0;
|
||||
std::int32_t height = 0;
|
||||
};
|
||||
|
||||
struct OpenGlEnumMapping {
|
||||
std::uint32_t value = 0;
|
||||
bool supported = false;
|
||||
@@ -158,6 +175,8 @@ struct OpenGlWindowsWglContextConfig {
|
||||
[[nodiscard]] std::uint32_t renderer_string_name() noexcept;
|
||||
[[nodiscard]] std::uint32_t shading_language_version_string_name() noexcept;
|
||||
[[nodiscard]] std::uint32_t viewport_query() noexcept;
|
||||
[[nodiscard]] OpenGlViewportRect viewport_for_renderer_viewport(
|
||||
pp::renderer::Viewport viewport) noexcept;
|
||||
[[nodiscard]] std::uint32_t color_clear_value_query() noexcept;
|
||||
[[nodiscard]] std::uint32_t current_program_query() noexcept;
|
||||
[[nodiscard]] std::uint32_t active_texture_query() noexcept;
|
||||
@@ -171,6 +190,8 @@ struct OpenGlWindowsWglContextConfig {
|
||||
[[nodiscard]] OpenGlDepthState depth_state_for_renderer_depth_state(
|
||||
pp::renderer::DepthState state) noexcept;
|
||||
[[nodiscard]] std::uint32_t scissor_test_state() noexcept;
|
||||
[[nodiscard]] OpenGlScissorRect scissor_rect_for_renderer_scissor(
|
||||
pp::renderer::ScissorRect scissor) noexcept;
|
||||
[[nodiscard]] std::uint32_t program_point_size_state() noexcept;
|
||||
[[nodiscard]] std::uint32_t line_smooth_state() noexcept;
|
||||
[[nodiscard]] std::uint32_t source_alpha_blend_factor() noexcept;
|
||||
|
||||
Reference in New Issue
Block a user