94
ScaleAddonWindow::drawTitle ()
94
ScaleAddonWindow::drawTitle (const GLMatrix &transform)
96
96
float x, y, width, height;
97
97
ScalePosition pos = sWindow->getCurrentPosition ();
103
103
x = pos.x () + window->x () + geom.width () * pos.scale / 2 - width / 2;
104
104
y = pos.y () + window->y () + geom.height () * pos.scale / 2 - height / 2;
106
text.draw (floor (x), floor (y), 1.0f);
106
text.draw (transform, floor (x), floor (y), 1.0f);
110
ScaleAddonWindow::drawHighlight ()
110
ScaleAddonWindow::drawHighlight (const GLMatrix &transform)
113
GLint oldBlendSrc, oldBlendDst;
112
GLint oldBlendSrc, oldBlendDst, oldBlendSrcAlpha, oldBlendDstAlpha;
113
GLushort colorData[4];
114
GLfloat vertexData[12];
115
GLVertexBuffer *streamingBuffer = GLVertexBuffer::streamingBuffer ();
114
116
float x, y, width, height;
115
117
ScalePosition pos = sWindow->getCurrentPosition ();
116
118
CompRect geom = window->borderRect ();
130
132
x = floor (x + 0.5f);
131
133
y = floor (y + 0.5f);
133
wasBlend = glIsEnabled (GL_BLEND);
136
glGetIntegerv (GL_BLEND_SRC_RGB, &oldBlendSrc);
137
glGetIntegerv (GL_BLEND_DST_RGB, &oldBlendDst);
138
glGetIntegerv (GL_BLEND_SRC_ALPHA, &oldBlendSrcAlpha);
139
glGetIntegerv (GL_BLEND_DST_ALPHA, &oldBlendDstAlpha);
134
141
glGetIntegerv (GL_BLEND_SRC, &oldBlendSrc);
135
142
glGetIntegerv (GL_BLEND_DST, &oldBlendDst);
140
145
glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
142
glColor4us (as->optionGetHighlightColorRed (),
143
as->optionGetHighlightColorGreen (),
144
as->optionGetHighlightColorBlue (),
145
as->optionGetHighlightColorAlpha ());
147
glRectf (x, y + height, x + width, y);
149
glColor4usv (defaultColor);
152
glDisable (GL_BLEND);
147
streamingBuffer->begin (GL_TRIANGLE_STRIP);
149
colorData[0] = as->optionGetHighlightColorRed ();
150
colorData[1] = as->optionGetHighlightColorGreen ();
151
colorData[2] = as->optionGetHighlightColorBlue ();
152
colorData[3] = as->optionGetHighlightColorAlpha ();
154
streamingBuffer->addColors (1, colorData);
158
vertexData[2] = 0.0f;
160
vertexData[4] = y + height;
161
vertexData[5] = 0.0f;
162
vertexData[6] = x + width;
164
vertexData[8] = 0.0f;
165
vertexData[9] = x + width;
166
vertexData[10] = y + height;
167
vertexData[11] = 0.0f;
169
streamingBuffer->addVertices (4, vertexData);
171
streamingBuffer->end ();
172
streamingBuffer->render (transform);
175
glBlendFuncSeparate (oldBlendSrc, oldBlendDst,
176
oldBlendSrcAlpha, oldBlendDstAlpha);
153
178
glBlendFunc (oldBlendSrc, oldBlendDst);