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
|
|
|
|
2009-05-25 13:19:29 +00:00
|
|
|
namespace TinyGL {
|
|
|
|
|
|
|
|
void glopClearColor(GLContext *c, GLParam *p) {
|
2014-05-28 19:27:00 +01:00
|
|
|
c->clear_color = Vector4(p[1].f,p[2].f,p[3].f,p[4].f);
|
2005-01-12 15:20:02 +00:00
|
|
|
}
|
|
|
|
|
2009-05-25 13:19:29 +00:00
|
|
|
void glopClearDepth(GLContext *c, GLParam *p) {
|
2006-05-16 14:52:36 +00:00
|
|
|
c->clear_depth = p[1].f;
|
|
|
|
}
|
2005-01-12 15:20:02 +00:00
|
|
|
|
2014-02-20 18:46:49 +01:00
|
|
|
void glopClear(GLContext *c, GLParam *p) {
|
2006-05-16 14:52:36 +00:00
|
|
|
int mask = p[1].i;
|
|
|
|
int z = 0;
|
2014-05-28 19:27:00 +01:00
|
|
|
int r = (int)(c->clear_color.getX() * 65535);
|
|
|
|
int g = (int)(c->clear_color.getY() * 65535);
|
|
|
|
int b = (int)(c->clear_color.getZ() * 65535);
|
2005-01-12 15:20:02 +00:00
|
|
|
|
2006-05-16 14:52:36 +00:00
|
|
|
// TODO : correct value of Z
|
2014-02-20 18:46:49 +01: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
|
|
|
}
|
2009-05-25 13:19:29 +00:00
|
|
|
|
|
|
|
} // end of namespace TinyGL
|