mirror of
https://github.com/cjcliffe/CubicSDR.git
synced 2026-07-23 10:34:10 -04:00
Can now choose demodulator output devices
This commit is contained in:
+26
-16
@@ -4,20 +4,20 @@
|
||||
|
||||
ScopeContext::ScopeContext(ScopeCanvas *canvas, wxGLContext *sharedContext) :
|
||||
PrimaryGLContext(canvas, sharedContext) {
|
||||
glDisable (GL_CULL_FACE);
|
||||
glDisable (GL_DEPTH_TEST);
|
||||
glDisable(GL_CULL_FACE);
|
||||
glDisable(GL_DEPTH_TEST);
|
||||
|
||||
glMatrixMode (GL_PROJECTION);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
}
|
||||
|
||||
void ScopeContext::DrawBegin() {
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
|
||||
|
||||
glMatrixMode (GL_MODELVIEW);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
glDisable (GL_TEXTURE_2D);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
}
|
||||
|
||||
void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
|
||||
@@ -26,27 +26,27 @@ void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
|
||||
if (stereo) {
|
||||
glColor3f(0.7, 0.7, 0.7);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(-1.0,0.0);
|
||||
glVertex2f(1.0,0.0);
|
||||
glVertex2f(-1.0, 0.0);
|
||||
glVertex2f(1.0, 0.0);
|
||||
glEnd();
|
||||
glColor3f(0.3, 0.3, 0.3);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(-1.0,0.5);
|
||||
glVertex2f(1.0,0.5);
|
||||
glVertex2f(-1.0,-0.5);
|
||||
glVertex2f(1.0,-0.5);
|
||||
glVertex2f(-1.0, 0.5);
|
||||
glVertex2f(1.0, 0.5);
|
||||
glVertex2f(-1.0, -0.5);
|
||||
glVertex2f(1.0, -0.5);
|
||||
glEnd();
|
||||
} else {
|
||||
glColor3f(0.3, 0.3, 0.3);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(-1.0,0.0);
|
||||
glVertex2f(1.0,0.0);
|
||||
glVertex2f(-1.0, 0.0);
|
||||
glVertex2f(1.0, 0.0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
glColor3f(0.9, 0.9, 0.9);
|
||||
if (points.size()) {
|
||||
glEnableClientState (GL_VERTEX_ARRAY);
|
||||
glEnableClientState(GL_VERTEX_ARRAY);
|
||||
glVertexPointer(2, GL_FLOAT, 0, &points[0]);
|
||||
if (stereo) {
|
||||
glPushMatrix();
|
||||
@@ -74,6 +74,16 @@ void ScopeContext::Plot(std::vector<float> &points, bool stereo) {
|
||||
}
|
||||
}
|
||||
|
||||
void ScopeContext::DrawDeviceName(std::string deviceName) {
|
||||
GLint vp[4];
|
||||
glGetIntegerv( GL_VIEWPORT, vp);
|
||||
float viewHeight = (float) vp[3];
|
||||
float hPos = (float) (viewHeight - 20) / viewHeight;
|
||||
|
||||
glColor3f(0.65,0.65,0.65);
|
||||
getFont(PrimaryGLContext::GLFONT_SIZE12).drawString(deviceName.c_str(), 1.0, hPos, 12, GLFont::GLFONT_ALIGN_RIGHT, GLFont::GLFONT_ALIGN_CENTER);
|
||||
}
|
||||
|
||||
void ScopeContext::DrawEnd() {
|
||||
glFlush();
|
||||
|
||||
@@ -83,7 +93,7 @@ void ScopeContext::DrawEnd() {
|
||||
void ScopeContext::DrawDivider() {
|
||||
glColor3f(1.0, 1.0, 1.0);
|
||||
glBegin(GL_LINES);
|
||||
glVertex2f(0.0,-1.0);
|
||||
glVertex2f(0.0,1.0);
|
||||
glVertex2f(0.0, -1.0);
|
||||
glVertex2f(0.0, 1.0);
|
||||
glEnd();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user