mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-06-02 14:04:47 -04:00
Linux somewhat functional
This commit is contained in:
@@ -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) {
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user