CubicSDR/src/ui/UITestContext.cpp

56 lines
1.7 KiB
C++
Raw Normal View History

#include "UITestContext.h"
#include "UITestCanvas.h"
#include "ColorTheme.h"
UITestContext::UITestContext(UITestCanvas *canvas, wxGLContext *sharedContext) :
PrimaryGLContext(canvas, sharedContext) {
2015-06-21 11:58:14 -04:00
testPanel.setPosition(0.0, 0.0);
testPanel.setSize(1.0, 1.0);
2015-06-27 01:26:07 -04:00
testPanel.setMarginPx(10);
2015-06-21 11:58:14 -04:00
testPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_Y);
testPanel.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
testChildPanel.setPosition(0.0, 0.0);
2015-06-27 01:55:39 -04:00
testChildPanel.setMarginPx(10,10,10,5);
testChildPanel.setSize(1.0, 0.5);
2015-06-21 11:58:14 -04:00
testChildPanel.setFill(GLPanel::GLPANEL_FILL_GRAD_BAR_X);
testChildPanel.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
2015-06-27 01:26:07 -04:00
testChildPanel.setBorderPx(1);
2015-06-21 11:58:14 -04:00
2015-06-27 01:55:39 -04:00
testChildPanel2.setPosition(0.0, 0.5);
testChildPanel2.setSize(1.0, 0.5);
testChildPanel2.setMarginPx(10,10,5,10);
2015-06-21 11:58:14 -04:00
testChildPanel2.setFill(GLPanel::GLPANEL_FILL_GRAD_X);
testChildPanel2.setFillColor(RGB(0.0,0.0,1.0), RGB(0.0,1.0,0.0));
2015-06-22 22:07:46 -04:00
testChildPanel2.setBorderColor(RGB(1.0,0.0,0.0));
2015-06-27 01:55:39 -04:00
testChildPanel2.setBorderPx(1);
2015-06-21 11:58:14 -04:00
testPanel.addChild(&testChildPanel);
testPanel.addChild(&testChildPanel2);
}
void UITestContext::DrawBegin() {
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glClearColor(ThemeMgr::mgr.currentTheme->generalBackground.r, ThemeMgr::mgr.currentTheme->generalBackground.g, ThemeMgr::mgr.currentTheme->generalBackground.b, 1.0);
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
glMatrixMode(GL_MODELVIEW);
glLoadIdentity();
glDisable(GL_TEXTURE_2D);
}
void UITestContext::Draw() {
testPanel.draw(CubicVR::mat4::identity());
}
void UITestContext::DrawEnd() {
glFlush();
CheckGLError();
}