VirtualBox

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

Last change on this file since 3460 was 3460, checked in by vboxsync, 18 years ago

Extension checks

File size: 4.7 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#include "VBoxOGL.h"
27#define WGL_WGLEXT_PROTOTYPES
28#include <VBox/HostServices/wglext.h>
29
30typedef struct
31{
32 const char *pszExtName;
33 const char *pszExtFunctionName;
34 RTUINTPTR pfnFunction;
35 bool fAvailable;
36} OPENGL_EXT, *POPENGL_EXT;
37
38static OPENGL_EXT OpenGLExtensions[] =
39{
40 { "WGL_EXT_swap_control", "wglSwapIntervalEXT", (RTUINTPTR)wglSwapIntervalEXT, false },
41 { "WGL_EXT_swap_control", "wglGetSwapIntervalEXT", (RTUINTPTR)wglGetSwapIntervalEXT, false },
42};
43
44
45int vboxInitOpenGLExtensions()
46{
47 const GLubyte *pszExtensions = glGetString(GL_EXTENSIONS);
48
49 for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++)
50 {
51 if (strstr((char *)pszExtensions, OpenGLExtensions[i].pszExtFunctionName))
52 OpenGLExtensions[i].fAvailable = VBoxIsExtensionAvailable(OpenGLExtensions[i].pszExtFunctionName);
53 }
54 return VINF_SUCCESS;
55}
56
57
58PROC APIENTRY DrvGetProcAddress(LPCSTR lpszProc)
59{
60 PROC pfnProc;
61
62 for (int i=0;i<RT_ELEMENTS(OpenGLExtensions);i++)
63 {
64 if ( OpenGLExtensions[i].fAvailable
65 && !strcmp(OpenGLExtensions[i].pszExtFunctionName, lpszProc))
66 {
67 pfnProc = (PROC)OpenGLExtensions[i].pfnFunction;
68 }
69 }
70 if (pfnProc == NULL)
71 DbgPrintf(("DrvGetProcAddress %s FAILED\n", lpszProc));
72 else
73 DbgPrintf(("DrvGetProcAddress %s\n", lpszProc));
74
75 return pfnProc;
76}
77
78BOOL WINAPI wglSwapIntervalEXT(int interval)
79{
80 VBOX_OGL_GEN_SYNC_OP1_RET(BOOL, wglSwapIntervalEXT, interval);
81 return retval;
82}
83
84int WINAPI wglGetSwapIntervalEXT(void)
85{
86 VBOX_OGL_GEN_SYNC_OP_RET(int, wglGetSwapIntervalEXT);
87 return retval;
88}
89
90
91
92
93
94#if 0
95 GL_ARB_multitexture
96 GL_EXT_texture_env_add
97 GL_EXT_compiled_vertex_array
98 GL_S3_s3tc
99 GL_ARB_occlusion_query
100 GL_ARB_point_parameters
101 GL_ARB_texture_border_clamp
102 GL_ARB_texture_compression
103 GL_ARB_texture_cube_map
104 GL_ARB_texture_env_add
105 GL_ARB_texture_env_combine
106 GL_ARB_texture_env_crossbar
107 GL_ARB_texture_env_dot3
108 GL_ARB_texture_mirrored_repeat
109 GL_ARB_transpose_matrix
110 GL_ARB_vertex_blend
111 GL_ARB_vertex_buffer_object
112 GL_ARB_vertex_program
113 GL_ARB_window_pos
114 GL_ATI_element_array
115 GL_ATI_envmap_bumpmap
116 GL_ATI_fragment_shader
117 GL_ATI_map_object_buffer
118 GL_ATI_texture_env_combine3
119 GL_ATI_texture_mirror_once
120 GL_ATI_vertex_array_object
121 GL_ATI_vertex_attrib_array_object
122 GL_ATI_vertex_streams
123 GL_ATIX_texture_env_combine3
124 GL_ATIX_texture_env_route
125 GL_ATIX_vertex_shader_output_point_size
126 GL_EXT_abgr
127 GL_EXT_bgra
128 GL_EXT_blend_color
129 GL_EXT_blend_func_separate
130 GL_EXT_blend_minmax
131 GL_EXT_blend_subtract
132 GL_EXT_clip_volume_hint
133 GL_EXT_draw_range_elements
134 GL_EXT_fog_coord
135 GL_EXT_multi_draw_arrays
136 GL_EXT_packed_pixels
137 GL_EXT_point_parameters
138 GL_EXT_polygon_offset
139 GL_EXT_rescale_normal
140 GL_EXT_secondary_color
141 GL_EXT_separate_specular_color
142 GL_EXT_stencil_wrap
143 GL_EXT_texgen_reflection
144 GL_EXT_texture3D
145 GL_EXT_texture_compression_s3tc
146 GL_EXT_texture_cube_map
147 GL_EXT_texture_edge_clamp
148 GL_EXT_texture_env_combine
149 GL_EXT_texture_env_dot3
150 GL_EXT_texture_filter_anisotropic
151 GL_EXT_texture_lod_bias
152 GL_EXT_texture_mirror_clamp
153 GL_EXT_texture_object
154 GL_EXT_texture_rectangle
155 GL_EXT_vertex_array
156 GL_EXT_vertex_shader
157 GL_HP_occlusion_test
158 GL_KTX_buffer_region
159 GL_NV_blend_square
160 GL_NV_occlusion_query
161 GL_NV_texgen_reflection
162 GL_SGI_color_matrix
163 GL_SGIS_generate_mipmap
164 GL_SGIS_multitexture
165 GL_SGIS_texture_border_clamp
166 GL_SGIS_texture_edge_clamp
167 GL_SGIS_texture_lod
168 GL_SUN_multi_draw_arrays
169 GL_WIN_swap_hint
170 WGL_EXT_extensions_string
171#endif
172
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