-
Notifications
You must be signed in to change notification settings - Fork 8
/
glEnableClientState.c
47 lines (39 loc) · 967 Bytes
/
glEnableClientState.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#include "pspgl_internal.h"
static void enable_clientstate (GLenum array, GLboolean enable)
{
struct varray *va = &pspgl_curctx->vertex_array;
switch (array) {
case GL_VERTEX_ARRAY:
va->vertex.enabled = enable;
break;
case GL_COLOR_ARRAY:
va->color.enabled = enable;
break;
case GL_NORMAL_ARRAY:
va->normal.enabled = enable;
break;
case GL_TEXTURE_COORD_ARRAY:
va->texcoord.enabled = enable;
break;
case GL_WEIGHT_ARRAY_PSP:
va->weight.enabled = enable;
break;
default:
GLERROR(GL_INVALID_ENUM);
return;
}
if (va->locked.cached_array &&
va->locked.vfmt.arrays != __pspgl_enabled_array_bits()) {
psp_log("array state changed %x->%x; invalidating cached arrays\n",
va->locked.vfmt.arrays, __pspgl_enabled_array_bits());
__pspgl_uncache_arrays();
}
}
void glEnableClientState (GLenum array)
{
enable_clientstate(array, GL_TRUE);
}
void glDisableClientState (GLenum array)
{
enable_clientstate(array, GL_FALSE);
}