VirtualBox

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

Last change on this file since 78116 was 78116, checked in by vboxsync, 6 years ago

GuestHost/OpenGL,HostServices/SharedOpenGL: Updates bugref:9407

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id Revision
File size: 4.2 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 * occurrences 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# ifndef IN_GUEST
65 GLboolean fRealPtr; /**< @bugref{9407} */
66# endif
67 int bytesPerIndex;
68#ifdef CR_ARB_vertex_buffer_object
69 CRBufferObject *buffer;
70#endif
71#ifdef CR_EXT_compiled_vertex_array
72 GLboolean locked;
73# ifndef IN_GUEST
74 GLboolean fPrevRealPtr; /**< @bugref{9407} */
75# endif
76 unsigned char *prevPtr;
77 GLint prevStride;
78#endif
79} CRClientPointer;
80
81typedef struct {
82 CRClientPointer v; /* vertex */
83 CRClientPointer n; /* normal */
84 CRClientPointer c; /* color */
85 CRClientPointer i; /* color index */
86 CRClientPointer t[CR_MAX_TEXTURE_UNITS]; /* texcoords */
87 CRClientPointer e; /* edge flags */
88 CRClientPointer s; /* secondary color */
89 CRClientPointer f; /* fog coord */
90#ifdef CR_NV_vertex_program
91 CRClientPointer a[CR_MAX_VERTEX_ATTRIBS]; /* vertex attribs */
92#endif
93#ifdef CR_NV_vertex_array_range
94 GLboolean arrayRange;
95 GLboolean arrayRangeValid;
96 void *arrayRangePointer;
97 GLuint arrayRangeLength;
98#endif
99#ifdef CR_EXT_compiled_vertex_array
100 GLint lockFirst;
101 GLint lockCount;
102 GLboolean locked;
103# ifdef IN_GUEST
104 GLboolean synced;
105# endif
106#endif
107} CRVertexArrays;
108
109#define CRSTATECLIENT_MAX_VERTEXARRAYS (7+CR_MAX_TEXTURE_UNITS+CR_MAX_VERTEX_ATTRIBS)
110
111typedef struct {
112 /* pixel pack/unpack */
113 CRPixelPackState pack;
114 CRPixelPackState unpack;
115
116 CRVertexArrays array;
117
118 GLint curClientTextureUnit;
119
120 /* state stacks (glPush/PopClientState) */
121 GLint attribStackDepth;
122 CRbitvalue pushMaskStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
123
124 GLint pixelStoreStackDepth;
125 CRPixelPackState pixelPackStoreStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
126 CRPixelPackState pixelUnpackStoreStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
127
128 GLint vertexArrayStackDepth;
129 CRVertexArrays vertexArrayStack[CR_MAX_CLIENT_ATTRIB_STACK_DEPTH];
130} CRClientState;
131
132extern const CRPixelPackState crStateNativePixelPacking;
133
134struct CRContext;
135
136DECLEXPORT(void) crStateClientInitBits(CRClientBits *c);
137DECLEXPORT(void) crStateClientDestroyBits(CRClientBits *c);
138DECLEXPORT(void) crStateClientInit(struct CRContext *g);
139DECLEXPORT(void) crStateClientDestroy(struct CRContext *g);
140
141DECLEXPORT(GLboolean) crStateUseServerArrays(void);
142DECLEXPORT(GLboolean) crStateUseServerArrayElements(void);
143DECLEXPORT(CRClientPointer*) crStateGetClientPointerByIndex(int index, CRVertexArrays *array);
144
145#ifdef __cplusplus
146}
147#endif
148
149#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