| 121 | |
| 122 | |
| 123 | void 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 | |