diff options
author | Stephan Vedder <vedder@mbits.info> | 2022-04-29 11:24:23 +0300 |
---|---|---|
committer | Stephan Vedder <vedder@mbits.info> | 2022-04-29 11:24:23 +0300 |
commit | 0b88a80089fd4257ca807b367770b17f02ef2dc0 (patch) | |
tree | 6816bb3ad64d2305f6042f37969048d0a1aa922b /Source | |
parent | 93ad205c3df9de871f0555229eaadb7a5a96eb59 (diff) |
Remove unused debug visualization
Diffstat (limited to 'Source')
-rw-r--r-- | Source/GUI/IMUI/imui.cpp | 76 | ||||
-rw-r--r-- | Source/GUI/IMUI/imui.h | 3 |
2 files changed, 0 insertions, 79 deletions
diff --git a/Source/GUI/IMUI/imui.cpp b/Source/GUI/IMUI/imui.cpp index 4c82d753..c3857554 100644 --- a/Source/GUI/IMUI/imui.cpp +++ b/Source/GUI/IMUI/imui.cpp @@ -187,7 +187,6 @@ void IMUIContext::Init() { hot_ = -1; active_ = -1; lmb_state = kMouseStillUp; - debug_viz_enabled_ = false; gl_state.blend = true; gl_state.cull_face = false; @@ -202,13 +201,6 @@ bool IMUIContext::DoButton( int id, vec2 top_left, vec2 bottom_right, UIState& u { mouse_over = true; } - - if(debug_viz_enabled_){ - debug_viz_squares.resize(debug_viz_squares.size() + 1); - debug_viz_squares.back().top_left = top_left; - debug_viz_squares.back().bottom_right = bottom_right; - debug_viz_squares.back().ui_state = ui_state; - } return DoButtonMouseOver(id, mouse_over, ui_state); } @@ -269,74 +261,6 @@ void IMUIContext::UpdateControls() { } break; } - if(debug_viz_enabled_){ - Draw(); - } -} - - -void IMUIContext::Draw() { - Graphics* gi = Graphics::Instance(); - gi->setGLState(gl_state); - Shaders::Instance()->noProgram(); - - glMatrixMode(GL_PROJECTION); - glPushMatrix(); - glLoadIdentity(); - glOrtho(0, gi->window_dims[0], - 0, gi->window_dims[1], - -100,100); - glMatrixMode(GL_MODELVIEW); - glPushMatrix(); - glLoadIdentity(); - glPushAttrib(GL_POLYGON_BIT); - - for(unsigned i=0; i<debug_viz_squares.size(); ++i){ - const DebugVizSquare &square = debug_viz_squares[i]; - switch(square.ui_state){ - case kActive: - glColor4f(0.1f,0.1f,0.1f,0.5f); break; - case kNothing: - glColor4f(0.5f,0.5f,0.5f,0.5f); break; - case kHot: - glColor4f(0.8f,0.8f,0.8f,0.5f); break; - } - int border_offset_y = 2; - int border_offset_x = 2; - int x1 = (int)square.top_left[0]; - int x2 = (int)square.bottom_right[0]; - int y1 = (int)square.top_left[1]; - int y2 = (int)square.bottom_right[1]; - if (y2 > y1) border_offset_y *= -1; - if (x2 < x1) border_offset_x *= -1; - glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); - //TODO: set stipple - glBegin(GL_QUADS); - glVertex3f((GLfloat)(x1+border_offset_x),(GLfloat)(y1-border_offset_y),0); - glVertex3f((GLfloat)(x2-border_offset_x),(GLfloat)(y1-border_offset_y),0); - glVertex3f((GLfloat)(x2-border_offset_x),(GLfloat)(y2+border_offset_y),0); - glVertex3f((GLfloat)(x1+border_offset_x),(GLfloat)(y2+border_offset_y),0); - glEnd(); - glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); - Graphics::Instance()->SetLineWidth(2); - glColor4f(0,0,0,1); - glBegin(GL_QUADS); - glVertex3f((GLfloat)x1,(GLfloat)y1,0); - glVertex3f((GLfloat)x2,(GLfloat)y1,0); - glVertex3f((GLfloat)x2,(GLfloat)y2,0); - glVertex3f((GLfloat)x1,(GLfloat)y2,0); - glEnd(); - } - glPopAttrib(); - glPopMatrix(); - glMatrixMode(GL_PROJECTION); - glPopMatrix(); - glMatrixMode(GL_MODELVIEW); - debug_viz_squares.clear(); -} - -void IMUIContext::SetDebugVizEnabled( bool enabled ) { - debug_viz_enabled_ = enabled; } vec2 IMUIContext::getMousePosition() { diff --git a/Source/GUI/IMUI/imui.h b/Source/GUI/IMUI/imui.h index e046e7ee..85622668 100644 --- a/Source/GUI/IMUI/imui.h +++ b/Source/GUI/IMUI/imui.h @@ -378,7 +378,6 @@ public: bool DoButtonMouseOver( int id, bool mouse_over, UIState& ui_state); void ClearHot(); void Init(); - void SetDebugVizEnabled(bool enabled); vec2 getMousePosition(); ButtonState getLeftMouseState(); @@ -469,13 +468,11 @@ private: vec2 top_left, bottom_right; }; - bool debug_viz_enabled_; int hot_; int active_; vec2 mouse_pos; ButtonState lmb_state; - std::vector<DebugVizSquare> debug_viz_squares; std::vector<IMUIRenderableType*> renderables; void Draw(); |