TinyGL 0.4.1 for MinGW
TinyGL.MinGW-master
src
clear.c
Go to the documentation of this file.
1
#include "
zgl.h
"
2
3
4
void
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
}
11
void
glopClearDepth
(
GLContext
*c,
GLParam
*p)
12
{
13
c->
clear_depth
=p[1].
f
;
14
}
15
16
17
void
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
glopClearColor
void glopClearColor(GLContext *c, GLParam *p)
Definition:
clear.c:4
glopClearDepth
void glopClearDepth(GLContext *c, GLParam *p)
Definition:
clear.c:11
glopClear
void glopClear(GLContext *c, GLParam *p)
Definition:
clear.c:17
GL_COLOR_BUFFER_BIT
@ GL_COLOR_BUFFER_BIT
Definition:
gl.h:651
GL_DEPTH_BUFFER_BIT
@ GL_DEPTH_BUFFER_BIT
Definition:
gl.h:645
GLContext
Definition:
zgl.h:159
GLContext::clear_color
V4 clear_color
Definition:
zgl.h:230
GLContext::clear_depth
float clear_depth
Definition:
zgl.h:229
GLContext::zb
ZBuffer * zb
Definition:
zgl.h:161
V4::v
float v[4]
Definition:
zmath.h:29
GLParam
Definition:
zgl.h:97
GLParam::i
int i
Definition:
zgl.h:100
GLParam::f
float f
Definition:
zgl.h:99
ZB_clear
void ZB_clear(ZBuffer *zb, int clear_z, int z, int clear_color, int r, int g, int b)
Definition:
zbuffer.c:489
zgl.h
Generated by
1.9.2