GL context init fixes and warning cleanup

This commit is contained in:
Charles J. Cliffe
2015-01-20 19:13:49 -05:00
parent 3b23813e7b
commit 4dad30e9bd
12 changed files with 33 additions and 20 deletions
+1 -1
View File
@@ -45,7 +45,7 @@ void MeterCanvas::setMax(float max_in) {
level_max = max_in;
}
bool MeterCanvas::setInputValue(float slider_in) {
void MeterCanvas::setInputValue(float slider_in) {
userInputValue = inputValue = slider_in;
}
+1 -1
View File
@@ -23,7 +23,7 @@ public:
void setMax(float max_in);
bool setInputValue(float slider_in);
void setInputValue(float slider_in);
bool inputChanged();
float getInputValue();
+3 -5
View File
@@ -4,14 +4,12 @@
MeterContext::MeterContext(MeterCanvas *canvas, wxGLContext *sharedContext) :
PrimaryGLContext(canvas, sharedContext) {
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
}
void MeterContext::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);
+11 -8
View File
@@ -53,14 +53,14 @@ void PrimaryGLContext::CheckGLError() {
PrimaryGLContext::PrimaryGLContext(wxGLCanvas *canvas, wxGLContext *sharedContext) :
wxGLContext(canvas, sharedContext) {
SetCurrent(*canvas);
#ifndef __linux__
// Pre-load fonts
for (int i = 0; i < GLFONT_MAX; i++) {
getFont((GLFontSize) i);
}
CheckGLError();
#endif
//#ifndef __linux__
// SetCurrent(*canvas);
// // Pre-load fonts
// for (int i = 0; i < GLFONT_MAX; i++) {
// getFont((GLFontSize) i);
// }
// CheckGLError();
//#endif
}
GLFont &PrimaryGLContext::getFont(GLFontSize esize) {
@@ -86,6 +86,9 @@ GLFont &PrimaryGLContext::getFont(GLFontSize esize) {
case GLFONT_SIZE48:
fontName = "vera_sans_mono48.fnt";
break;
default:
fontName = "vera_sans_mono12.fnt";
break;
}
fonts[esize].loadFont(fontName);