Route paint texture unit binding through GL backend
This commit is contained in:
@@ -503,6 +503,18 @@ pp::foundation::Status clear_opengl_color_buffer_with_write_mask(
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status activate_opengl_texture_unit(
|
||||
std::uint32_t unit_index,
|
||||
OpenGlActiveTextureDispatch dispatch) noexcept
|
||||
{
|
||||
if (dispatch.active_texture == nullptr) {
|
||||
return pp::foundation::Status::invalid_argument("OpenGL active texture dispatch callback must not be null");
|
||||
}
|
||||
|
||||
dispatch.active_texture(active_texture_unit(unit_index));
|
||||
return pp::foundation::Status::success();
|
||||
}
|
||||
|
||||
pp::foundation::Status apply_opengl_viewport(
|
||||
OpenGlViewportRect viewport,
|
||||
OpenGlViewportDispatch dispatch) noexcept
|
||||
|
||||
@@ -563,6 +563,10 @@ struct OpenGlClearDispatch {
|
||||
OpenGlClearFn clear = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlActiveTextureDispatch {
|
||||
OpenGlActiveTextureFn active_texture = nullptr;
|
||||
};
|
||||
|
||||
struct OpenGlColorMaskedClearDispatch {
|
||||
OpenGlGetBooleanFn get_boolean = nullptr;
|
||||
OpenGlColorMaskFn color_mask = nullptr;
|
||||
@@ -878,6 +882,9 @@ struct OpenGlMeshDeleteDispatch {
|
||||
[[nodiscard]] pp::foundation::Status clear_opengl_color_buffer_with_write_mask(
|
||||
OpenGlColorMaskedClear clear,
|
||||
OpenGlColorMaskedClearDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status activate_opengl_texture_unit(
|
||||
std::uint32_t unit_index,
|
||||
OpenGlActiveTextureDispatch dispatch) noexcept;
|
||||
[[nodiscard]] pp::foundation::Status apply_opengl_viewport(
|
||||
OpenGlViewportRect viewport,
|
||||
OpenGlViewportDispatch dispatch) noexcept;
|
||||
|
||||
Reference in New Issue
Block a user