diff options
author | inmarket <andrewh@inmarket.com.au> | 2014-08-20 17:44:40 +1000 |
---|---|---|
committer | inmarket <andrewh@inmarket.com.au> | 2014-08-20 17:44:40 +1000 |
commit | 2b47a0708602b45b0b5db120a496bf92232aa4b1 (patch) | |
tree | 6c5965b6bf1d109b853efe64777bbc7ee5548882 /3rdparty/tinygl-0.4-ugfx/src/clear.c | |
parent | c06bff3304ed234c3a7f96fd049755ac59228ef7 (diff) | |
parent | 0f3f8f68f87233bf59c3fa68c3dfe1f492a1a478 (diff) | |
download | uGFX-2b47a0708602b45b0b5db120a496bf92232aa4b1.tar.gz uGFX-2b47a0708602b45b0b5db120a496bf92232aa4b1.tar.bz2 uGFX-2b47a0708602b45b0b5db120a496bf92232aa4b1.zip |
Merge branch 'master' into newmouse
Diffstat (limited to '3rdparty/tinygl-0.4-ugfx/src/clear.c')
-rw-r--r-- | 3rdparty/tinygl-0.4-ugfx/src/clear.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/3rdparty/tinygl-0.4-ugfx/src/clear.c b/3rdparty/tinygl-0.4-ugfx/src/clear.c new file mode 100644 index 00000000..f5b75585 --- /dev/null +++ b/3rdparty/tinygl-0.4-ugfx/src/clear.c @@ -0,0 +1,30 @@ +#include "zgl.h" + + +void glopClearColor(GLContext *c,GLParam *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; +} +void glopClearDepth(GLContext *c,GLParam *p) +{ + c->clear_depth=p[1].f; +} + + +void glopClear(GLContext *c,GLParam *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); + + /* TODO : correct value of Z */ + + ZB_clear(c->zb,mask & GL_DEPTH_BUFFER_BIT,z, + mask & GL_COLOR_BUFFER_BIT,r,g,b); +} + |