VirtualBox

source: vbox/trunk/src/VBox/Additions/WINNT/Graphics/OpenGL/glext.cpp@ 3514

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

Forgot space seperator

File size: 5.5 KB
Line 
1/** @file
2 *
3 * VirtualBox Windows NT/2000/XP guest OpenGL ICD
4 *
5 * OpenGL extensions
6 *
7 * References: http://oss.sgi.com/projects/ogl-sample/registry/
8 * http://icps.u-strasbg.fr/~marchesin/perso/extensions/
9 *
10 * Copyright (C) 2006-2007 innotek GmbH
11 *
12 * This file is part of VirtualBox Open Source Edition (OSE), as
13 * available from http://www.virtualbox.org. This file is free software;
14 * you can redistribute it and/or modify it under the terms of the GNU
15 * General Public License as published by the Free Software Foundation,
16 * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
17 * distribution. VirtualBox OSE is distributed in the hope that it will
18 * be useful, but WITHOUT ANY WARRANTY of any kind.
19 *
20 * If you received this file as part of a commercial VirtualBox
21 * distribution, then only the terms of your commercial VirtualBox
22 * license agreement apply instead of the previous paragraph.
23 *
24 */
25
26#define VBOX_OGL_WITH_EXTENSION_ARRAY
27#include "VBoxOGL.h"
28
29
30/**
31 * Initialize OpenGL extensions
32 *
33 * @returns VBox status code
34 * @param pCtx OpenGL thread context
35 */
36int vboxInitOpenGLExtensions(PVBOX_OGL_THREAD_CTX pCtx)
37{
38 char *pszExtensions;
39 static bool fInitialized = false;
40 VBoxOGLglGetString parms;
41 int rc;
42
43 memset(&parms, 0, sizeof(parms));
44 VBOX_INIT_CALL(&parms.hdr, GLGETSTRING, pCtx);
45
46 parms.name.type = VMMDevHGCMParmType_32bit;
47 parms.name.u.value32 = GL_EXTENSIONS;
48 parms.pString.type = VMMDevHGCMParmType_LinAddr;
49 parms.pString.u.Pointer.size = sizeof(szOpenGLExtensions);
50 parms.pString.u.Pointer.u.linearAddr = (vmmDevHypPtr)szOpenGLExtensions;
51
52 rc = vboxHGCMCall(&parms, sizeof (parms));
53
54 if ( VBOX_FAILURE(rc)
55 || VBOX_FAILURE(parms.hdr.result))
56 {
57 DbgPrintf(("GL_EXTENSIONS failed with %x %x\n", rc, parms.hdr.result));
58 return FALSE;
59 }
60 DbgPrintf(("GL_EXTENSIONS=%s\n\n", szOpenGLExtensions));
61
62 if (fInitialized)
63 return VINF_SUCCESS;
64
65 pszExtensions = strdup(szOpenGLExtensions);
66 szOpenGLExtensions[0] = 0;
67
68 for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++)
69 {
70 if (strstr((char *)pszExtensions, OpenGLExtensions[i].pszExtName))
71 OpenGLExtensions[i].fAvailable = VBoxIsExtensionAvailable(OpenGLExtensions[i].pszExtFunctionName);
72
73 if (OpenGLExtensions[i].fAvailable)
74 {
75 strcat(szOpenGLExtensions, OpenGLExtensions[i].pszExtName);
76 strcat(szOpenGLExtensions, " ");
77 }
78 }
79
80 free(pszExtensions);
81
82 fInitialized = true;
83 return VINF_SUCCESS;
84}
85
86
87PROC APIENTRY DrvGetProcAddress(LPCSTR lpszProc)
88{
89 PROC pfnProc = NULL;
90
91 for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++)
92 {
93 if ( OpenGLExtensions[i].fAvailable
94 && !strcmp(OpenGLExtensions[i].pszExtFunctionName, lpszProc))
95 {
96 pfnProc = (PROC)OpenGLExtensions[i].pfnFunction;
97 }
98 }
99 if (pfnProc == NULL)
100 DbgPrintf(("DrvGetProcAddress %s FAILED\n", lpszProc));
101 else
102 DbgPrintf(("DrvGetProcAddress %s\n", lpszProc));
103
104 return pfnProc;
105}
106
107BOOL WINAPI wglSwapIntervalEXT(int interval)
108{
109 VBOX_OGL_GEN_SYNC_OP1_RET(BOOL, wglSwapIntervalEXT, interval);
110 return retval;
111}
112
113int WINAPI wglGetSwapIntervalEXT(void)
114{
115 VBOX_OGL_GEN_SYNC_OP_RET(int, wglGetSwapIntervalEXT);
116 return retval;
117}
118
119
120
121
122
123#if 0
124 GL_ARB_multitexture
125 GL_EXT_texture_env_add
126 GL_EXT_compiled_vertex_array
127 GL_S3_s3tc
128 GL_ARB_occlusion_query
129 GL_ARB_point_parameters
130 GL_ARB_texture_border_clamp
131 GL_ARB_texture_compression
132 GL_ARB_texture_cube_map
133 GL_ARB_texture_env_add
134 GL_ARB_texture_env_combine
135 GL_ARB_texture_env_crossbar
136 GL_ARB_texture_env_dot3
137 GL_ARB_texture_mirrored_repeat
138 GL_ARB_transpose_matrix
139 GL_ARB_vertex_blend
140 GL_ARB_vertex_buffer_object
141 GL_ARB_vertex_program
142 GL_ARB_window_pos
143 GL_ATI_element_array
144 GL_ATI_envmap_bumpmap
145 GL_ATI_fragment_shader
146 GL_ATI_map_object_buffer
147 GL_ATI_texture_env_combine3
148 GL_ATI_texture_mirror_once
149 GL_ATI_vertex_array_object
150 GL_ATI_vertex_attrib_array_object
151 GL_ATI_vertex_streams
152 GL_ATIX_texture_env_combine3
153 GL_ATIX_texture_env_route
154 GL_ATIX_vertex_shader_output_point_size
155 GL_EXT_abgr
156 GL_EXT_bgra
157 GL_EXT_blend_color
158 GL_EXT_blend_func_separate
159 GL_EXT_blend_minmax
160 GL_EXT_blend_subtract
161 GL_EXT_clip_volume_hint
162 GL_EXT_draw_range_elements
163 GL_EXT_fog_coord
164 GL_EXT_multi_draw_arrays
165 GL_EXT_packed_pixels
166 GL_EXT_point_parameters
167 GL_EXT_polygon_offset
168 GL_EXT_rescale_normal
169 GL_EXT_secondary_color
170 GL_EXT_separate_specular_color
171 GL_EXT_stencil_wrap
172 GL_EXT_texgen_reflection
173 GL_EXT_texture3D
174 GL_EXT_texture_compression_s3tc
175 GL_EXT_texture_cube_map
176 GL_EXT_texture_edge_clamp
177 GL_EXT_texture_env_combine
178 GL_EXT_texture_env_dot3
179 GL_EXT_texture_filter_anisotropic
180 GL_EXT_texture_lod_bias
181 GL_EXT_texture_mirror_clamp
182 GL_EXT_texture_object
183 GL_EXT_texture_rectangle
184 GL_EXT_vertex_array
185 GL_EXT_vertex_shader
186 GL_HP_occlusion_test
187 GL_KTX_buffer_region
188 GL_NV_blend_square
189 GL_NV_occlusion_query
190 GL_NV_texgen_reflection
191 GL_SGI_color_matrix
192 GL_SGIS_generate_mipmap
193 GL_SGIS_multitexture
194 GL_SGIS_texture_border_clamp
195 GL_SGIS_texture_edge_clamp
196 GL_SGIS_texture_lod
197 GL_SUN_multi_draw_arrays
198 GL_WIN_swap_hint
199 WGL_EXT_extensions_string
200#endif
201
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