VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/OGLComplexSync.cpp@ 8387

Last change on this file since 8387 was 8387, checked in by vboxsync, 17 years ago

eol

  • Property svn:eol-style set to native
File size: 8.2 KB
Line 
1/** @file
2 *
3 * VirtualBox Windows NT/2000/XP guest OpenGL ICD
4 *
5 * Complex buffered OpenGL functions
6 *
7 * Copyright (C) 2006-2007 Sun Microsystems, Inc.
8 *
9 * This file is part of VirtualBox Open Source Edition (OSE), as
10 * available from http://www.virtualbox.org. This file is free software;
11 * you can redistribute it and/or modify it under the terms of the GNU
12 * General Public License (GPL) as published by the Free Software
13 * Foundation, in version 2 as it comes in the "COPYING" file of the
14 * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15 * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16 *
17 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
18 * Clara, CA 95054 USA or visit http://www.sun.com if you need
19 * additional information or have any questions.
20 */
21
22#include "VBoxOGL.h"
23
24
25void APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels)
26{
27 GLint cbDataType = glVBoxGetDataTypeSize(type);
28
29 if (!cbDataType)
30 {
31 glLogError(GL_INVALID_ENUM);
32 return;
33 }
34
35 GLint cbPixel = cbDataType * glInternalGetPixelFormatElements(format);
36
37 VBOX_OGL_GEN_SYNC_OP7_PASS_PTR(ReadPixels, x, y, width, height, format, type, cbPixel*width*height, pixels);
38 return;
39}
40
41
42/** @todo */
43void APIENTRY glFeedbackBuffer(GLsizei size, GLenum type, GLfloat *buffer)
44{
45 AssertFailed();
46}
47
48/** @todo */
49void APIENTRY glSelectBuffer(GLsizei size, GLuint *buffer)
50{
51 AssertFailed();
52}
53
54/** @todo */
55/* Note: when in GL_FEEDBACK or GL_SELECT mode -> fill those buffers
56 * when switching to GL_FEEDBACK or GL_SELECT mode -> pass pointers
57 */
58GLint APIENTRY glRenderMode (GLenum mode)
59{
60 AssertFailed();
61 VBOX_OGL_GEN_SYNC_OP1_RET(GLint, RenderMode, mode);
62 return retval;
63}
64
65
66void APIENTRY glGenTextures (GLsizei n, GLuint *textures)
67{
68 VBOX_OGL_GEN_SYNC_OP2_PASS_PTR(GenTextures, n, n*sizeof(GLuint), textures);
69 return;
70}
71
72GLboolean APIENTRY glAreTexturesResident (GLsizei n, const GLuint *textures, GLboolean *residences)
73{
74 AssertFailed();
75 return 1;
76}
77
78void APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const GLvoid *indices)
79{
80 if (!count)
81 return; /* no error?? */
82
83 AssertFailed();
84 return;
85}
86
87void APIENTRY glBitmap (GLsizei width, GLsizei height, GLfloat xorig, GLfloat yorig, GLfloat xmove, GLfloat ymove, const GLubyte *bitmap)
88{
89 AssertFailed();
90 return;
91}
92
93void APIENTRY glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels)
94{
95 AssertFailed();
96 return;
97}
98
99void APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params)
100{
101 uint32_t n = glInternalTexParametervElem(pname);
102
103 if (!n)
104 {
105 AssertFailed();
106 glLogError(GL_INVALID_ENUM);
107 return;
108 }
109 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetTexParameterfv, target, pname, n*sizeof(*params), params);
110 return;
111}
112
113void APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params)
114{
115 uint32_t n = glInternalTexParametervElem(pname);
116
117 if (!n)
118 {
119 AssertFailed();
120 glLogError(GL_INVALID_ENUM);
121 return;
122 }
123 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetTexParameteriv, target, pname, n*sizeof(*params), params);
124 return;
125}
126
127void APIENTRY glGetTexGenfv (GLenum coord, GLenum pname, GLfloat *params)
128{
129 uint32_t n = glInternalTexGenvElem(pname);
130
131 if (!n)
132 {
133 AssertFailed();
134 glLogError(GL_INVALID_ENUM);
135 return;
136 }
137 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetTexGenfv, coord, pname, n*sizeof(*params), params);
138 return;
139}
140
141void APIENTRY glGetTexGeniv (GLenum coord, GLenum pname, GLint *params)
142{
143 uint32_t n = glInternalTexGenvElem(pname);
144
145 if (!n)
146 {
147 AssertFailed();
148 glLogError(GL_INVALID_ENUM);
149 return;
150 }
151 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetTexGeniv, coord, pname, n*sizeof(*params), params);
152 return;
153}
154
155void APIENTRY glGetTexGendv (GLenum coord, GLenum pname, GLdouble *params)
156{
157 uint32_t n = glInternalTexGenvElem(pname);
158
159 if (!n)
160 {
161 AssertFailed();
162 glLogError(GL_INVALID_ENUM);
163 return;
164 }
165 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetTexGendv, coord, pname, n*sizeof(*params), params);
166 return;
167}
168
169void APIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params)
170{
171 uint32_t n = glInternalTexEnvvElem(pname);
172
173 if (!n)
174 {
175 AssertFailed();
176 glLogError(GL_INVALID_ENUM);
177 return;
178 }
179 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetTexEnviv, target, pname, n*sizeof(*params), params);
180}
181
182void APIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params)
183{
184 uint32_t n = glInternalTexEnvvElem(pname);
185
186 if (!n)
187 {
188 AssertFailed();
189 glLogError(GL_INVALID_ENUM);
190 return;
191 }
192 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetTexEnvfv, target, pname, n*sizeof(*params), params);
193}
194
195void APIENTRY glGetPixelMapfv (GLenum map, GLfloat *values)
196{
197 uint32_t mapsize = glInternalGetIntegerv(map);
198 if (!mapsize)
199 {
200 AssertFailed();
201 glLogError(GL_INVALID_ENUM);
202 return;
203 }
204 VBOX_OGL_GEN_SYNC_OP2_PASS_PTR(GetPixelMapfv, map, mapsize*sizeof(*values), values);
205}
206
207void APIENTRY glGetPixelMapuiv (GLenum map, GLuint *values)
208{
209 uint32_t mapsize = glInternalGetIntegerv(map);
210 if (!mapsize)
211 {
212 AssertFailed();
213 glLogError(GL_INVALID_ENUM);
214 return;
215 }
216 VBOX_OGL_GEN_SYNC_OP2_PASS_PTR(GetPixelMapuiv, map, mapsize*sizeof(*values), values);
217}
218
219void APIENTRY glGetPixelMapusv (GLenum map, GLushort *values)
220{
221 uint32_t mapsize = glInternalGetIntegerv(map);
222 if (!mapsize)
223 {
224 AssertFailed();
225 glLogError(GL_INVALID_ENUM);
226 return;
227 }
228 VBOX_OGL_GEN_SYNC_OP2_PASS_PTR(GetPixelMapusv, map, mapsize*sizeof(*values), values);
229}
230
231void APIENTRY glGetMaterialiv (GLenum face, GLenum pname, GLint *params)
232{
233 uint32_t n = glInternalMaterialvElem(pname);
234
235 if (!n)
236 {
237 AssertFailed();
238 glLogError(GL_INVALID_ENUM);
239 return;
240 }
241 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetMaterialiv, face, pname, n*sizeof(*params), params);
242}
243
244void APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params)
245{
246 uint32_t n = glInternalMaterialvElem(pname);
247
248 if (!n)
249 {
250 AssertFailed();
251 glLogError(GL_INVALID_ENUM);
252 return;
253 }
254 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetMaterialfv, face, pname, n*sizeof(*params), params);
255}
256
257void APIENTRY glGetLightiv (GLenum light, GLenum pname, GLint *params)
258{
259 uint32_t n = glInternalLightvElem(pname);
260
261 if (!n)
262 {
263 AssertFailed();
264 glLogError(GL_INVALID_ENUM);
265 return;
266 }
267 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetLightiv, light, pname, n*sizeof(*params), params);
268}
269
270void APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params)
271{
272 uint32_t n = glInternalLightvElem(pname);
273
274 if (!n)
275 {
276 AssertFailed();
277 glLogError(GL_INVALID_ENUM);
278 return;
279 }
280 VBOX_OGL_GEN_SYNC_OP3_PASS_PTR(GetLightfv, light, pname, n*sizeof(*params), params);
281}
282
283void APIENTRY glGetClipPlane (GLenum plane, GLdouble *equation)
284{
285 VBOX_OGL_GEN_SYNC_OP2_PASS_PTR(GetClipPlane, plane, 4*sizeof(GLdouble), equation);
286 return;
287}
288
289void APIENTRY glGetPolygonStipple (GLubyte *mask)
290{
291 VBOX_OGL_GEN_SYNC_OP1_PASS_PTR(GetPolygonStipple, 32*32/8, mask);
292}
293
294void APIENTRY glGetTexImage (GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels)
295{
296 GLint cbDataType = glVBoxGetDataTypeSize(type);
297
298 if (!cbDataType)
299 {
300 glLogError(GL_INVALID_ENUM);
301 return;
302 }
303
304 /** @todo check dimensions of texture */
305 AssertFailed();
306 GLint cbPixel = cbDataType * glInternalGetPixelFormatElements(format);
307 VBOX_OGL_GEN_SYNC_OP5_PASS_PTR(GetTexImage, target, level, format, type, cbPixel, pixels);
308}
309
310void APIENTRY glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params)
311{
312 VBOX_OGL_GEN_SYNC_OP4_PASS_PTR(GetTexLevelParameterfv, target, level, pname, sizeof(*params), params);
313}
314
315void APIENTRY glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params)
316{
317 VBOX_OGL_GEN_SYNC_OP4_PASS_PTR(GetTexLevelParameteriv, target, level, pname, sizeof(*params), params);
318}
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