Apply startup GL state through renderer GL
This commit is contained in:
@@ -224,6 +224,27 @@ OpenGlInitialState panopainter_initial_state() noexcept
|
||||
};
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_panopainter_initial_state(OpenGlStateDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.enable == nullptr
|
||||
|| dispatch.disable == nullptr
|
||||
|| dispatch.blend_func == nullptr
|
||||
|| dispatch.blend_equation_separate == nullptr)
|
||||
{
|
||||
return pp::foundation::Status::invalid_argument("OpenGL state dispatch callbacks must not be null");
|
||||
}
|
||||
|
||||
const auto state = panopainter_initial_state();
|
||||
if (state.depth_test_enabled)
|
||||
dispatch.enable(state.depth_test_state);
|
||||
else
|
||||
dispatch.disable(state.depth_test_state);
|
||||
|
||||
dispatch.blend_func(state.source_color_factor, state.destination_color_factor);
|
||||
dispatch.blend_equation_separate(state.color_equation, state.alpha_equation);
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
std::uint32_t extension_count_query() noexcept
|
||||
{
|
||||
return gl_num_extensions;
|
||||
|
||||
Reference in New Issue
Block a user