Linux somewhat functional

This commit is contained in:
Charles J. Cliffe
2015-01-18 01:36:28 -05:00
parent c04779e91b
commit 963e26bc07
6 changed files with 78 additions and 35 deletions
+2
View File
@@ -54,11 +54,13 @@ 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
}
GLFont &PrimaryGLContext::getFont(GLFontSize esize) {
+13 -17
View File
@@ -20,23 +20,6 @@ void WaterfallContext::Setup(int fft_size_in, int num_waterfall_lines_in) {
waterfall_tex = new unsigned char[fft_size * waterfall_lines];
memset(waterfall_tex, 0, fft_size * waterfall_lines);
glDisable(GL_CULL_FACE);
glDisable(GL_DEPTH_TEST);
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
glGenTextures(1, &waterfall);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, waterfall);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
void WaterfallContext::refreshTheme() {
@@ -51,6 +34,19 @@ void WaterfallContext::refreshTheme() {
void WaterfallContext::Draw(std::vector<float> &points) {
if (!waterfall) {
glGenTextures(1, &waterfall);
glEnable(GL_TEXTURE_2D);
glBindTexture(GL_TEXTURE_2D, waterfall);
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
}
if (activeTheme != ThemeMgr::mgr.currentTheme) {
refreshTheme();
activeTheme = ThemeMgr::mgr.currentTheme;