Route paint texture unit binding through GL backend
This commit is contained in:
@@ -20,14 +20,36 @@
|
||||
|
||||
namespace {
|
||||
|
||||
void activate_opengl_texture(std::uint32_t texture_unit) noexcept
|
||||
{
|
||||
glActiveTexture(static_cast<GLenum>(texture_unit));
|
||||
}
|
||||
|
||||
void bind_opengl_texture(std::uint32_t target, std::uint32_t texture) noexcept
|
||||
{
|
||||
glBindTexture(static_cast<GLenum>(target), static_cast<GLuint>(texture));
|
||||
}
|
||||
|
||||
void set_active_texture_unit(std::uint32_t unit_index)
|
||||
{
|
||||
glActiveTexture(pp::renderer::gl::active_texture_unit(unit_index));
|
||||
const auto status = pp::renderer::gl::activate_opengl_texture_unit(
|
||||
unit_index,
|
||||
pp::renderer::gl::OpenGlActiveTextureDispatch {
|
||||
.active_texture = activate_opengl_texture,
|
||||
});
|
||||
if (!status.ok())
|
||||
LOG("NodeCanvas active texture dispatch failed because: %s", status.message);
|
||||
}
|
||||
|
||||
void unbind_texture_2d()
|
||||
{
|
||||
glBindTexture(pp::renderer::gl::texture_2d_target(), 0);
|
||||
const auto status = pp::renderer::gl::bind_opengl_texture_2d(
|
||||
0U,
|
||||
pp::renderer::gl::OpenGlTexture2DBindDispatch {
|
||||
.bind_texture = bind_opengl_texture,
|
||||
});
|
||||
if (!status.ok())
|
||||
LOG("NodeCanvas texture unbind dispatch failed because: %s", status.message);
|
||||
}
|
||||
|
||||
pp::renderer::RenderDeviceFeatures node_canvas_stroke_composite_features() noexcept
|
||||
|
||||
Reference in New Issue
Block a user