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;
|
||||
|
||||
Reference in New Issue
Block a user