-
Notifications
You must be signed in to change notification settings - Fork 8
/
glGetFloatv.c
49 lines (44 loc) · 1.4 KB
/
glGetFloatv.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
48
#include "pspgl_internal.h"
#include "pspgl_matrix.h"
void glGetFloatv (GLenum pname, GLfloat *params)
{
struct pspgl_matrix_stack *s;
switch (pname) {
case GL_LINE_WIDTH:
params[0] = 1.0f;
break;
case GL_ALIASED_POINT_SIZE_RANGE:
case GL_SMOOTH_POINT_SIZE_RANGE:
case GL_SMOOTH_POINT_SIZE_GRANULARITY:
case GL_ALIASED_LINE_WIDTH_RANGE:
case GL_SMOOTH_LINE_WIDTH_RANGE:
case GL_SMOOTH_LINE_WIDTH_GRANULARITY:
params[0] = 1.0f;
params[1] = 1.0f;
break;
case GL_COLOR_CLEAR_VALUE:
params[0] = ((pspgl_curctx->clear.color >> 0) & 0xff) / 255.f;
params[1] = ((pspgl_curctx->clear.color >> 8) & 0xff) / 255.f;
params[2] = ((pspgl_curctx->clear.color >>16) & 0xff) / 255.f;
params[3] = ((pspgl_curctx->clear.color >>24) & 0xff) / 255.f;
break;
case GL_MODELVIEW_MATRIX: s = &pspgl_curctx->modelview_stack; goto get_matrix;
case GL_TEXTURE_MATRIX: s = &pspgl_curctx->texture_stack; goto get_matrix;
case GL_PROJECTION_MATRIX: s = &pspgl_curctx->projection_stack; goto get_matrix;
case GL_VIEW_PSP: s = &pspgl_curctx->view_stack; goto get_matrix;
case GL_BONE0_PSP ... GL_BONE7_PSP:
s = &pspgl_curctx->bone_stacks[pname - GL_BONE0_PSP];
/* FALLTHROUGH */
get_matrix:
if (params) {
const GLfloat *matrix = s->stack[s->depth].mat;
int i;
__pspgl_matrix_sync(pspgl_curctx, s);
for (i=0; i<16; i++)
params[i] = matrix[i];
}
break;
default:
GLERROR(GL_INVALID_ENUM);
}
}