diff --git a/docs/modernization/build-inventory.md b/docs/modernization/build-inventory.md index d5c731f..069efb1 100644 --- a/docs/modernization/build-inventory.md +++ b/docs/modernization/build-inventory.md @@ -177,6 +177,8 @@ Known local toolchain state: `NodeColorWheel` triangle-buffer setup and draw-state handling also consume backend-owned array-buffer, static-upload, vertex-attribute, primitive-mode, and blend-state tokens. + Simple UI text, text-input, border, scroll, and animation timeline draw + paths also consume backend-owned 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 bae568f..4dee7e7 100644 --- a/docs/modernization/roadmap.md +++ b/docs/modernization/roadmap.md @@ -444,6 +444,8 @@ sampler filters, blend-state tokens, and RGBA8/RGBA texture format mapping to `NodeColorWheel` triangle-buffer setup and draw-state handling now delegate array-buffer, static-upload, vertex-attribute, primitive-mode, and blend-state tokens to `pp_renderer_gl`. +Simple UI text, text-input, border, scroll, and animation timeline draw paths +now also delegate blend-state tokens to `pp_renderer_gl`. The existing renderer classes are not yet fully behind the renderer interfaces. diff --git a/src/node_border.cpp b/src/node_border.cpp index fddf5e2..0f90187 100644 --- a/src/node_border.cpp +++ b/src/node_border.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "log.h" #include "node_border.h" +#include "renderer_gl/opengl_capabilities.h" #include "shader.h" Plane NodeBorder::m_plane; @@ -62,21 +63,22 @@ void NodeBorder::draw() { ShaderManager::use(kShader::Color); ShaderManager::u_mat4(kShaderUniform::MVP, m_mvp); + const auto blend_state = pp::renderer::gl::blend_state(); if (m_color.a > 0.f) { - m_color.a < 1.f ? glEnable(GL_BLEND) : glDisable(GL_BLEND); + m_color.a < 1.f ? glEnable(blend_state) : glDisable(blend_state); ShaderManager::u_vec4(kShaderUniform::Col, m_color); m_plane.draw_fill(); - glDisable(GL_BLEND); + glDisable(blend_state); } if (m_thinkness > 0 && m_border_color.a > 0.f) { //glLineWidth(m_thinkness); ShaderManager::u_vec4(kShaderUniform::Col, m_border_color); - m_border_color.a < 1.f ? glEnable(GL_BLEND) : glDisable(GL_BLEND); + m_border_color.a < 1.f ? glEnable(blend_state) : glDisable(blend_state); m_plane.draw_stroke(); - glDisable(GL_BLEND); + glDisable(blend_state); } } diff --git a/src/node_panel_animation.cpp b/src/node_panel_animation.cpp index a68a0a5..f52a215 100644 --- a/src/node_panel_animation.cpp +++ b/src/node_panel_animation.cpp @@ -2,6 +2,7 @@ #include "node_panel_animation.h" #include "node_button.h" #include "node_button_custom.h" +#include "renderer_gl/opengl_capabilities.h" #include "canvas.h" #include "app.h" @@ -236,7 +237,7 @@ void NodeAnimationTimeline::draw() { parent::draw(); ShaderManager::use(kShader::Color); - glDisable(GL_BLEND); + glDisable(pp::renderer::gl::blend_state()); float step = 35.f; glm::vec2 cur_pos = { diff --git a/src/node_scroll.cpp b/src/node_scroll.cpp index cd72777..69bb245 100644 --- a/src/node_scroll.cpp +++ b/src/node_scroll.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "log.h" #include "node_scroll.h" +#include "renderer_gl/opengl_capabilities.h" #include "event.h" #include "shader.h" @@ -110,7 +111,7 @@ void NodeScroll::draw() if (rect.w > 0 && rect.z > 0) { - glDisable(GL_BLEND); + glDisable(pp::renderer::gl::blend_state()); ShaderManager::use(kShader::Color); if (m_direction == kScrollDirection::Vertical) diff --git a/src/node_text.cpp b/src/node_text.cpp index 8d007c9..0416cde 100644 --- a/src/node_text.cpp +++ b/src/node_text.cpp @@ -1,6 +1,7 @@ #include "pch.h" #include "log.h" #include "node_text.h" +#include "renderer_gl/opengl_capabilities.h" #include "shader.h" Node* NodeText::clone_instantiate() const @@ -173,9 +174,9 @@ void NodeText::draw() ShaderManager::u_int(kShaderUniform::Tex, 0); ShaderManager::u_mat4(kShaderUniform::MVP, m_proj * pos); ShaderManager::u_vec4(kShaderUniform::Col, m_color); - glEnable(GL_BLEND); + glEnable(pp::renderer::gl::blend_state()); m_text_mesh.draw(); - glDisable(GL_BLEND); + glDisable(pp::renderer::gl::blend_state()); } void NodeText::handle_resize(glm::vec2 old_size, glm::vec2 new_size, float zoom) diff --git a/src/node_text_input.cpp b/src/node_text_input.cpp index 2ddf854..0690395 100644 --- a/src/node_text_input.cpp +++ b/src/node_text_input.cpp @@ -2,6 +2,7 @@ #include "app.h" #include "log.h" #include "node_text_input.h" +#include "renderer_gl/opengl_capabilities.h" #include "node_border.h" Node* NodeTextInput::clone_instantiate() const @@ -219,13 +220,13 @@ void NodeTextInput::draw() ShaderManager::u_int(kShaderUniform::Tex, 0); ShaderManager::u_mat4(kShaderUniform::MVP, m_proj * pos); ShaderManager::u_vec4(kShaderUniform::Col, m_color); - glEnable(GL_BLEND); + glEnable(pp::renderer::gl::blend_state()); m_text_mesh.draw(); - glDisable(GL_BLEND); + glDisable(pp::renderer::gl::blend_state()); if (m_cursor_visible) { - glDisable(GL_BLEND); + glDisable(pp::renderer::gl::blend_state()); glm::mat4 cur_pos = glm::translate(glm::vec3(m_pos + m_off + xy(m_text_mesh.cur_box), 0)); glm::mat4 cur_scale = glm::scale(glm::vec3(zw(m_text_mesh.cur_box), 1)); glm::mat4 cur_pivot = glm::translate(glm::vec3(0.5, 0.5, 0));