2005-01-12 15:20:02 +00:00
|
|
|
|
2009-05-08 07:32:33 +00:00
|
|
|
#include "graphics/tinygl/zgl.h"
|
2005-01-12 15:20:02 +00:00
|
|
|
|
2006-05-16 14:52:36 +00:00
|
|
|
void glopClearColor(GLContext *c, TGLParam *p) {
|
|
|
|
c->clear_color.v[0] = p[1].f;
|
|
|
|
c->clear_color.v[1] = p[2].f;
|
|
|
|
c->clear_color.v[2] = p[3].f;
|
|
|
|
c->clear_color.v[3] = p[4].f;
|
2005-01-12 15:20:02 +00:00
|
|
|
}
|
|
|
|
|
2006-05-16 14:52:36 +00:00
|
|
|
void glopClearDepth(GLContext *c, TGLParam *p) {
|
|
|
|
c->clear_depth = p[1].f;
|
|
|
|
}
|
2005-01-12 15:20:02 +00:00
|
|
|
|
2006-05-16 14:52:36 +00:00
|
|
|
void glopClear(GLContext *c,TGLParam *p) {
|
|
|
|
int mask = p[1].i;
|
|
|
|
int z = 0;
|
|
|
|
int r = (int)(c->clear_color.v[0] * 65535);
|
|
|
|
int g = (int)(c->clear_color.v[1] * 65535);
|
|
|
|
int b = (int)(c->clear_color.v[2] * 65535);
|
2005-01-12 15:20:02 +00:00
|
|
|
|
2006-05-16 14:52:36 +00:00
|
|
|
// TODO : correct value of Z
|
2008-07-29 19:28:19 +00:00
|
|
|
ZB_clear(c->zb,mask & TGL_DEPTH_BUFFER_BIT, z, mask & TGL_COLOR_BUFFER_BIT, r, g, b);
|
2005-01-12 15:20:02 +00:00
|
|
|
}
|