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-06-04 20:33:47 +02: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-06-07 00:55:08 +02:00
|
|
|
int r = (int)(c->clear_color.X * 65535);
|
|
|
|
int g = (int)(c->clear_color.Y * 65535);
|
|
|
|
int b = (int)(c->clear_color.Z * 65535);
|
2005-01-12 15:20:02 +00:00
|
|
|
|
2006-05-16 14:52:36 +00:00
|
|
|
// TODO : correct value of Z
|
2014-06-13 16:30:25 +02:00
|
|
|
c->fb->clear(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
|