MCPcopy Create free account
hub / github.com/cjcliffe/CubicSDR / DrawTunerDigitBox

Method DrawTunerDigitBox

src/visual/TuningContext.cpp:123–143  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121
122
123void TuningContext::DrawTunerDigitBox(int index, int count, float displayPos, float displayWidth, const RGBA4f& /* c */) {
124 GLint vp[4];
125 glGetIntegerv( GL_VIEWPORT, vp);
126
127 float viewHeight = (float) vp[3];
128 float pixelHeight = 2.0/viewHeight;
129
130 glColor4f(1.0, 0,0,1);
131 glEnable(GL_BLEND);
132 glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
133 float xpos = displayPos + (displayWidth / (float) count) * (float) (count-index);
134 float xpos2 = displayPos + (displayWidth / (float) count) * (float) ((count-1)-index);
135 glBegin(GL_LINE_STRIP);
136 glVertex2f(xpos, 1.0-pixelHeight);
137 glVertex2f(xpos, -1.0+pixelHeight);
138 glVertex2f(xpos2, -1.0+pixelHeight);
139 glVertex2f(xpos2, 1.0-pixelHeight);
140 glVertex2f(xpos, 1.0-pixelHeight);
141 glEnd();
142 glDisable(GL_BLEND);
143}
144
145
146

Callers 1

OnPaintMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected