imtk
diff src/draw.c @ 8:10604ff95527
imtk_draw_rect
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 14 Apr 2011 23:21:56 +0300 |
parents | 38609a9f7586 |
children | 9c7987064bb0 |
line diff
1.1 --- a/src/draw.c Thu Apr 14 23:04:07 2011 +0300 1.2 +++ b/src/draw.c Thu Apr 14 23:21:56 2011 +0300 1.3 @@ -27,6 +27,19 @@ 1.4 return colors[col]; 1.5 } 1.6 1.7 +void imtk_draw_rect(int x, int y, int w, int h, float *color_rgba) 1.8 +{ 1.9 + glBegin(GL_QUADS); 1.10 + if(color_rgba) { 1.11 + glColor4fv(color_rgba); 1.12 + } 1.13 + glVertex2f(x, y); 1.14 + glVertex2f(x + w, y); 1.15 + glVertex2f(x + w, y + h); 1.16 + glVertex2f(x, y + h); 1.17 + glEnd(); 1.18 +} 1.19 + 1.20 void imtk_draw_frame(int x, int y, int w, int h, int style) 1.21 { 1.22 float tcol[4], bcol[4];