diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index 807fae4..3868dd1 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -169,6 +169,8 @@ Known local toolchain state: texture target, RGBA pixel format, and unsigned-byte component mapping. `NodeViewport` preview rendering also consumes backend-owned viewport query, clear-color query, color-buffer clear mask, and blend-state tokens. + `NodeImageTexture` preview drawing also consumes backend-owned fallback 2D + texture bind and blend-state tokens. - `windows-msvc-vcpkg-headless` validates manifest install/configure/build/test for the current headless component matrix; see DEBT-0007 for remaining app and platform triplet migration. diff --git a/docs/modernization/roadmap.md b/docs/modernization/roadmap.md index f649c72..6b5682f 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -436,6 +436,8 @@ mapping to `pp_renderer_gl`. `NodeViewport` preview rendering now also delegates viewport query, clear-color query, color-buffer clear mask, and blend-state tokens to `pp_renderer_gl`. +`NodeImageTexture` preview drawing now delegates its fallback 2D texture bind +target and blend-state tokens to `pp_renderer_gl`. The existing renderer classes are not yet fully behind the renderer interfaces. diff --git a/src/node_image_texture.cpp b/src/node_image_texture.cpp index 184657c..673630a 100644 --- a/src/node_image_texture.cpp +++ b/src/node_image_texture.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "log.h" #include "node_image_texture.h" +#include "renderer_gl/opengl_capabilities.h" #include "shader.h" #include "node_image.h" @@ -18,14 +19,14 @@ void NodeImageTexture::clone_copy(Node* dest) const void NodeImageTexture::draw() { - tex ? tex->bind() : glBindTexture(GL_TEXTURE_2D, 0); + tex ? tex->bind() : glBindTexture(pp::renderer::gl::texture_2d_target(), 0); auto& sampler = tex && tex->has_mips ? NodeImage::m_sampler_mips : NodeImage::m_sampler; sampler.bind(0); - glEnable(GL_BLEND); + glEnable(pp::renderer::gl::blend_state()); ShaderManager::use(kShader::Texture); ShaderManager::u_int(kShaderUniform::Tex, 0); ShaderManager::u_mat4(kShaderUniform::MVP, m_mvp); NodeImage::m_plane.draw_fill(); sampler.unbind(); - glDisable(GL_BLEND); + glDisable(pp::renderer::gl::blend_state()); }