VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/state/cr_transform.h@ 44125

Last change on this file since 44125 was 15532, checked in by vboxsync, 16 years ago

crOpenGL: export to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.6 KB
Line 
1/* Copyright (c) 2001, Stanford University
2 * All rights reserved.
3 *
4 * See the file LICENSE.txt for information on redistributing this software.
5 */
6
7#ifndef GLTRANS_H
8#define GLTRANS_H
9
10#include "state/cr_statetypes.h"
11
12#include <iprt/cdefs.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18#define NUM_MATRICES 4
19
20typedef struct {
21 CRbitvalue dirty[CR_MAX_BITARRAY];
22 CRbitvalue *currentMatrix; /* points to one of the following */
23 CRbitvalue matrixMode[CR_MAX_BITARRAY];
24 CRbitvalue modelviewMatrix[CR_MAX_BITARRAY];
25 CRbitvalue projectionMatrix[CR_MAX_BITARRAY];
26 CRbitvalue colorMatrix[CR_MAX_BITARRAY];
27 CRbitvalue textureMatrix[CR_MAX_BITARRAY];
28 CRbitvalue programMatrix[CR_MAX_BITARRAY];
29 CRbitvalue clipPlane[CR_MAX_BITARRAY];
30 CRbitvalue enable[CR_MAX_BITARRAY];
31 CRbitvalue base[CR_MAX_BITARRAY];
32} CRTransformBits;
33
34typedef struct {
35 CRmatrix *top; /* points into stack */
36 CRmatrix *stack; /* array [maxDepth] of CRmatrix */
37 GLuint depth; /* 0 <= depth < maxDepth */
38 GLuint maxDepth; /* size of stack[] array */
39} CRMatrixStack;
40
41typedef struct {
42 GLvectord *clipPlane;
43 GLboolean *clip;
44
45 GLenum matrixMode;
46
47 /* matrix stacks */
48 CRMatrixStack modelViewStack;
49 CRMatrixStack projectionStack;
50 CRMatrixStack colorStack;
51 CRMatrixStack textureStack[CR_MAX_TEXTURE_UNITS];
52 CRMatrixStack programStack[CR_MAX_PROGRAM_MATRICES];
53 CRMatrixStack *currentStack;
54
55 GLboolean modelViewProjectionValid;
56 CRmatrix modelViewProjection; /* product of modelview and projection */
57
58#ifdef CR_OPENGL_VERSION_1_2
59 GLboolean rescaleNormals;
60#endif
61#ifdef CR_IBM_rasterpos_clip
62 GLboolean rasterPositionUnclipped;
63#endif
64 GLboolean normalize;
65} CRTransformState;
66
67
68DECLEXPORT(void) crStateTransformInit(CRContext *ctx);
69DECLEXPORT(void) crStateTransformDestroy(CRContext *ctx);
70
71DECLEXPORT(void) crStateInitMatrixStack(CRMatrixStack *stack, int maxDepth);
72
73DECLEXPORT(void) crStateLoadMatrix(const CRmatrix *m);
74
75DECLEXPORT(void) crStateTransformUpdateTransform(CRTransformState *t);
76DECLEXPORT(void) crStateTransformXformPoint(CRTransformState *t, GLvectorf *p);
77
78DECLEXPORT(void) crStateTransformXformPointMatrixf(const CRmatrix *m, GLvectorf *p);
79DECLEXPORT(void) crStateTransformXformPointMatrixd(const CRmatrix *m, GLvectord *p);
80
81DECLEXPORT(void) crStateTransformDiff(CRTransformBits *t, CRbitvalue *bitID,
82 CRContext *fromCtx, CRContext *toCtx);
83
84DECLEXPORT(void) crStateTransformSwitch(CRTransformBits *bb, CRbitvalue *bitID,
85 CRContext *fromCtx, CRContext *toCtx);
86
87#ifdef __cplusplus
88}
89#endif
90
91#endif /* CR_STATE_TRANSFORM_H */
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette