mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 14:04:47 -04:00
GL context init fixes and warning cleanup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -23,7 +23,7 @@ public:
|
||||
|
||||
void setMax(float max_in);
|
||||
|
||||
bool setInputValue(float slider_in);
|
||||
void setInputValue(float slider_in);
|
||||
bool inputChanged();
|
||||
float getInputValue();
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user