source: trunk/sys/TinyGL/src/clear.c @ 1

Last change on this file since 1 was 1, checked in by alain, 5 years ago

First import

File size: 587 bytes
Line 
1#include "zgl.h"
2
3
4void glopClearColor(GLContext *c,GLParam *p)
5{
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;
10}
11void glopClearDepth(GLContext *c,GLParam *p)
12{
13  c->clear_depth=p[1].f;
14}
15
16
17void glopClear(GLContext *c,GLParam *p)
18{
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);
24
25  /* TODO : correct value of Z */
26
27  ZB_clear(c->zb,mask & GL_DEPTH_BUFFER_BIT,z,
28           mask & GL_COLOR_BUFFER_BIT,r,g,b);
29}
30
Note: See TracBrowser for help on using the repository browser.