Merge branch 'master' of ssh://repo.or.cz/srv/git/tgl
[tgl.git] / src / clear.c
blobd9814053a4edbd44f0f7b813b8ca5c4156bee33d
1 #include "zgl.h"
4 void glopClearColor(GLContext *c,GLParam *p)
6 c->clear_color.v[0]=p[1].f;
7 c->clear_color.v[1]=p[2].f;
8 c->clear_color.v[2]=p[3].f;
9 c->clear_color.v[3]=p[4].f;
11 void glopClearDepth(GLContext *c,GLParam *p)
13 c->clear_depth=p[1].f;
17 void glopClear(GLContext *c,GLParam *p)
19 int mask=p[1].i;
20 int z=0;
21 int r=(int)(c->clear_color.v[0]*65535);
22 int g=(int)(c->clear_color.v[1]*65535);
23 int b=(int)(c->clear_color.v[2]*65535);
25 /* TODO : correct value of Z */
27 ZB_clear(c->zb,mask & GL_DEPTH_BUFFER_BIT,z,
28 mask & GL_COLOR_BUFFER_BIT,r,g,b);