- const GradientRequest* gradientrequest
- = (GradientRequest*) request.request_data;
- const Color& top = gradientrequest->top;
- const Color& bottom = gradientrequest->bottom;
-
- glDisable(GL_TEXTURE_2D);
- glDisable(GL_TEXTURE_COORD_ARRAY);
- glEnable(GL_COLOR_ARRAY);
-
- float vertices[] = {
- 0, 0,
- float(SCREEN_WIDTH), 0,
- float(SCREEN_WIDTH), float(SCREEN_HEIGHT),
- 0, float(SCREEN_HEIGHT)
- };
- glVertexPointer(2, GL_FLOAT, 0, vertices);
-
- float colors[] = {
- top.red, top.green, top.blue, top.alpha,
- top.red, top.green, top.blue, top.alpha,
- bottom.red, bottom.green, bottom.blue, bottom.alpha,
- bottom.red, bottom.green, bottom.blue, bottom.alpha,
- };
- glColorPointer(4, GL_FLOAT, 0, colors);
-
- glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
-
- glDisable(GL_COLOR_ARRAY);
- glEnable(GL_TEXTURE_COORD_ARRAY);
-
- glEnable(GL_TEXTURE_2D);
- glColor4f(1, 1, 1, 1);