VirtualBox

source: vbox/trunk/src/VBox/GuestHost/OpenGL/include/state/cr_client.h@ 17108

Last change on this file since 17108 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: 3.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 CR_STATE_CLIENT_H
8#define CR_STATE_CLIENT_H
9
10#include "state/cr_statetypes.h"
11#include "state/cr_limits.h"
12#include "state/cr_bufferobject.h"
13#include "cr_bits.h"
14
15#include <iprt/cdefs.h>
16
17#ifdef __cplusplus
18extern "C" {
19#endif
20
21typedef struct {
22 CRbitvalue dirty[CR_MAX_BITARRAY];
23 /* pixel pack/unpack */
24 CRbitvalue pack[CR_MAX_BITARRAY];
25 CRbitvalue unpack[CR_MAX_BITARRAY];
26 /* vertex array */
27 CRbitvalue enableClientState[CR_MAX_BITARRAY];
28 CRbitvalue clientPointer[CR_MAX_BITARRAY];
29 CRbitvalue *v; /* vertex */
30 CRbitvalue *n; /* normal */
31 CRbitvalue *c; /* color */
32 CRbitvalue *i; /* index */
33 CRbitvalue *t[CR_MAX_TEXTURE_UNITS]; /* texcoord */
34 CRbitvalue *e; /* edgeflag */
35 CRbitvalue *s; /* secondary color */
36 CRbitvalue *f; /* fog coord */
37#ifdef CR_NV_vertex_program
38 CRbitvalue *a[CR_MAX_VERTEX_ATTRIBS]; /* NV_vertex_program */
39#endif
40} CRClientBits;
41
42/*
43 * NOTE!!!! If you change this structure, search through the code for
44 * occurances of 'defaultPacking' and fix the static initializations!!!!
45 */
46typedef struct {
47 GLint rowLength;
48 GLint skipRows;
49 GLint skipPixels;
50 GLint alignment;
51 GLint imageHeight;
52 GLint skipImages;
53 GLboolean swapBytes;
54 GLboolean psLSBFirst; /* don't conflict with crap from Xlib.h */
55} CRPixelPackState;
56
57typedef struct {
58 unsigned char *p;
59 GLint size;
60 GLint type;
61 GLint stride;
62 GLboolean enabled;
63 GLboolean normalized; /* Added with GL_ARB_vertex_program */
64 int bytesPerIndex;
65#ifdef CR_ARB_vertex_buffer_object
66 CRBufferObject *buffer;
67#endif
68} CRClientPointer;
69
70typedef struct {
71 CRClientPointer v; /* vertex */
72 CRClientPointer n; /* normal */
73 CRClientPointer c; /* color */
74 CRClientPointer i; /* color index */
75 CRClientPointer t[CR_MAX_TEXTURE_UNITS]; /* texcoords */
76 CRClientPointer e; /* edge flags */
77 CRClientPointer s; /* secondary color */
78 CRClientPointer f; /* fog coord */
79#ifdef CR_NV_vertex_program
80 CRClientPointer a[CR_MAX_VERTEX_ATTRIBS]; /* vertex attribs */
81#endif
82#ifdef CR_NV_vertex_array_range
83 GLboolean arrayRange;
84 GLboolean arrayRangeValid;
85 void *arrayRangePointer;
86 GLuint arrayRangeLength;
87#endif
88} CRVertexArrays;
89
90typedef struct {
91 /* pixel pack/unpack */
92 CRPixelPackState pack;
93 CRPixelPackState unpack;
94
95 CRVertexArrays array;
96
97 GLint curClientTextureUnit;
98
99 /* state stacks (glPush/PopClientState) */
100 GLint attribStackDepth;
101 CRbitvalue pushMaskStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
102
103 GLint pixelStoreStackDepth;
104 CRPixelPackState pixelPackStoreStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
105 CRPixelPackState pixelUnpackStoreStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
106
107 GLint vertexArrayStackDepth;
108 CRVertexArrays vertexArrayStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
109} CRClientState;
110
111extern const CRPixelPackState crStateNativePixelPacking;
112
113DECLEXPORT(void) crStateClientInitBits(CRClientBits *c);
114DECLEXPORT(void) crStateClientInit(CRClientState *c);
115DECLEXPORT(void) crStateClientDestroy(CRClientState *c);
116
117DECLEXPORT(GLboolean) crStateUseServerArrays(void);
118DECLEXPORT(GLboolean) crStateUseServerArrayElements(void);
119
120#ifdef __cplusplus
121}
122#endif
123
124#endif /* CR_CLIENT_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