move around - flatter.
[profile/ivi/evas.git] / src / modules / engines / gl_common / evas_gl_rectangle.c
1 #include "evas_gl_private.h"
2
3 void
4 evas_gl_common_rect_draw(Evas_GL_Context *gc, int x, int y, int w, int h)
5 {
6    int r, g, b, a;
7    RGBA_Draw_Context *dc = gc->dc;
8
9    a = (dc->col.col >> 24) & 0xff;
10    r = (dc->col.col >> 16) & 0xff;
11    g = (dc->col.col >> 8 ) & 0xff;
12    b = (dc->col.col      ) & 0xff;
13    evas_gl_common_context_color_set(gc, r, g, b, a);
14    if (a < 255) evas_gl_common_context_blend_set(gc, 1);
15    else evas_gl_common_context_blend_set(gc, 0);
16    if (dc->clip.use)
17      evas_gl_common_context_clip_set(gc, 1,
18                                      dc->clip.x, dc->clip.y,
19                                      dc->clip.w, dc->clip.h);
20    else
21      evas_gl_common_context_clip_set(gc, 0,
22                                      0, 0, 0, 0);
23    evas_gl_common_context_texture_set(gc, NULL, 0, 0, 0);
24    evas_gl_common_context_read_buf_set(gc, GL_BACK);
25    evas_gl_common_context_write_buf_set(gc, GL_BACK);
26    glBegin(GL_QUADS);
27    glVertex2i(x, y);
28    glVertex2i(x + w, y);
29    glVertex2i(x + w, y + h);
30    glVertex2i(x, y + h);
31    glEnd();
32 }