diff --git a/src/visual/PrimaryGLContext.cpp b/src/visual/PrimaryGLContext.cpp index 90404cc..4edd881 100644 --- a/src/visual/PrimaryGLContext.cpp +++ b/src/visual/PrimaryGLContext.cpp @@ -195,8 +195,55 @@ void PrimaryGLContext::DrawDemod(DemodulatorInstance *demod, float r, float g, f glVertex3f((uxPos - 0.5) * 2.0 + ofs, 1.0, 0.0); glEnd(); + GLint vp[4]; + glGetIntegerv( GL_VIEWPORT, vp); + + float viewHeight = (float) vp[3]; + float viewWidth = (float) vp[2]; + + float labelHeight = 20.0 / viewHeight; + float xOfs = (2.0 / viewWidth); + float yOfs = (2.0 / viewHeight); + float hPos = labelHeight; + + glDisable(GL_BLEND); + + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glDisable(GL_COLOR_MATERIAL); + + glEnable(GL_BLEND); + + std::string demodStr; + GLFont::Align demodAlign; + + switch (demod->getDemodulatorType()) { + case DEMOD_TYPE_FM: + demodStr = "FM"; + demodAlign = GLFont::GLFONT_ALIGN_CENTER; + break; + case DEMOD_TYPE_AM: + demodStr = "AM"; + demodAlign = GLFont::GLFONT_ALIGN_CENTER; + break; + case DEMOD_TYPE_LSB: + demodStr = "LSB"; + demodAlign = GLFont::GLFONT_ALIGN_RIGHT; + break; + case DEMOD_TYPE_USB: + demodStr = "USB"; + demodAlign = GLFont::GLFONT_ALIGN_LEFT; + break; + } + + glColor3f(0, 0, 0); + getFont(PrimaryGLContext::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5) + xOfs, -1.0 + hPos - yOfs, 16, demodAlign, + GLFont::GLFONT_ALIGN_CENTER); + glColor3f(0.8, 0.8, 0.8); + getFont(PrimaryGLContext::GLFONT_SIZE16).drawString(demodStr, 2.0 * (uxPos - 0.5), -1.0 + hPos, 16, demodAlign, GLFont::GLFONT_ALIGN_CENTER); + glDisable(GL_BLEND); glEnable(GL_DEPTH_TEST); + } void PrimaryGLContext::DrawFreqSelector(float uxPos, float r, float g, float b, float w, int center_freq, int srate) { diff --git a/src/visual/WaterfallCanvas.cpp b/src/visual/WaterfallCanvas.cpp index 75e250d..89e39f1 100644 --- a/src/visual/WaterfallCanvas.cpp +++ b/src/visual/WaterfallCanvas.cpp @@ -655,7 +655,7 @@ void WaterfallCanvas::OnMouseMoved(wxMouseEvent& event) { if (shiftDown) { setStatusText("Click to create a new demodulator or hold ALT to drag range."); } else { - setStatusText("Click to move active demodulator frequency or hold ALT to drag range; hold SHIFT to create new. A / Z to Zoom. Arrow keys (+SHIFT) to move center frequency."); + setStatusText("Click to move active demodulator frequency or hold ALT to drag range; hold SHIFT to create new. Right drag or A / Z to Zoom. Arrow keys (+SHIFT) to move center frequency."); } } diff --git a/src/visual/WaterfallContext.cpp b/src/visual/WaterfallContext.cpp index 91ebb09..c8a732c 100644 --- a/src/visual/WaterfallContext.cpp +++ b/src/visual/WaterfallContext.cpp @@ -45,8 +45,6 @@ void WaterfallContext::Setup(int fft_size_in, int num_waterfall_lines_in) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); - glPixelTransferi(GL_MAP_COLOR, GL_TRUE); glPixelMapfv(GL_PIXEL_MAP_I_TO_R, 256, &(grad.getRed())[0]); glPixelMapfv(GL_PIXEL_MAP_I_TO_G, 256, &(grad.getGreen())[0]); @@ -56,6 +54,8 @@ void WaterfallContext::Setup(int fft_size_in, int num_waterfall_lines_in) { void WaterfallContext::Draw(std::vector &points) { + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_DECAL); + if (points.size()) { memmove(waterfall_tex + fft_size, waterfall_tex, (waterfall_lines - 1) * fft_size); @@ -90,5 +90,7 @@ void WaterfallContext::Draw(std::vector &points) { glVertex3f(-1.0, 1.0, 0.0); glEnd(); + glTexEnvf(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, GL_MODULATE); + }