diff options
Diffstat (limited to 'src/others/irrlicht-1.8.1/source/Irrlicht/COpenGLExtensionHandler.h')
-rw-r--r-- | src/others/irrlicht-1.8.1/source/Irrlicht/COpenGLExtensionHandler.h | 2586 |
1 files changed, 2586 insertions, 0 deletions
diff --git a/src/others/irrlicht-1.8.1/source/Irrlicht/COpenGLExtensionHandler.h b/src/others/irrlicht-1.8.1/source/Irrlicht/COpenGLExtensionHandler.h new file mode 100644 index 0000000..1b77bad --- /dev/null +++ b/src/others/irrlicht-1.8.1/source/Irrlicht/COpenGLExtensionHandler.h | |||
@@ -0,0 +1,2586 @@ | |||
1 | // Copyright (C) 2002-2012 Nikolaus Gebhardt | ||
2 | // This file is part of the "Irrlicht Engine". | ||
3 | // For conditions of distribution and use, see copyright notice in Irrlicht.h | ||
4 | |||
5 | #ifndef __C_OPEN_GL_FEATURE_MAP_H_INCLUDED__ | ||
6 | #define __C_OPEN_GL_FEATURE_MAP_H_INCLUDED__ | ||
7 | |||
8 | #include "IrrCompileConfig.h" | ||
9 | #ifdef _IRR_COMPILE_WITH_OPENGL_ | ||
10 | |||
11 | #include "EDriverFeatures.h" | ||
12 | #include "irrTypes.h" | ||
13 | #include "os.h" | ||
14 | |||
15 | #if defined(_IRR_WINDOWS_API_) | ||
16 | // include windows headers for HWND | ||
17 | #define WIN32_LEAN_AND_MEAN | ||
18 | #include <windows.h> | ||
19 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
20 | #define GL_GLEXT_LEGACY 1 | ||
21 | #endif | ||
22 | #include <GL/gl.h> | ||
23 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
24 | #include "glext.h" | ||
25 | #endif | ||
26 | #include "wglext.h" | ||
27 | |||
28 | #ifdef _MSC_VER | ||
29 | #pragma comment(lib, "OpenGL32.lib") | ||
30 | #endif | ||
31 | |||
32 | #elif defined(_IRR_COMPILE_WITH_OSX_DEVICE_) | ||
33 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
34 | #define GL_GLEXT_LEGACY 1 | ||
35 | #endif | ||
36 | #include <OpenGL/gl.h> | ||
37 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
38 | #include "glext.h" | ||
39 | #endif | ||
40 | #elif defined(_IRR_COMPILE_WITH_SDL_DEVICE_) && !defined(_IRR_COMPILE_WITH_X11_DEVICE_) | ||
41 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
42 | #define GL_GLEXT_LEGACY 1 | ||
43 | #define GLX_GLXEXT_LEGACY 1 | ||
44 | #else | ||
45 | #define GL_GLEXT_PROTOTYPES 1 | ||
46 | #define GLX_GLXEXT_PROTOTYPES 1 | ||
47 | #endif | ||
48 | #define NO_SDL_GLEXT | ||
49 | #include <SDL/SDL_video.h> | ||
50 | #include <SDL/SDL_opengl.h> | ||
51 | #include "glext.h" | ||
52 | #else | ||
53 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
54 | #define GL_GLEXT_LEGACY 1 | ||
55 | #define GLX_GLXEXT_LEGACY 1 | ||
56 | #else | ||
57 | #define GL_GLEXT_PROTOTYPES 1 | ||
58 | #define GLX_GLXEXT_PROTOTYPES 1 | ||
59 | #endif | ||
60 | #include <GL/gl.h> | ||
61 | #include <GL/glx.h> | ||
62 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
63 | #include "glext.h" | ||
64 | #undef GLX_ARB_get_proc_address // avoid problems with local glxext.h | ||
65 | #include "glxext.h" | ||
66 | #endif | ||
67 | #endif | ||
68 | |||
69 | #ifndef GL_ARB_shader_objects | ||
70 | /* GL types for program/shader text and shader object handles */ | ||
71 | typedef char GLcharARB; | ||
72 | typedef unsigned int GLhandleARB; | ||
73 | #endif | ||
74 | |||
75 | #ifndef GL_VERSION_2_0 | ||
76 | /* GL type for program/shader text */ | ||
77 | typedef char GLchar; | ||
78 | #endif | ||
79 | |||
80 | |||
81 | namespace irr | ||
82 | { | ||
83 | namespace video | ||
84 | { | ||
85 | |||
86 | |||
87 | static const char* const OpenGLFeatureStrings[] = { | ||
88 | "GL_3DFX_multisample", | ||
89 | "GL_3DFX_tbuffer", | ||
90 | "GL_3DFX_texture_compression_FXT1", | ||
91 | "GL_AMD_blend_minmax_factor", | ||
92 | "GL_AMD_conservative_depth", | ||
93 | "GL_AMD_debug_output", | ||
94 | "GL_AMD_depth_clamp_separate", | ||
95 | "GL_AMD_draw_buffers_blend", | ||
96 | "GL_AMD_multi_draw_indirect", | ||
97 | "GL_AMD_name_gen_delete", | ||
98 | "GL_AMD_performance_monitor", | ||
99 | "GL_AMD_sample_positions", | ||
100 | "GL_AMD_seamless_cubemap_per_texture", | ||
101 | "GL_AMD_shader_stencil_export", | ||
102 | "GL_AMD_texture_texture4", | ||
103 | "GL_AMD_transform_feedback3_lines_triangles", | ||
104 | "GL_AMD_vertex_shader_tesselator", | ||
105 | "GL_APPLE_aux_depth_stencil", | ||
106 | "GL_APPLE_client_storage", | ||
107 | "GL_APPLE_element_array", | ||
108 | "GL_APPLE_fence", | ||
109 | "GL_APPLE_float_pixels", | ||
110 | "GL_APPLE_flush_buffer_range", | ||
111 | "GL_APPLE_object_purgeable", | ||
112 | "GL_APPLE_rgb_422", | ||
113 | "GL_APPLE_row_bytes", | ||
114 | "GL_APPLE_specular_vector", | ||
115 | "GL_APPLE_texture_range", | ||
116 | "GL_APPLE_transform_hint", | ||
117 | "GL_APPLE_vertex_array_object", | ||
118 | "GL_APPLE_vertex_array_range", | ||
119 | "GL_APPLE_vertex_program_evaluators", | ||
120 | "GL_APPLE_ycbcr_422", | ||
121 | "GL_ARB_base_instance", | ||
122 | "GL_ARB_blend_func_extended", | ||
123 | "GL_ARB_cl_event", | ||
124 | "GL_ARB_color_buffer_float", | ||
125 | "GL_ARB_compatibility", | ||
126 | "GL_ARB_compressed_texture_pixel_storage", | ||
127 | "GL_ARB_conservative_depth", | ||
128 | "GL_ARB_copy_buffer", | ||
129 | "GL_ARB_debug_output", | ||
130 | "GL_ARB_depth_buffer_float", | ||
131 | "GL_ARB_depth_clamp", | ||
132 | "GL_ARB_depth_texture", | ||
133 | "GL_ARB_draw_buffers", | ||
134 | "GL_ARB_draw_buffers_blend", | ||
135 | "GL_ARB_draw_elements_base_vertex", | ||
136 | "GL_ARB_draw_indirect", | ||
137 | "GL_ARB_draw_instanced", | ||
138 | "GL_ARB_ES2_compatibility", | ||
139 | "GL_ARB_explicit_attrib_location", | ||
140 | "GL_ARB_fragment_coord_conventions", | ||
141 | "GL_ARB_fragment_program", | ||
142 | "GL_ARB_fragment_program_shadow", | ||
143 | "GL_ARB_fragment_shader", | ||
144 | "GL_ARB_framebuffer_object", | ||
145 | "GL_ARB_framebuffer_sRGB", | ||
146 | "GL_ARB_get_program_binary", | ||
147 | "GL_ARB_geometry_shader4", | ||
148 | "GL_ARB_gpu_shader5", | ||
149 | "GL_ARB_gpu_shader_fp64", | ||
150 | "GL_ARB_half_float_pixel", | ||
151 | "GL_ARB_half_float_vertex", | ||
152 | "GL_ARB_imaging", | ||
153 | "GL_ARB_instanced_arrays", | ||
154 | "GL_ARB_internalformat_query", | ||
155 | "GL_ARB_map_buffer_alignment", | ||
156 | "GL_ARB_map_buffer_range", | ||
157 | "GL_ARB_matrix_palette", | ||
158 | "GL_ARB_multisample", | ||
159 | "GL_ARB_multitexture", | ||
160 | "GL_ARB_occlusion_query", | ||
161 | "GL_ARB_occlusion_query2", | ||
162 | "GL_ARB_pixel_buffer_object", | ||
163 | "GL_ARB_point_parameters", | ||
164 | "GL_ARB_point_sprite", | ||
165 | "GL_ARB_provoking_vertex", | ||
166 | "GL_ARB_robustness", | ||
167 | "GL_ARB_sample_shading", | ||
168 | "GL_ARB_sampler_objects", | ||
169 | "GL_ARB_seamless_cube_map", | ||
170 | "GL_ARB_separate_shader_objects", | ||
171 | "GL_ARB_shader_atomic_counters", | ||
172 | "GL_ARB_shader_bit_encoding", | ||
173 | "GL_ARB_shader_image_load_store", | ||
174 | "GL_ARB_shader_objects", | ||
175 | "GL_ARB_shader_precision", | ||
176 | "GL_ARB_shader_stencil_export", | ||
177 | "GL_ARB_shader_subroutine", | ||
178 | "GL_ARB_shader_texture_lod", | ||
179 | "GL_ARB_shading_language_100", | ||
180 | "GL_ARB_shading_language_420pack", | ||
181 | "GL_ARB_shading_language_include", | ||
182 | "GL_ARB_shading_language_packing", | ||
183 | "GL_ARB_shadow", | ||
184 | "GL_ARB_shadow_ambient", | ||
185 | "GL_ARB_sync", | ||
186 | "GL_ARB_tessellation_shader", | ||
187 | "GL_ARB_texture_border_clamp", | ||
188 | "GL_ARB_texture_buffer_object", | ||
189 | "GL_ARB_texture_buffer_object_rgb32", | ||
190 | "GL_ARB_texture_compression", | ||
191 | "GL_ARB_texture_compression_bptc", | ||
192 | "GL_ARB_texture_compression_rgtc", | ||
193 | "GL_ARB_texture_cube_map", | ||
194 | "GL_ARB_texture_cube_map_array", | ||
195 | "GL_ARB_texture_env_add", | ||
196 | "GL_ARB_texture_env_combine", | ||
197 | "GL_ARB_texture_env_crossbar", | ||
198 | "GL_ARB_texture_env_dot3", | ||
199 | "GL_ARB_texture_float", | ||
200 | "GL_ARB_texture_gather", | ||
201 | "GL_ARB_texture_mirrored_repeat", | ||
202 | "GL_ARB_texture_multisample", | ||
203 | "GL_ARB_texture_non_power_of_two", | ||
204 | "GL_ARB_texture_query_lod", | ||
205 | "GL_ARB_texture_rectangle", | ||
206 | "GL_ARB_texture_rg", | ||
207 | "GL_ARB_texture_rgb10_a2ui", | ||
208 | "GL_ARB_texture_storage", | ||
209 | "GL_ARB_texture_swizzle", | ||
210 | "GL_ARB_timer_query", | ||
211 | "GL_ARB_transform_feedback2", | ||
212 | "GL_ARB_transform_feedback3", | ||
213 | "GL_ARB_transform_feedback_instanced", | ||
214 | "GL_ARB_transpose_matrix", | ||
215 | "GL_ARB_uniform_buffer_object", | ||
216 | "GL_ARB_vertex_array_bgra", | ||
217 | "GL_ARB_vertex_array_object", | ||
218 | "GL_ARB_vertex_attrib_64bit", | ||
219 | "GL_ARB_vertex_blend", | ||
220 | "GL_ARB_vertex_buffer_object", | ||
221 | "GL_ARB_vertex_program", | ||
222 | "GL_ARB_vertex_shader", | ||
223 | "GL_ARB_vertex_type_2_10_10_10_rev", | ||
224 | "GL_ARB_viewport_array", | ||
225 | "GL_ARB_window_pos", | ||
226 | "GL_ATI_draw_buffers", | ||
227 | "GL_ATI_element_array", | ||
228 | "GL_ATI_envmap_bumpmap", | ||
229 | "GL_ATI_fragment_shader", | ||
230 | "GL_ATI_map_object_buffer", | ||
231 | "GL_ATI_meminfo", | ||
232 | "GL_ATI_pixel_format_float", | ||
233 | "GL_ATI_pn_triangles", | ||
234 | "GL_ATI_separate_stencil", | ||
235 | "GL_ATI_text_fragment_shader", | ||
236 | "GL_ATI_texture_env_combine3", | ||
237 | "GL_ATI_texture_float", | ||
238 | "GL_ATI_texture_mirror_once", | ||
239 | "GL_ATI_vertex_array_object", | ||
240 | "GL_ATI_vertex_attrib_array_object", | ||
241 | "GL_ATI_vertex_streams", | ||
242 | "GL_EXT_422_pixels", | ||
243 | "GL_EXT_abgr", | ||
244 | "GL_EXT_bgra", | ||
245 | "GL_EXT_bindable_uniform", | ||
246 | "GL_EXT_blend_color", | ||
247 | "GL_EXT_blend_equation_separate", | ||
248 | "GL_EXT_blend_func_separate", | ||
249 | "GL_EXT_blend_logic_op", | ||
250 | "GL_EXT_blend_minmax", | ||
251 | "GL_EXT_blend_subtract", | ||
252 | "GL_EXT_clip_volume_hint", | ||
253 | "GL_EXT_cmyka", | ||
254 | "GL_EXT_color_subtable", | ||
255 | "GL_EXT_compiled_vertex_array", | ||
256 | "GL_EXT_convolution", | ||
257 | "GL_EXT_coordinate_frame", | ||
258 | "GL_EXT_copy_texture", | ||
259 | "GL_EXT_cull_vertex", | ||
260 | "GL_EXT_depth_bounds_test", | ||
261 | "GL_EXT_direct_state_access", | ||
262 | "GL_EXT_draw_buffers2", | ||
263 | "GL_EXT_draw_instanced", | ||
264 | "GL_EXT_draw_range_elements", | ||
265 | "GL_EXT_fog_coord", | ||
266 | "GL_EXT_framebuffer_blit", | ||
267 | "GL_EXT_framebuffer_multisample", | ||
268 | "GL_EXT_framebuffer_multisample_blit_scaled", | ||
269 | "GL_EXT_framebuffer_object", | ||
270 | "GL_EXT_framebuffer_sRGB", | ||
271 | "GL_EXT_geometry_shader4", | ||
272 | "GL_EXT_gpu_program_parameters", | ||
273 | "GL_EXT_gpu_shader4", | ||
274 | "GL_EXT_histogram", | ||
275 | "GL_EXT_index_array_formats", | ||
276 | "GL_EXT_index_func", | ||
277 | "GL_EXT_index_material", | ||
278 | "GL_EXT_index_texture", | ||
279 | "GL_EXT_light_texture", | ||
280 | "GL_EXT_misc_attribute", | ||
281 | "GL_EXT_multi_draw_arrays", | ||
282 | "GL_EXT_multisample", | ||
283 | "GL_EXT_packed_depth_stencil", | ||
284 | "GL_EXT_packed_float", | ||
285 | "GL_EXT_packed_pixels", | ||
286 | "GL_EXT_paletted_texture", | ||
287 | "GL_EXT_pixel_buffer_object", | ||
288 | "GL_EXT_pixel_transform", | ||
289 | "GL_EXT_pixel_transform_color_table", | ||
290 | "GL_EXT_point_parameters", | ||
291 | "GL_EXT_polygon_offset", | ||
292 | "GL_EXT_provoking_vertex", | ||
293 | "GL_EXT_rescale_normal", | ||
294 | "GL_EXT_secondary_color", | ||
295 | "GL_EXT_separate_shader_objects", | ||
296 | "GL_EXT_separate_specular_color", | ||
297 | "GL_EXT_shader_image_load_store", | ||
298 | "GL_EXT_shadow_funcs", | ||
299 | "GL_EXT_shared_texture_palette", | ||
300 | "GL_EXT_stencil_clear_tag", | ||
301 | "GL_EXT_stencil_two_side", | ||
302 | "GL_EXT_stencil_wrap", | ||
303 | "GL_EXT_subtexture", | ||
304 | "GL_EXT_texture", | ||
305 | "GL_EXT_texture3D", | ||
306 | "GL_EXT_texture_array", | ||
307 | "GL_EXT_texture_buffer_object", | ||
308 | "GL_EXT_texture_compression_latc", | ||
309 | "GL_EXT_texture_compression_rgtc", | ||
310 | "GL_EXT_texture_compression_s3tc", | ||
311 | "GL_EXT_texture_cube_map", | ||
312 | "GL_EXT_texture_env_add", | ||
313 | "GL_EXT_texture_env_combine", | ||
314 | "GL_EXT_texture_env_dot3", | ||
315 | "GL_EXT_texture_filter_anisotropic", | ||
316 | "GL_EXT_texture_integer", | ||
317 | "GL_EXT_texture_lod_bias", | ||
318 | "GL_EXT_texture_mirror_clamp", | ||
319 | "GL_EXT_texture_object", | ||
320 | "GL_EXT_texture_perturb_normal", | ||
321 | "GL_EXT_texture_shared_exponent", | ||
322 | "GL_EXT_texture_snorm", | ||
323 | "GL_EXT_texture_sRGB", | ||
324 | "GL_EXT_texture_sRGB_decode", | ||
325 | "GL_EXT_texture_swizzle", | ||
326 | "GL_EXT_timer_query", | ||
327 | "GL_EXT_transform_feedback", | ||
328 | "GL_EXT_vertex_array", | ||
329 | "GL_EXT_vertex_array_bgra", | ||
330 | "GL_EXT_vertex_attrib_64bit", | ||
331 | "GL_EXT_vertex_shader", | ||
332 | "GL_EXT_vertex_weighting", | ||
333 | "GL_EXT_x11_sync_object", | ||
334 | "GL_FfdMaskSGIX", | ||
335 | "GL_GREMEDY_frame_terminator", | ||
336 | "GL_GREMEDY_string_marker", | ||
337 | "GL_HP_convolution_border_modes", | ||
338 | "GL_HP_image_transform", | ||
339 | "GL_HP_occlusion_test", | ||
340 | "GL_HP_texture_lighting", | ||
341 | "GL_IBM_cull_vertex", | ||
342 | "GL_IBM_multimode_draw_arrays", | ||
343 | "GL_IBM_rasterpos_clip", | ||
344 | "GL_IBM_texture_mirrored_repeat", | ||
345 | "GL_IBM_vertex_array_lists", | ||
346 | "GL_INGR_blend_func_separate", | ||
347 | "GL_INGR_color_clamp", | ||
348 | "GL_INGR_interlace_read", | ||
349 | "GL_INGR_palette_buffer", | ||
350 | "GL_INTEL_parallel_arrays", | ||
351 | "GL_INTEL_texture_scissor", | ||
352 | "GL_MESA_pack_invert", | ||
353 | "GL_MESA_resize_buffers", | ||
354 | "GL_MESA_window_pos", | ||
355 | "GL_MESAX_texture_stack", | ||
356 | "GL_MESA_ycbcr_texture", | ||
357 | "GL_NV_blend_square", | ||
358 | "GL_NV_conditional_render", | ||
359 | "GL_NV_copy_depth_to_color", | ||
360 | "GL_NV_copy_image", | ||
361 | "GL_NV_depth_buffer_float", | ||
362 | "GL_NV_depth_clamp", | ||
363 | "GL_NV_evaluators", | ||
364 | "GL_NV_explicit_multisample", | ||
365 | "GL_NV_fence", | ||
366 | "GL_NV_float_buffer", | ||
367 | "GL_NV_fog_distance", | ||
368 | "GL_NV_fragment_program", | ||
369 | "GL_NV_fragment_program2", | ||
370 | "GL_NV_fragment_program4", | ||
371 | "GL_NV_fragment_program_option", | ||
372 | "GL_NV_framebuffer_multisample_coverage", | ||
373 | "GL_NV_geometry_program4", | ||
374 | "GL_NV_geometry_shader4", | ||
375 | "GL_NV_gpu_program4", | ||
376 | "GL_NV_gpu_program5", | ||
377 | "GL_NV_gpu_shader5", | ||
378 | "GL_NV_half_float", | ||
379 | "GL_NV_light_max_exponent", | ||
380 | "GL_NV_multisample_coverage", | ||
381 | "GL_NV_multisample_filter_hint", | ||
382 | "GL_NV_occlusion_query", | ||
383 | "GL_NV_packed_depth_stencil", | ||
384 | "GL_NV_parameter_buffer_object", | ||
385 | "GL_NV_parameter_buffer_object2", | ||
386 | "GL_NV_pixel_data_range", | ||
387 | "GL_NV_point_sprite", | ||
388 | "GL_NV_present_video", | ||
389 | "GL_NV_primitive_restart", | ||
390 | "GL_NV_register_combiners", | ||
391 | "GL_NV_register_combiners2", | ||
392 | "GL_NV_shader_buffer_load", | ||
393 | "GL_NV_shader_buffer_store", | ||
394 | "GL_NV_tessellation_program5", | ||
395 | "GL_NV_texgen_emboss", | ||
396 | "GL_NV_texgen_reflection", | ||
397 | "GL_NV_texture_barrier", | ||
398 | "GL_NV_texture_compression_vtc", | ||
399 | "GL_NV_texture_env_combine4", | ||
400 | "GL_NV_texture_expand_normal", | ||
401 | "GL_NV_texture_multisample", | ||
402 | "GL_NV_texture_rectangle", | ||
403 | "GL_NV_texture_shader", | ||
404 | "GL_NV_texture_shader2", | ||
405 | "GL_NV_texture_shader3", | ||
406 | "GL_NV_transform_feedback", | ||
407 | "GL_NV_transform_feedback2", | ||
408 | "GL_NV_vdpau_interop", | ||
409 | "GL_NV_vertex_array_range", | ||
410 | "GL_NV_vertex_array_range2", | ||
411 | "GL_NV_vertex_attrib_integer_64bit", | ||
412 | "GL_NV_vertex_buffer_unified_memory", | ||
413 | "GL_NV_vertex_program", | ||
414 | "GL_NV_vertex_program1_1", | ||
415 | "GL_NV_vertex_program2", | ||
416 | "GL_NV_vertex_program2_option", | ||
417 | "GL_NV_vertex_program3", | ||
418 | "GL_NV_vertex_program4", | ||
419 | "GL_NV_video_capture", | ||
420 | "GL_OES_read_format", | ||
421 | "GL_OML_interlace", | ||
422 | "GL_OML_resample", | ||
423 | "GL_OML_subsample", | ||
424 | "GL_PGI_misc_hints", | ||
425 | "GL_PGI_vertex_hints", | ||
426 | "GL_REND_screen_coordinates", | ||
427 | "GL_S3_s3tc", | ||
428 | "GL_SGI_color_matrix", | ||
429 | "GL_SGI_color_table", | ||
430 | "GL_SGI_depth_pass_instrument", | ||
431 | "GL_SGIS_detail_texture", | ||
432 | "GL_SGIS_fog_function", | ||
433 | "GL_SGIS_generate_mipmap", | ||
434 | "GL_SGIS_multisample", | ||
435 | "GL_SGIS_pixel_texture", | ||
436 | "GL_SGIS_point_line_texgen", | ||
437 | "GL_SGIS_point_parameters", | ||
438 | "GL_SGIS_sharpen_texture", | ||
439 | "GL_SGIS_texture4D", | ||
440 | "GL_SGIS_texture_border_clamp", | ||
441 | "GL_SGIS_texture_color_mask", | ||
442 | "GL_SGIS_texture_edge_clamp", | ||
443 | "GL_SGIS_texture_filter4", | ||
444 | "GL_SGIS_texture_lod", | ||
445 | "GL_SGIS_texture_select", | ||
446 | "GL_SGI_texture_color_table", | ||
447 | "GL_SGIX_async", | ||
448 | "GL_SGIX_async_histogram", | ||
449 | "GL_SGIX_async_pixel", | ||
450 | "GL_SGIX_blend_alpha_minmax", | ||
451 | "GL_SGIX_calligraphic_fragment", | ||
452 | "GL_SGIX_clipmap", | ||
453 | "GL_SGIX_convolution_accuracy", | ||
454 | "GL_SGIX_depth_pass_instrument", | ||
455 | "GL_SGIX_depth_texture", | ||
456 | "GL_SGIX_flush_raster", | ||
457 | "GL_SGIX_fog_offset", | ||
458 | "GL_SGIX_fog_scale", | ||
459 | "GL_SGIX_fragment_lighting", | ||
460 | "GL_SGIX_framezoom", | ||
461 | "GL_SGIX_igloo_interface", | ||
462 | "GL_SGIX_impact_pixel_texture", | ||
463 | "GL_SGIX_instruments", | ||
464 | "GL_SGIX_interlace", | ||
465 | "GL_SGIX_ir_instrument1", | ||
466 | "GL_SGIX_list_priority", | ||
467 | "GL_SGIX_pixel_texture", | ||
468 | "GL_SGIX_pixel_tiles", | ||
469 | "GL_SGIX_polynomial_ffd", | ||
470 | "GL_SGIX_reference_plane", | ||
471 | "GL_SGIX_resample", | ||
472 | "GL_SGIX_scalebias_hint", | ||
473 | "GL_SGIX_shadow", | ||
474 | "GL_SGIX_shadow_ambient", | ||
475 | "GL_SGIX_sprite", | ||
476 | "GL_SGIX_subsample", | ||
477 | "GL_SGIX_tag_sample_buffer", | ||
478 | "GL_SGIX_texture_add_env", | ||
479 | "GL_SGIX_texture_coordinate_clamp", | ||
480 | "GL_SGIX_texture_lod_bias", | ||
481 | "GL_SGIX_texture_multi_buffer", | ||
482 | "GL_SGIX_texture_scale_bias", | ||
483 | "GL_SGIX_texture_select", | ||
484 | "GL_SGIX_vertex_preclip", | ||
485 | "GL_SGIX_ycrcb", | ||
486 | "GL_SGIX_ycrcba", | ||
487 | "GL_SGIX_ycrcb_subsample", | ||
488 | "GL_SUN_convolution_border_modes", | ||
489 | "GL_SUN_global_alpha", | ||
490 | "GL_SUN_mesh_array", | ||
491 | "GL_SUN_slice_accum", | ||
492 | "GL_SUN_triangle_list", | ||
493 | "GL_SUN_vertex", | ||
494 | "GL_SUNX_constant_data", | ||
495 | "GL_WIN_phong_shading", | ||
496 | "GL_WIN_specular_fog", | ||
497 | // unofficial stuff | ||
498 | "GL_NVX_gpu_memory_info" | ||
499 | }; | ||
500 | |||
501 | |||
502 | class COpenGLExtensionHandler | ||
503 | { | ||
504 | public: | ||
505 | enum EOpenGLFeatures { | ||
506 | IRR_3DFX_multisample = 0, | ||
507 | IRR_3DFX_tbuffer, | ||
508 | IRR_3DFX_texture_compression_FXT1, | ||
509 | IRR_AMD_blend_minmax_factor, | ||
510 | IRR_AMD_conservative_depth, | ||
511 | IRR_AMD_debug_output, | ||
512 | IRR_AMD_depth_clamp_separate, | ||
513 | IRR_AMD_draw_buffers_blend, | ||
514 | IRR_AMD_multi_draw_indirect, | ||
515 | IRR_AMD_name_gen_delete, | ||
516 | IRR_AMD_performance_monitor, | ||
517 | IRR_AMD_sample_positions, | ||
518 | IRR_AMD_seamless_cubemap_per_texture, | ||
519 | IRR_AMD_shader_stencil_export, | ||
520 | IRR_AMD_texture_texture4, | ||
521 | IRR_AMD_transform_feedback3_lines_triangles, | ||
522 | IRR_AMD_vertex_shader_tesselator, | ||
523 | IRR_APPLE_aux_depth_stencil, | ||
524 | IRR_APPLE_client_storage, | ||
525 | IRR_APPLE_element_array, | ||
526 | IRR_APPLE_fence, | ||
527 | IRR_APPLE_float_pixels, | ||
528 | IRR_APPLE_flush_buffer_range, | ||
529 | IRR_APPLE_object_purgeable, | ||
530 | IRR_APPLE_rgb_422, | ||
531 | IRR_APPLE_row_bytes, | ||
532 | IRR_APPLE_specular_vector, | ||
533 | IRR_APPLE_texture_range, | ||
534 | IRR_APPLE_transform_hint, | ||
535 | IRR_APPLE_vertex_array_object, | ||
536 | IRR_APPLE_vertex_array_range, | ||
537 | IRR_APPLE_vertex_program_evaluators, | ||
538 | IRR_APPLE_ycbcr_422, | ||
539 | IRR_ARB_base_instance, | ||
540 | IRR_ARB_blend_func_extended, | ||
541 | IRR_ARB_cl_event, | ||
542 | IRR_ARB_color_buffer_float, | ||
543 | IRR_ARB_compatibility, | ||
544 | IRR_ARB_compressed_texture_pixel_storage, | ||
545 | IRR_ARB_conservative_depth, | ||
546 | IRR_ARB_copy_buffer, | ||
547 | IRR_ARB_debug_output, | ||
548 | IRR_ARB_depth_buffer_float, | ||
549 | IRR_ARB_depth_clamp, | ||
550 | IRR_ARB_depth_texture, | ||
551 | IRR_ARB_draw_buffers, | ||
552 | IRR_ARB_draw_buffers_blend, | ||
553 | IRR_ARB_draw_elements_base_vertex, | ||
554 | IRR_ARB_draw_indirect, | ||
555 | IRR_ARB_draw_instanced, | ||
556 | IRR_ARB_ES2_compatibility, | ||
557 | IRR_ARB_explicit_attrib_location, | ||
558 | IRR_ARB_fragment_coord_conventions, | ||
559 | IRR_ARB_fragment_program, | ||
560 | IRR_ARB_fragment_program_shadow, | ||
561 | IRR_ARB_fragment_shader, | ||
562 | IRR_ARB_framebuffer_object, | ||
563 | IRR_ARB_framebuffer_sRGB, | ||
564 | IRR_ARB_geometry_shader4, | ||
565 | IRR_ARB_get_program_binary, | ||
566 | IRR_ARB_gpu_shader5, | ||
567 | IRR_ARB_gpu_shader_fp64, | ||
568 | IRR_ARB_half_float_pixel, | ||
569 | IRR_ARB_half_float_vertex, | ||
570 | IRR_ARB_imaging, | ||
571 | IRR_ARB_instanced_arrays, | ||
572 | IRR_ARB_internalformat_query, | ||
573 | IRR_ARB_map_buffer_alignment, | ||
574 | IRR_ARB_map_buffer_range, | ||
575 | IRR_ARB_matrix_palette, | ||
576 | IRR_ARB_multisample, | ||
577 | IRR_ARB_multitexture, | ||
578 | IRR_ARB_occlusion_query, | ||
579 | IRR_ARB_occlusion_query2, | ||
580 | IRR_ARB_pixel_buffer_object, | ||
581 | IRR_ARB_point_parameters, | ||
582 | IRR_ARB_point_sprite, | ||
583 | IRR_ARB_provoking_vertex, | ||
584 | IRR_ARB_robustness, | ||
585 | IRR_ARB_sample_shading, | ||
586 | IRR_ARB_sampler_objects, | ||
587 | IRR_ARB_seamless_cube_map, | ||
588 | IRR_ARB_separate_shader_objects, | ||
589 | IRR_ARB_shader_atomic_counters, | ||
590 | IRR_ARB_shader_bit_encoding, | ||
591 | IRR_ARB_shader_image_load_store, | ||
592 | IRR_ARB_shader_objects, | ||
593 | IRR_ARB_shader_precision, | ||
594 | IRR_ARB_shader_stencil_export, | ||
595 | IRR_ARB_shader_subroutine, | ||
596 | IRR_ARB_shader_texture_lod, | ||
597 | IRR_ARB_shading_language_100, | ||
598 | IRR_ARB_shading_language_420pack, | ||
599 | IRR_ARB_shading_language_include, | ||
600 | IRR_ARB_shading_language_packing, | ||
601 | IRR_ARB_shadow, | ||
602 | IRR_ARB_shadow_ambient, | ||
603 | IRR_ARB_sync, | ||
604 | IRR_ARB_tessellation_shader, | ||
605 | IRR_ARB_texture_border_clamp, | ||
606 | IRR_ARB_texture_buffer_object, | ||
607 | IRR_ARB_texture_buffer_object_rgb32, | ||
608 | IRR_ARB_texture_compression, | ||
609 | IRR_ARB_texture_compression_bptc, | ||
610 | IRR_ARB_texture_compression_rgtc, | ||
611 | IRR_ARB_texture_cube_map, | ||
612 | IRR_ARB_texture_cube_map_array, | ||
613 | IRR_ARB_texture_env_add, | ||
614 | IRR_ARB_texture_env_combine, | ||
615 | IRR_ARB_texture_env_crossbar, | ||
616 | IRR_ARB_texture_env_dot3, | ||
617 | IRR_ARB_texture_float, | ||
618 | IRR_ARB_texture_gather, | ||
619 | IRR_ARB_texture_mirrored_repeat, | ||
620 | IRR_ARB_texture_multisample, | ||
621 | IRR_ARB_texture_non_power_of_two, | ||
622 | IRR_ARB_texture_query_lod, | ||
623 | IRR_ARB_texture_rectangle, | ||
624 | IRR_ARB_texture_rg, | ||
625 | IRR_ARB_texture_rgb10_a2ui, | ||
626 | IRR_ARB_texture_storage, | ||
627 | IRR_ARB_texture_swizzle, | ||
628 | IRR_ARB_timer_query, | ||
629 | IRR_ARB_transform_feedback2, | ||
630 | IRR_ARB_transform_feedback3, | ||
631 | IRR_ARB_transform_feedback_instanced, | ||
632 | IRR_ARB_transpose_matrix, | ||
633 | IRR_ARB_uniform_buffer_object, | ||
634 | IRR_ARB_vertex_array_bgra, | ||
635 | IRR_ARB_vertex_array_object, | ||
636 | IRR_ARB_vertex_attrib_64bit, | ||
637 | IRR_ARB_vertex_blend, | ||
638 | IRR_ARB_vertex_buffer_object, | ||
639 | IRR_ARB_vertex_program, | ||
640 | IRR_ARB_vertex_shader, | ||
641 | IRR_ARB_vertex_type_2_10_10_10_rev, | ||
642 | IRR_ARB_viewport_array, | ||
643 | IRR_ARB_window_pos, | ||
644 | IRR_ATI_draw_buffers, | ||
645 | IRR_ATI_element_array, | ||
646 | IRR_ATI_envmap_bumpmap, | ||
647 | IRR_ATI_fragment_shader, | ||
648 | IRR_ATI_map_object_buffer, | ||
649 | IRR_ATI_meminfo, | ||
650 | IRR_ATI_pixel_format_float, | ||
651 | IRR_ATI_pn_triangles, | ||
652 | IRR_ATI_separate_stencil, | ||
653 | IRR_ATI_text_fragment_shader, | ||
654 | IRR_ATI_texture_env_combine3, | ||
655 | IRR_ATI_texture_float, | ||
656 | IRR_ATI_texture_mirror_once, | ||
657 | IRR_ATI_vertex_array_object, | ||
658 | IRR_ATI_vertex_attrib_array_object, | ||
659 | IRR_ATI_vertex_streams, | ||
660 | IRR_EXT_422_pixels, | ||
661 | IRR_EXT_abgr, | ||
662 | IRR_EXT_bgra, | ||
663 | IRR_EXT_bindable_uniform, | ||
664 | IRR_EXT_blend_color, | ||
665 | IRR_EXT_blend_equation_separate, | ||
666 | IRR_EXT_blend_func_separate, | ||
667 | IRR_EXT_blend_logic_op, | ||
668 | IRR_EXT_blend_minmax, | ||
669 | IRR_EXT_blend_subtract, | ||
670 | IRR_EXT_clip_volume_hint, | ||
671 | IRR_EXT_cmyka, | ||
672 | IRR_EXT_color_subtable, | ||
673 | IRR_EXT_compiled_vertex_array, | ||
674 | IRR_EXT_convolution, | ||
675 | IRR_EXT_coordinate_frame, | ||
676 | IRR_EXT_copy_texture, | ||
677 | IRR_EXT_cull_vertex, | ||
678 | IRR_EXT_depth_bounds_test, | ||
679 | IRR_EXT_direct_state_access, | ||
680 | IRR_EXT_draw_buffers2, | ||
681 | IRR_EXT_draw_instanced, | ||
682 | IRR_EXT_draw_range_elements, | ||
683 | IRR_EXT_fog_coord, | ||
684 | IRR_EXT_framebuffer_blit, | ||
685 | IRR_EXT_framebuffer_multisample, | ||
686 | IRR_EXT_framebuffer_multisample_blit_scaled, | ||
687 | IRR_EXT_framebuffer_object, | ||
688 | IRR_EXT_framebuffer_sRGB, | ||
689 | IRR_EXT_geometry_shader4, | ||
690 | IRR_EXT_gpu_program_parameters, | ||
691 | IRR_EXT_gpu_shader4, | ||
692 | IRR_EXT_histogram, | ||
693 | IRR_EXT_index_array_formats, | ||
694 | IRR_EXT_index_func, | ||
695 | IRR_EXT_index_material, | ||
696 | IRR_EXT_index_texture, | ||
697 | IRR_EXT_light_texture, | ||
698 | IRR_EXT_misc_attribute, | ||
699 | IRR_EXT_multi_draw_arrays, | ||
700 | IRR_EXT_multisample, | ||
701 | IRR_EXT_packed_depth_stencil, | ||
702 | IRR_EXT_packed_float, | ||
703 | IRR_EXT_packed_pixels, | ||
704 | IRR_EXT_paletted_texture, | ||
705 | IRR_EXT_pixel_buffer_object, | ||
706 | IRR_EXT_pixel_transform, | ||
707 | IRR_EXT_pixel_transform_color_table, | ||
708 | IRR_EXT_point_parameters, | ||
709 | IRR_EXT_polygon_offset, | ||
710 | IRR_EXT_provoking_vertex, | ||
711 | IRR_EXT_rescale_normal, | ||
712 | IRR_EXT_secondary_color, | ||
713 | IRR_EXT_separate_shader_objects, | ||
714 | IRR_EXT_separate_specular_color, | ||
715 | IRR_EXT_shader_image_load_store, | ||
716 | IRR_EXT_shadow_funcs, | ||
717 | IRR_EXT_shared_texture_palette, | ||
718 | IRR_EXT_stencil_clear_tag, | ||
719 | IRR_EXT_stencil_two_side, | ||
720 | IRR_EXT_stencil_wrap, | ||
721 | IRR_EXT_subtexture, | ||
722 | IRR_EXT_texture, | ||
723 | IRR_EXT_texture3D, | ||
724 | IRR_EXT_texture_array, | ||
725 | IRR_EXT_texture_buffer_object, | ||
726 | IRR_EXT_texture_compression_latc, | ||
727 | IRR_EXT_texture_compression_rgtc, | ||
728 | IRR_EXT_texture_compression_s3tc, | ||
729 | IRR_EXT_texture_cube_map, | ||
730 | IRR_EXT_texture_env_add, | ||
731 | IRR_EXT_texture_env_combine, | ||
732 | IRR_EXT_texture_env_dot3, | ||
733 | IRR_EXT_texture_filter_anisotropic, | ||
734 | IRR_EXT_texture_integer, | ||
735 | IRR_EXT_texture_lod_bias, | ||
736 | IRR_EXT_texture_mirror_clamp, | ||
737 | IRR_EXT_texture_object, | ||
738 | IRR_EXT_texture_perturb_normal, | ||
739 | IRR_EXT_texture_shared_exponent, | ||
740 | IRR_EXT_texture_snorm, | ||
741 | IRR_EXT_texture_sRGB, | ||
742 | IRR_EXT_texture_sRGB_decode, | ||
743 | IRR_EXT_texture_swizzle, | ||
744 | IRR_EXT_timer_query, | ||
745 | IRR_EXT_transform_feedback, | ||
746 | IRR_EXT_vertex_array, | ||
747 | IRR_EXT_vertex_array_bgra, | ||
748 | IRR_EXT_vertex_attrib_64bit, | ||
749 | IRR_EXT_vertex_shader, | ||
750 | IRR_EXT_vertex_weighting, | ||
751 | IRR_EXT_x11_sync_object, | ||
752 | IRR_FfdMaskSGIX, | ||
753 | IRR_GREMEDY_frame_terminator, | ||
754 | IRR_GREMEDY_string_marker, | ||
755 | IRR_HP_convolution_border_modes, | ||
756 | IRR_HP_image_transform, | ||
757 | IRR_HP_occlusion_test, | ||
758 | IRR_HP_texture_lighting, | ||
759 | IRR_IBM_cull_vertex, | ||
760 | IRR_IBM_multimode_draw_arrays, | ||
761 | IRR_IBM_rasterpos_clip, | ||
762 | IRR_IBM_texture_mirrored_repeat, | ||
763 | IRR_IBM_vertex_array_lists, | ||
764 | IRR_INGR_blend_func_separate, | ||
765 | IRR_INGR_color_clamp, | ||
766 | IRR_INGR_interlace_read, | ||
767 | IRR_INGR_palette_buffer, | ||
768 | IRR_INTEL_parallel_arrays, | ||
769 | IRR_INTEL_texture_scissor, | ||
770 | IRR_MESA_pack_invert, | ||
771 | IRR_MESA_resize_buffers, | ||
772 | IRR_MESA_window_pos, | ||
773 | IRR_MESAX_texture_stack, | ||
774 | IRR_MESA_ycbcr_texture, | ||
775 | IRR_NV_blend_square, | ||
776 | IRR_NV_conditional_render, | ||
777 | IRR_NV_copy_depth_to_color, | ||
778 | IRR_NV_copy_image, | ||
779 | IRR_NV_depth_buffer_float, | ||
780 | IRR_NV_depth_clamp, | ||
781 | IRR_NV_evaluators, | ||
782 | IRR_NV_explicit_multisample, | ||
783 | IRR_NV_fence, | ||
784 | IRR_NV_float_buffer, | ||
785 | IRR_NV_fog_distance, | ||
786 | IRR_NV_fragment_program, | ||
787 | IRR_NV_fragment_program2, | ||
788 | IRR_NV_fragment_program4, | ||
789 | IRR_NV_fragment_program_option, | ||
790 | IRR_NV_framebuffer_multisample_coverage, | ||
791 | IRR_NV_geometry_program4, | ||
792 | IRR_NV_geometry_shader4, | ||
793 | IRR_NV_gpu_program4, | ||
794 | IRR_NV_gpu_program5, | ||
795 | IRR_NV_gpu_shader5, | ||
796 | IRR_NV_half_float, | ||
797 | IRR_NV_light_max_exponent, | ||
798 | IRR_NV_multisample_coverage, | ||
799 | IRR_NV_multisample_filter_hint, | ||
800 | IRR_NV_occlusion_query, | ||
801 | IRR_NV_packed_depth_stencil, | ||
802 | IRR_NV_parameter_buffer_object, | ||
803 | IRR_NV_parameter_buffer_object2, | ||
804 | IRR_NV_pixel_data_range, | ||
805 | IRR_NV_point_sprite, | ||
806 | IRR_NV_present_video, | ||
807 | IRR_NV_primitive_restart, | ||
808 | IRR_NV_register_combiners, | ||
809 | IRR_NV_register_combiners2, | ||
810 | IRR_NV_shader_buffer_load, | ||
811 | IRR_NV_shader_buffer_store, | ||
812 | IRR_NV_tessellation_program5, | ||
813 | IRR_NV_texgen_emboss, | ||
814 | IRR_NV_texgen_reflection, | ||
815 | IRR_NV_texture_barrier, | ||
816 | IRR_NV_texture_compression_vtc, | ||
817 | IRR_NV_texture_env_combine4, | ||
818 | IRR_NV_texture_expand_normal, | ||
819 | IRR_NV_texture_multisample, | ||
820 | IRR_NV_texture_rectangle, | ||
821 | IRR_NV_texture_shader, | ||
822 | IRR_NV_texture_shader2, | ||
823 | IRR_NV_texture_shader3, | ||
824 | IRR_NV_transform_feedback, | ||
825 | IRR_NV_transform_feedback2, | ||
826 | IRR_NV_vdpau_interop, | ||
827 | IRR_NV_vertex_array_range, | ||
828 | IRR_NV_vertex_array_range2, | ||
829 | IRR_NV_vertex_attrib_integer_64bit, | ||
830 | IRR_NV_vertex_buffer_unified_memory, | ||
831 | IRR_NV_vertex_program, | ||
832 | IRR_NV_vertex_program1_1, | ||
833 | IRR_NV_vertex_program2, | ||
834 | IRR_NV_vertex_program2_option, | ||
835 | IRR_NV_vertex_program3, | ||
836 | IRR_NV_vertex_program4, | ||
837 | IRR_NV_video_capture, | ||
838 | IRR_OES_read_format, | ||
839 | IRR_OML_interlace, | ||
840 | IRR_OML_resample, | ||
841 | IRR_OML_subsample, | ||
842 | IRR_PGI_misc_hints, | ||
843 | IRR_PGI_vertex_hints, | ||
844 | IRR_REND_screen_coordinates, | ||
845 | IRR_S3_s3tc, | ||
846 | IRR_SGI_color_matrix, | ||
847 | IRR_SGI_color_table, | ||
848 | IRR_SGI_depth_pass_instrument, | ||
849 | IRR_SGIS_detail_texture, | ||
850 | IRR_SGIS_fog_function, | ||
851 | IRR_SGIS_generate_mipmap, | ||
852 | IRR_SGIS_multisample, | ||
853 | IRR_SGIS_pixel_texture, | ||
854 | IRR_SGIS_point_line_texgen, | ||
855 | IRR_SGIS_point_parameters, | ||
856 | IRR_SGIS_sharpen_texture, | ||
857 | IRR_SGIS_texture4D, | ||
858 | IRR_SGIS_texture_border_clamp, | ||
859 | IRR_SGIS_texture_color_mask, | ||
860 | IRR_SGIS_texture_edge_clamp, | ||
861 | IRR_SGIS_texture_filter4, | ||
862 | IRR_SGIS_texture_lod, | ||
863 | IRR_SGIS_texture_select, | ||
864 | IRR_SGI_texture_color_table, | ||
865 | IRR_SGIX_async, | ||
866 | IRR_SGIX_async_histogram, | ||
867 | IRR_SGIX_async_pixel, | ||
868 | IRR_SGIX_blend_alpha_minmax, | ||
869 | IRR_SGIX_calligraphic_fragment, | ||
870 | IRR_SGIX_clipmap, | ||
871 | IRR_SGIX_convolution_accuracy, | ||
872 | IRR_SGIX_depth_pass_instrument, | ||
873 | IRR_SGIX_depth_texture, | ||
874 | IRR_SGIX_flush_raster, | ||
875 | IRR_SGIX_fog_offset, | ||
876 | IRR_SGIX_fog_scale, | ||
877 | IRR_SGIX_fragment_lighting, | ||
878 | IRR_SGIX_framezoom, | ||
879 | IRR_SGIX_igloo_interface, | ||
880 | IRR_SGIX_impact_pixel_texture, | ||
881 | IRR_SGIX_instruments, | ||
882 | IRR_SGIX_interlace, | ||
883 | IRR_SGIX_ir_instrument1, | ||
884 | IRR_SGIX_list_priority, | ||
885 | IRR_SGIX_pixel_texture, | ||
886 | IRR_SGIX_pixel_tiles, | ||
887 | IRR_SGIX_polynomial_ffd, | ||
888 | IRR_SGIX_reference_plane, | ||
889 | IRR_SGIX_resample, | ||
890 | IRR_SGIX_scalebias_hint, | ||
891 | IRR_SGIX_shadow, | ||
892 | IRR_SGIX_shadow_ambient, | ||
893 | IRR_SGIX_sprite, | ||
894 | IRR_SGIX_subsample, | ||
895 | IRR_SGIX_tag_sample_buffer, | ||
896 | IRR_SGIX_texture_add_env, | ||
897 | IRR_SGIX_texture_coordinate_clamp, | ||
898 | IRR_SGIX_texture_lod_bias, | ||
899 | IRR_SGIX_texture_multi_buffer, | ||
900 | IRR_SGIX_texture_scale_bias, | ||
901 | IRR_SGIX_texture_select, | ||
902 | IRR_SGIX_vertex_preclip, | ||
903 | IRR_SGIX_ycrcb, | ||
904 | IRR_SGIX_ycrcba, | ||
905 | IRR_SGIX_ycrcb_subsample, | ||
906 | IRR_SUN_convolution_border_modes, | ||
907 | IRR_SUN_global_alpha, | ||
908 | IRR_SUN_mesh_array, | ||
909 | IRR_SUN_slice_accum, | ||
910 | IRR_SUN_triangle_list, | ||
911 | IRR_SUN_vertex, | ||
912 | IRR_SUNX_constant_data, | ||
913 | IRR_WIN_phong_shading, | ||
914 | IRR_WIN_specular_fog, | ||
915 | IRR_NVX_gpu_memory_info, | ||
916 | IRR_OpenGL_Feature_Count | ||
917 | }; | ||
918 | |||
919 | |||
920 | // constructor | ||
921 | COpenGLExtensionHandler(); | ||
922 | |||
923 | // deferred initialization | ||
924 | void initExtensions(bool stencilBuffer); | ||
925 | |||
926 | //! queries the features of the driver, returns true if feature is available | ||
927 | bool queryFeature(E_VIDEO_DRIVER_FEATURE feature) const; | ||
928 | |||
929 | //! queries the features of the driver, returns true if feature is available | ||
930 | bool queryOpenGLFeature(EOpenGLFeatures feature) const | ||
931 | { | ||
932 | return FeatureAvailable[feature]; | ||
933 | } | ||
934 | |||
935 | //! show all features with availablity | ||
936 | void dump() const; | ||
937 | |||
938 | void dumpFramebufferFormats() const; | ||
939 | |||
940 | // Some variables for properties | ||
941 | bool StencilBuffer; | ||
942 | bool MultiTextureExtension; | ||
943 | bool TextureCompressionExtension; | ||
944 | |||
945 | // Some non-boolean properties | ||
946 | //! Maxmimum texture layers supported by the fixed pipeline | ||
947 | u8 MaxSupportedTextures; | ||
948 | //! Maxmimum texture layers supported by the engine | ||
949 | u8 MaxTextureUnits; | ||
950 | //! Maximum hardware lights supported | ||
951 | u8 MaxLights; | ||
952 | //! Maximal Anisotropy | ||
953 | u8 MaxAnisotropy; | ||
954 | //! Number of user clipplanes | ||
955 | u8 MaxUserClipPlanes; | ||
956 | //! Number of auxiliary buffers | ||
957 | u8 MaxAuxBuffers; | ||
958 | //! Number of rendertargets available as MRTs | ||
959 | u8 MaxMultipleRenderTargets; | ||
960 | //! Optimal number of indices per meshbuffer | ||
961 | u32 MaxIndices; | ||
962 | //! Maximal texture dimension | ||
963 | u32 MaxTextureSize; | ||
964 | //! Maximal vertices handled by geometry shaders | ||
965 | u32 MaxGeometryVerticesOut; | ||
966 | //! Maximal LOD Bias | ||
967 | f32 MaxTextureLODBias; | ||
968 | //! Minimal and maximal supported thickness for lines without smoothing | ||
969 | GLfloat DimAliasedLine[2]; | ||
970 | //! Minimal and maximal supported thickness for points without smoothing | ||
971 | GLfloat DimAliasedPoint[2]; | ||
972 | //! Minimal and maximal supported thickness for lines with smoothing | ||
973 | GLfloat DimSmoothedLine[2]; | ||
974 | //! Minimal and maximal supported thickness for points with smoothing | ||
975 | GLfloat DimSmoothedPoint[2]; | ||
976 | |||
977 | //! OpenGL version as Integer: 100*Major+Minor, i.e. 2.1 becomes 201 | ||
978 | u16 Version; | ||
979 | //! GLSL version as Integer: 100*Major+Minor | ||
980 | u16 ShaderLanguageVersion; | ||
981 | |||
982 | bool OcclusionQuerySupport; | ||
983 | |||
984 | // public access to the (loaded) extensions. | ||
985 | // general functions | ||
986 | void extGlActiveTexture(GLenum texture); | ||
987 | void extGlClientActiveTexture(GLenum texture); | ||
988 | void extGlPointParameterf(GLint loc, GLfloat f); | ||
989 | void extGlPointParameterfv(GLint loc, const GLfloat *v); | ||
990 | void extGlStencilFuncSeparate (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); | ||
991 | void extGlStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass); | ||
992 | void extGlCompressedTexImage2D(GLenum target, GLint level, | ||
993 | GLenum internalformat, GLsizei width, GLsizei height, | ||
994 | GLint border, GLsizei imageSize, const void* data); | ||
995 | |||
996 | // shader programming | ||
997 | void extGlGenPrograms(GLsizei n, GLuint *programs); | ||
998 | void extGlBindProgram(GLenum target, GLuint program); | ||
999 | void extGlProgramString(GLenum target, GLenum format, GLsizei len, const GLvoid *string); | ||
1000 | void extGlLoadProgram(GLenum target, GLuint id, GLsizei len, const GLubyte *string); | ||
1001 | void extGlDeletePrograms(GLsizei n, const GLuint *programs); | ||
1002 | void extGlProgramLocalParameter4fv(GLenum, GLuint, const GLfloat *); | ||
1003 | GLhandleARB extGlCreateShaderObject(GLenum shaderType); | ||
1004 | GLuint extGlCreateShader(GLenum shaderType); | ||
1005 | // note: Due to the type confusion between shader_objects and OpenGL 2.0 | ||
1006 | // we have to add the ARB extension for proper method definitions in case | ||
1007 | // that handleARB and uint are the same type | ||
1008 | void extGlShaderSourceARB(GLhandleARB shader, GLsizei numOfStrings, const char **strings, const GLint *lenOfStrings); | ||
1009 | void extGlShaderSource(GLuint shader, GLsizei numOfStrings, const char **strings, const GLint *lenOfStrings); | ||
1010 | // note: Due to the type confusion between shader_objects and OpenGL 2.0 | ||
1011 | // we have to add the ARB extension for proper method definitions in case | ||
1012 | // that handleARB and uint are the same type | ||
1013 | void extGlCompileShaderARB(GLhandleARB shader); | ||
1014 | void extGlCompileShader(GLuint shader); | ||
1015 | GLhandleARB extGlCreateProgramObject(void); | ||
1016 | GLuint extGlCreateProgram(void); | ||
1017 | void extGlAttachObject(GLhandleARB program, GLhandleARB shader); | ||
1018 | void extGlAttachShader(GLuint program, GLuint shader); | ||
1019 | void extGlLinkProgramARB(GLhandleARB program); | ||
1020 | // note: Due to the type confusion between shader_objects and OpenGL 2.0 | ||
1021 | // we have to add the ARB extension for proper method definitions in case | ||
1022 | // that handleARB and uint are the same type | ||
1023 | void extGlLinkProgram(GLuint program); | ||
1024 | void extGlUseProgramObject(GLhandleARB prog); | ||
1025 | void extGlUseProgram(GLuint prog); | ||
1026 | void extGlDeleteObject(GLhandleARB object); | ||
1027 | void extGlDeleteProgram(GLuint object); | ||
1028 | void extGlDeleteShader(GLuint shader); | ||
1029 | void extGlGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders); | ||
1030 | void extGlGetAttachedObjects(GLhandleARB program, GLsizei maxcount, GLsizei* count, GLhandleARB* shaders); | ||
1031 | void extGlGetInfoLog(GLhandleARB object, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); | ||
1032 | void extGlGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog); | ||
1033 | void extGlGetProgramInfoLog(GLuint program, GLsizei maxLength, GLsizei *length, GLchar *infoLog); | ||
1034 | void extGlGetObjectParameteriv(GLhandleARB object, GLenum type, GLint *param); | ||
1035 | void extGlGetShaderiv(GLuint shader, GLenum type, GLint *param); | ||
1036 | void extGlGetProgramiv(GLuint program, GLenum type, GLint *param); | ||
1037 | GLint extGlGetUniformLocationARB(GLhandleARB program, const char *name); | ||
1038 | GLint extGlGetUniformLocation(GLuint program, const char *name); | ||
1039 | void extGlUniform1fv(GLint loc, GLsizei count, const GLfloat *v); | ||
1040 | void extGlUniform2fv(GLint loc, GLsizei count, const GLfloat *v); | ||
1041 | void extGlUniform3fv(GLint loc, GLsizei count, const GLfloat *v); | ||
1042 | void extGlUniform4fv(GLint loc, GLsizei count, const GLfloat *v); | ||
1043 | void extGlUniform1bv(GLint loc, GLsizei count, const bool *v); | ||
1044 | void extGlUniform2bv(GLint loc, GLsizei count, const bool *v); | ||
1045 | void extGlUniform3bv(GLint loc, GLsizei count, const bool *v); | ||
1046 | void extGlUniform4bv(GLint loc, GLsizei count, const bool *v); | ||
1047 | void extGlUniform1iv(GLint loc, GLsizei count, const GLint *v); | ||
1048 | void extGlUniform2iv(GLint loc, GLsizei count, const GLint *v); | ||
1049 | void extGlUniform3iv(GLint loc, GLsizei count, const GLint *v); | ||
1050 | void extGlUniform4iv(GLint loc, GLsizei count, const GLint *v); | ||
1051 | void extGlUniformMatrix2fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v); | ||
1052 | void extGlUniformMatrix3fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v); | ||
1053 | void extGlUniformMatrix4fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v); | ||
1054 | void extGlGetActiveUniformARB(GLhandleARB program, GLuint index, GLsizei maxlength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); | ||
1055 | void extGlGetActiveUniform(GLuint program, GLuint index, GLsizei maxlength, GLsizei *length, GLint *size, GLenum *type, GLchar *name); | ||
1056 | |||
1057 | // framebuffer objects | ||
1058 | void extGlBindFramebuffer(GLenum target, GLuint framebuffer); | ||
1059 | void extGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers); | ||
1060 | void extGlGenFramebuffers(GLsizei n, GLuint *framebuffers); | ||
1061 | GLenum extGlCheckFramebufferStatus(GLenum target); | ||
1062 | void extGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); | ||
1063 | void extGlBindRenderbuffer(GLenum target, GLuint renderbuffer); | ||
1064 | void extGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers); | ||
1065 | void extGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers); | ||
1066 | void extGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height); | ||
1067 | void extGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); | ||
1068 | void extGlGenerateMipmap(GLenum target); | ||
1069 | void extGlActiveStencilFace(GLenum face); | ||
1070 | void extGlDrawBuffers(GLsizei n, const GLenum *bufs); | ||
1071 | |||
1072 | // vertex buffer object | ||
1073 | void extGlGenBuffers(GLsizei n, GLuint *buffers); | ||
1074 | void extGlBindBuffer(GLenum target, GLuint buffer); | ||
1075 | void extGlBufferData(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); | ||
1076 | void extGlDeleteBuffers(GLsizei n, const GLuint *buffers); | ||
1077 | void extGlBufferSubData (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); | ||
1078 | void extGlGetBufferSubData (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); | ||
1079 | void *extGlMapBuffer (GLenum target, GLenum access); | ||
1080 | GLboolean extGlUnmapBuffer (GLenum target); | ||
1081 | GLboolean extGlIsBuffer (GLuint buffer); | ||
1082 | void extGlGetBufferParameteriv (GLenum target, GLenum pname, GLint *params); | ||
1083 | void extGlGetBufferPointerv (GLenum target, GLenum pname, GLvoid **params); | ||
1084 | void extGlProvokingVertex(GLenum mode); | ||
1085 | void extGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a); | ||
1086 | void extGlEnableIndexed(GLenum target, GLuint index); | ||
1087 | void extGlDisableIndexed(GLenum target, GLuint index); | ||
1088 | void extGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst); | ||
1089 | void extGlBlendEquationIndexed(GLuint buf, GLenum mode); | ||
1090 | void extGlProgramParameteri(GLuint program, GLenum pname, GLint value); | ||
1091 | |||
1092 | // occlusion query | ||
1093 | void extGlGenQueries(GLsizei n, GLuint *ids); | ||
1094 | void extGlDeleteQueries(GLsizei n, const GLuint *ids); | ||
1095 | GLboolean extGlIsQuery(GLuint id); | ||
1096 | void extGlBeginQuery(GLenum target, GLuint id); | ||
1097 | void extGlEndQuery(GLenum target); | ||
1098 | void extGlGetQueryiv(GLenum target, GLenum pname, GLint *params); | ||
1099 | void extGlGetQueryObjectiv(GLuint id, GLenum pname, GLint *params); | ||
1100 | void extGlGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params); | ||
1101 | |||
1102 | // generic vsync setting method for several extensions | ||
1103 | void extGlSwapInterval(int interval); | ||
1104 | |||
1105 | // blend operations | ||
1106 | void extGlBlendEquation(GLenum mode); | ||
1107 | |||
1108 | // the global feature array | ||
1109 | bool FeatureAvailable[IRR_OpenGL_Feature_Count]; | ||
1110 | |||
1111 | protected: | ||
1112 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
1113 | PFNGLACTIVETEXTUREARBPROC pGlActiveTextureARB; | ||
1114 | PFNGLCLIENTACTIVETEXTUREARBPROC pGlClientActiveTextureARB; | ||
1115 | PFNGLGENPROGRAMSARBPROC pGlGenProgramsARB; | ||
1116 | PFNGLGENPROGRAMSNVPROC pGlGenProgramsNV; | ||
1117 | PFNGLBINDPROGRAMARBPROC pGlBindProgramARB; | ||
1118 | PFNGLBINDPROGRAMNVPROC pGlBindProgramNV; | ||
1119 | PFNGLDELETEPROGRAMSARBPROC pGlDeleteProgramsARB; | ||
1120 | PFNGLDELETEPROGRAMSNVPROC pGlDeleteProgramsNV; | ||
1121 | PFNGLPROGRAMSTRINGARBPROC pGlProgramStringARB; | ||
1122 | PFNGLLOADPROGRAMNVPROC pGlLoadProgramNV; | ||
1123 | PFNGLPROGRAMLOCALPARAMETER4FVARBPROC pGlProgramLocalParameter4fvARB; | ||
1124 | PFNGLCREATESHADEROBJECTARBPROC pGlCreateShaderObjectARB; | ||
1125 | PFNGLSHADERSOURCEARBPROC pGlShaderSourceARB; | ||
1126 | PFNGLCOMPILESHADERARBPROC pGlCompileShaderARB; | ||
1127 | PFNGLCREATEPROGRAMOBJECTARBPROC pGlCreateProgramObjectARB; | ||
1128 | PFNGLATTACHOBJECTARBPROC pGlAttachObjectARB; | ||
1129 | PFNGLLINKPROGRAMARBPROC pGlLinkProgramARB; | ||
1130 | PFNGLUSEPROGRAMOBJECTARBPROC pGlUseProgramObjectARB; | ||
1131 | PFNGLDELETEOBJECTARBPROC pGlDeleteObjectARB; | ||
1132 | PFNGLCREATEPROGRAMPROC pGlCreateProgram; | ||
1133 | PFNGLUSEPROGRAMPROC pGlUseProgram; | ||
1134 | PFNGLDELETEPROGRAMPROC pGlDeleteProgram; | ||
1135 | PFNGLDELETESHADERPROC pGlDeleteShader; | ||
1136 | PFNGLGETATTACHEDOBJECTSARBPROC pGlGetAttachedObjectsARB; | ||
1137 | PFNGLGETATTACHEDSHADERSPROC pGlGetAttachedShaders; | ||
1138 | PFNGLCREATESHADERPROC pGlCreateShader; | ||
1139 | PFNGLSHADERSOURCEPROC pGlShaderSource; | ||
1140 | PFNGLCOMPILESHADERPROC pGlCompileShader; | ||
1141 | PFNGLATTACHSHADERPROC pGlAttachShader; | ||
1142 | PFNGLLINKPROGRAMPROC pGlLinkProgram; | ||
1143 | PFNGLGETINFOLOGARBPROC pGlGetInfoLogARB; | ||
1144 | PFNGLGETSHADERINFOLOGPROC pGlGetShaderInfoLog; | ||
1145 | PFNGLGETPROGRAMINFOLOGPROC pGlGetProgramInfoLog; | ||
1146 | PFNGLGETOBJECTPARAMETERIVARBPROC pGlGetObjectParameterivARB; | ||
1147 | PFNGLGETSHADERIVPROC pGlGetShaderiv; | ||
1148 | PFNGLGETSHADERIVPROC pGlGetProgramiv; | ||
1149 | PFNGLGETUNIFORMLOCATIONARBPROC pGlGetUniformLocationARB; | ||
1150 | PFNGLGETUNIFORMLOCATIONPROC pGlGetUniformLocation; | ||
1151 | PFNGLUNIFORM1FVARBPROC pGlUniform1fvARB; | ||
1152 | PFNGLUNIFORM2FVARBPROC pGlUniform2fvARB; | ||
1153 | PFNGLUNIFORM3FVARBPROC pGlUniform3fvARB; | ||
1154 | PFNGLUNIFORM4FVARBPROC pGlUniform4fvARB; | ||
1155 | PFNGLUNIFORM1IVARBPROC pGlUniform1ivARB; | ||
1156 | PFNGLUNIFORM2IVARBPROC pGlUniform2ivARB; | ||
1157 | PFNGLUNIFORM3IVARBPROC pGlUniform3ivARB; | ||
1158 | PFNGLUNIFORM4IVARBPROC pGlUniform4ivARB; | ||
1159 | PFNGLUNIFORMMATRIX2FVARBPROC pGlUniformMatrix2fvARB; | ||
1160 | PFNGLUNIFORMMATRIX3FVARBPROC pGlUniformMatrix3fvARB; | ||
1161 | PFNGLUNIFORMMATRIX4FVARBPROC pGlUniformMatrix4fvARB; | ||
1162 | PFNGLGETACTIVEUNIFORMARBPROC pGlGetActiveUniformARB; | ||
1163 | PFNGLGETACTIVEUNIFORMPROC pGlGetActiveUniform; | ||
1164 | PFNGLPOINTPARAMETERFARBPROC pGlPointParameterfARB; | ||
1165 | PFNGLPOINTPARAMETERFVARBPROC pGlPointParameterfvARB; | ||
1166 | PFNGLSTENCILFUNCSEPARATEPROC pGlStencilFuncSeparate; | ||
1167 | PFNGLSTENCILOPSEPARATEPROC pGlStencilOpSeparate; | ||
1168 | PFNGLSTENCILFUNCSEPARATEATIPROC pGlStencilFuncSeparateATI; | ||
1169 | PFNGLSTENCILOPSEPARATEATIPROC pGlStencilOpSeparateATI; | ||
1170 | PFNGLCOMPRESSEDTEXIMAGE2DPROC pGlCompressedTexImage2D; | ||
1171 | // ARB framebuffer object | ||
1172 | PFNGLBINDFRAMEBUFFERPROC pGlBindFramebuffer; | ||
1173 | PFNGLDELETEFRAMEBUFFERSPROC pGlDeleteFramebuffers; | ||
1174 | PFNGLGENFRAMEBUFFERSPROC pGlGenFramebuffers; | ||
1175 | PFNGLCHECKFRAMEBUFFERSTATUSPROC pGlCheckFramebufferStatus; | ||
1176 | PFNGLFRAMEBUFFERTEXTURE2DPROC pGlFramebufferTexture2D; | ||
1177 | PFNGLBINDRENDERBUFFERPROC pGlBindRenderbuffer; | ||
1178 | PFNGLDELETERENDERBUFFERSPROC pGlDeleteRenderbuffers; | ||
1179 | PFNGLGENRENDERBUFFERSPROC pGlGenRenderbuffers; | ||
1180 | PFNGLRENDERBUFFERSTORAGEPROC pGlRenderbufferStorage; | ||
1181 | PFNGLFRAMEBUFFERRENDERBUFFERPROC pGlFramebufferRenderbuffer; | ||
1182 | PFNGLGENERATEMIPMAPPROC pGlGenerateMipmap; | ||
1183 | // EXT framebuffer object | ||
1184 | PFNGLBINDFRAMEBUFFEREXTPROC pGlBindFramebufferEXT; | ||
1185 | PFNGLDELETEFRAMEBUFFERSEXTPROC pGlDeleteFramebuffersEXT; | ||
1186 | PFNGLGENFRAMEBUFFERSEXTPROC pGlGenFramebuffersEXT; | ||
1187 | PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC pGlCheckFramebufferStatusEXT; | ||
1188 | PFNGLFRAMEBUFFERTEXTURE2DEXTPROC pGlFramebufferTexture2DEXT; | ||
1189 | PFNGLBINDRENDERBUFFEREXTPROC pGlBindRenderbufferEXT; | ||
1190 | PFNGLDELETERENDERBUFFERSEXTPROC pGlDeleteRenderbuffersEXT; | ||
1191 | PFNGLGENRENDERBUFFERSEXTPROC pGlGenRenderbuffersEXT; | ||
1192 | PFNGLRENDERBUFFERSTORAGEEXTPROC pGlRenderbufferStorageEXT; | ||
1193 | PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC pGlFramebufferRenderbufferEXT; | ||
1194 | PFNGLGENERATEMIPMAPEXTPROC pGlGenerateMipmapEXT; | ||
1195 | PFNGLACTIVESTENCILFACEEXTPROC pGlActiveStencilFaceEXT; | ||
1196 | PFNGLDRAWBUFFERSARBPROC pGlDrawBuffersARB; | ||
1197 | PFNGLDRAWBUFFERSATIPROC pGlDrawBuffersATI; | ||
1198 | PFNGLGENBUFFERSARBPROC pGlGenBuffersARB; | ||
1199 | PFNGLBINDBUFFERARBPROC pGlBindBufferARB; | ||
1200 | PFNGLBUFFERDATAARBPROC pGlBufferDataARB; | ||
1201 | PFNGLDELETEBUFFERSARBPROC pGlDeleteBuffersARB; | ||
1202 | PFNGLBUFFERSUBDATAARBPROC pGlBufferSubDataARB; | ||
1203 | PFNGLGETBUFFERSUBDATAARBPROC pGlGetBufferSubDataARB; | ||
1204 | PFNGLMAPBUFFERARBPROC pGlMapBufferARB; | ||
1205 | PFNGLUNMAPBUFFERARBPROC pGlUnmapBufferARB; | ||
1206 | PFNGLISBUFFERARBPROC pGlIsBufferARB; | ||
1207 | PFNGLGETBUFFERPARAMETERIVARBPROC pGlGetBufferParameterivARB; | ||
1208 | PFNGLGETBUFFERPOINTERVARBPROC pGlGetBufferPointervARB; | ||
1209 | PFNGLPROVOKINGVERTEXPROC pGlProvokingVertexARB; | ||
1210 | PFNGLPROVOKINGVERTEXEXTPROC pGlProvokingVertexEXT; | ||
1211 | PFNGLCOLORMASKINDEXEDEXTPROC pGlColorMaskIndexedEXT; | ||
1212 | PFNGLENABLEINDEXEDEXTPROC pGlEnableIndexedEXT; | ||
1213 | PFNGLDISABLEINDEXEDEXTPROC pGlDisableIndexedEXT; | ||
1214 | PFNGLBLENDFUNCINDEXEDAMDPROC pGlBlendFuncIndexedAMD; | ||
1215 | PFNGLBLENDFUNCIPROC pGlBlendFunciARB; | ||
1216 | PFNGLBLENDEQUATIONINDEXEDAMDPROC pGlBlendEquationIndexedAMD; | ||
1217 | PFNGLBLENDEQUATIONIPROC pGlBlendEquationiARB; | ||
1218 | PFNGLPROGRAMPARAMETERIARBPROC pGlProgramParameteriARB; | ||
1219 | PFNGLPROGRAMPARAMETERIEXTPROC pGlProgramParameteriEXT; | ||
1220 | PFNGLGENQUERIESARBPROC pGlGenQueriesARB; | ||
1221 | PFNGLDELETEQUERIESARBPROC pGlDeleteQueriesARB; | ||
1222 | PFNGLISQUERYARBPROC pGlIsQueryARB; | ||
1223 | PFNGLBEGINQUERYARBPROC pGlBeginQueryARB; | ||
1224 | PFNGLENDQUERYARBPROC pGlEndQueryARB; | ||
1225 | PFNGLGETQUERYIVARBPROC pGlGetQueryivARB; | ||
1226 | PFNGLGETQUERYOBJECTIVARBPROC pGlGetQueryObjectivARB; | ||
1227 | PFNGLGETQUERYOBJECTUIVARBPROC pGlGetQueryObjectuivARB; | ||
1228 | PFNGLGENOCCLUSIONQUERIESNVPROC pGlGenOcclusionQueriesNV; | ||
1229 | PFNGLDELETEOCCLUSIONQUERIESNVPROC pGlDeleteOcclusionQueriesNV; | ||
1230 | PFNGLISOCCLUSIONQUERYNVPROC pGlIsOcclusionQueryNV; | ||
1231 | PFNGLBEGINOCCLUSIONQUERYNVPROC pGlBeginOcclusionQueryNV; | ||
1232 | PFNGLENDOCCLUSIONQUERYNVPROC pGlEndOcclusionQueryNV; | ||
1233 | PFNGLGETOCCLUSIONQUERYIVNVPROC pGlGetOcclusionQueryivNV; | ||
1234 | PFNGLGETOCCLUSIONQUERYUIVNVPROC pGlGetOcclusionQueryuivNV; | ||
1235 | PFNGLBLENDEQUATIONEXTPROC pGlBlendEquationEXT; | ||
1236 | PFNGLBLENDEQUATIONPROC pGlBlendEquation; | ||
1237 | #if defined(WGL_EXT_swap_control) | ||
1238 | PFNWGLSWAPINTERVALEXTPROC pWglSwapIntervalEXT; | ||
1239 | #endif | ||
1240 | #if defined(GLX_SGI_swap_control) | ||
1241 | PFNGLXSWAPINTERVALSGIPROC pGlxSwapIntervalSGI; | ||
1242 | #endif | ||
1243 | #if defined(GLX_EXT_swap_control) | ||
1244 | PFNGLXSWAPINTERVALEXTPROC pGlxSwapIntervalEXT; | ||
1245 | #endif | ||
1246 | #if defined(GLX_MESA_swap_control) | ||
1247 | PFNGLXSWAPINTERVALMESAPROC pGlxSwapIntervalMESA; | ||
1248 | #endif | ||
1249 | #endif | ||
1250 | }; | ||
1251 | |||
1252 | inline void COpenGLExtensionHandler::extGlActiveTexture(GLenum texture) | ||
1253 | { | ||
1254 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1255 | if (MultiTextureExtension && pGlActiveTextureARB) | ||
1256 | pGlActiveTextureARB(texture); | ||
1257 | #else | ||
1258 | if (MultiTextureExtension) | ||
1259 | #ifdef GL_ARB_multitexture | ||
1260 | glActiveTextureARB(texture); | ||
1261 | #else | ||
1262 | glActiveTexture(texture); | ||
1263 | #endif | ||
1264 | #endif | ||
1265 | } | ||
1266 | |||
1267 | inline void COpenGLExtensionHandler::extGlClientActiveTexture(GLenum texture) | ||
1268 | { | ||
1269 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1270 | if (MultiTextureExtension && pGlClientActiveTextureARB) | ||
1271 | pGlClientActiveTextureARB(texture); | ||
1272 | #else | ||
1273 | if (MultiTextureExtension) | ||
1274 | glClientActiveTextureARB(texture); | ||
1275 | #endif | ||
1276 | } | ||
1277 | |||
1278 | inline void COpenGLExtensionHandler::extGlGenPrograms(GLsizei n, GLuint *programs) | ||
1279 | { | ||
1280 | if (programs) | ||
1281 | memset(programs,0,n*sizeof(GLuint)); | ||
1282 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1283 | if (pGlGenProgramsARB) | ||
1284 | pGlGenProgramsARB(n, programs); | ||
1285 | else if (pGlGenProgramsNV) | ||
1286 | pGlGenProgramsNV(n, programs); | ||
1287 | #elif defined(GL_ARB_vertex_program) || defined(GL_ARB_fragment_program) | ||
1288 | glGenProgramsARB(n,programs); | ||
1289 | #elif defined(GL_NV_vertex_program) || defined(GL_NV_fragment_program) | ||
1290 | glGenProgramsNV(n,programs); | ||
1291 | #else | ||
1292 | os::Printer::log("glGenPrograms not supported", ELL_ERROR); | ||
1293 | #endif | ||
1294 | } | ||
1295 | |||
1296 | inline void COpenGLExtensionHandler::extGlBindProgram(GLenum target, GLuint program) | ||
1297 | { | ||
1298 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1299 | if (pGlBindProgramARB) | ||
1300 | pGlBindProgramARB(target, program); | ||
1301 | else if (pGlBindProgramNV) | ||
1302 | pGlBindProgramNV(target, program); | ||
1303 | #elif defined(GL_ARB_vertex_program) || defined(GL_ARB_fragment_program) | ||
1304 | glBindProgramARB(target, program); | ||
1305 | #elif defined(GL_NV_vertex_program) || defined(GL_NV_fragment_program) | ||
1306 | glBindProgramNV(target, program); | ||
1307 | #else | ||
1308 | os::Printer::log("glBindProgram not supported", ELL_ERROR); | ||
1309 | #endif | ||
1310 | } | ||
1311 | |||
1312 | inline void COpenGLExtensionHandler::extGlProgramString(GLenum target, GLenum format, GLsizei len, const GLvoid *string) | ||
1313 | { | ||
1314 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1315 | if (pGlProgramStringARB) | ||
1316 | pGlProgramStringARB(target, format, len, string); | ||
1317 | #elif defined(GL_ARB_vertex_program) || defined(GL_ARB_fragment_program) | ||
1318 | glProgramStringARB(target,format,len,string); | ||
1319 | #else | ||
1320 | os::Printer::log("glProgramString not supported", ELL_ERROR); | ||
1321 | #endif | ||
1322 | } | ||
1323 | |||
1324 | inline void COpenGLExtensionHandler::extGlLoadProgram(GLenum target, GLuint id, GLsizei len, const GLubyte *string) | ||
1325 | { | ||
1326 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1327 | if (pGlLoadProgramNV) | ||
1328 | pGlLoadProgramNV(target, id, len, string); | ||
1329 | #elif defined(GL_NV_vertex_program) || defined(GL_NV_fragment_program) | ||
1330 | glLoadProgramNV(target,id,len,string); | ||
1331 | #else | ||
1332 | os::Printer::log("glLoadProgram not supported", ELL_ERROR); | ||
1333 | #endif | ||
1334 | } | ||
1335 | |||
1336 | inline void COpenGLExtensionHandler::extGlDeletePrograms(GLsizei n, const GLuint *programs) | ||
1337 | { | ||
1338 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1339 | if (pGlDeleteProgramsARB) | ||
1340 | pGlDeleteProgramsARB(n, programs); | ||
1341 | else if (pGlDeleteProgramsNV) | ||
1342 | pGlDeleteProgramsNV(n, programs); | ||
1343 | #elif defined(GL_ARB_vertex_program) || defined(GL_ARB_fragment_program) | ||
1344 | glDeleteProgramsARB(n,programs); | ||
1345 | #elif defined(GL_NV_vertex_program) || defined(GL_NV_fragment_program) | ||
1346 | glDeleteProgramsNV(n,programs); | ||
1347 | #else | ||
1348 | os::Printer::log("glDeletePrograms not supported", ELL_ERROR); | ||
1349 | #endif | ||
1350 | } | ||
1351 | |||
1352 | inline void COpenGLExtensionHandler::extGlProgramLocalParameter4fv(GLenum n, GLuint i, const GLfloat *f) | ||
1353 | { | ||
1354 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1355 | if (pGlProgramLocalParameter4fvARB) | ||
1356 | pGlProgramLocalParameter4fvARB(n,i,f); | ||
1357 | #elif defined(GL_ARB_vertex_program) || defined(GL_ARB_fragment_program) | ||
1358 | glProgramLocalParameter4fvARB(n,i,f); | ||
1359 | #else | ||
1360 | os::Printer::log("glProgramLocalParameter4fv not supported", ELL_ERROR); | ||
1361 | #endif | ||
1362 | } | ||
1363 | |||
1364 | inline GLhandleARB COpenGLExtensionHandler::extGlCreateShaderObject(GLenum shaderType) | ||
1365 | { | ||
1366 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1367 | if (pGlCreateShaderObjectARB) | ||
1368 | return pGlCreateShaderObjectARB(shaderType); | ||
1369 | #elif defined(GL_ARB_shader_objects) | ||
1370 | return glCreateShaderObjectARB(shaderType); | ||
1371 | #else | ||
1372 | os::Printer::log("glCreateShaderObject not supported", ELL_ERROR); | ||
1373 | #endif | ||
1374 | return 0; | ||
1375 | } | ||
1376 | |||
1377 | inline GLuint COpenGLExtensionHandler::extGlCreateShader(GLenum shaderType) | ||
1378 | { | ||
1379 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1380 | if (pGlCreateShader) | ||
1381 | return pGlCreateShader(shaderType); | ||
1382 | #elif defined(GL_VERSION_2_0) | ||
1383 | return glCreateShader(shaderType); | ||
1384 | #else | ||
1385 | os::Printer::log("glCreateShader not supported", ELL_ERROR); | ||
1386 | #endif | ||
1387 | return 0; | ||
1388 | } | ||
1389 | |||
1390 | inline void COpenGLExtensionHandler::extGlShaderSourceARB(GLhandleARB shader, GLsizei numOfStrings, const char **strings, const GLint *lenOfStrings) | ||
1391 | { | ||
1392 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1393 | if (pGlShaderSourceARB) | ||
1394 | pGlShaderSourceARB(shader, numOfStrings, strings, lenOfStrings); | ||
1395 | #elif defined(GL_ARB_shader_objects) | ||
1396 | glShaderSourceARB(shader, numOfStrings, strings, (GLint *)lenOfStrings); | ||
1397 | #else | ||
1398 | os::Printer::log("glShaderSource not supported", ELL_ERROR); | ||
1399 | #endif | ||
1400 | } | ||
1401 | |||
1402 | inline void COpenGLExtensionHandler::extGlShaderSource(GLuint shader, GLsizei numOfStrings, const char **strings, const GLint *lenOfStrings) | ||
1403 | { | ||
1404 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1405 | if (pGlShaderSource) | ||
1406 | pGlShaderSource(shader, numOfStrings, strings, lenOfStrings); | ||
1407 | #elif defined(GL_VERSION_2_0) | ||
1408 | glShaderSource(shader, numOfStrings, strings, (GLint *)lenOfStrings); | ||
1409 | #else | ||
1410 | os::Printer::log("glShaderSource not supported", ELL_ERROR); | ||
1411 | #endif | ||
1412 | } | ||
1413 | |||
1414 | inline void COpenGLExtensionHandler::extGlCompileShaderARB(GLhandleARB shader) | ||
1415 | { | ||
1416 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1417 | if (pGlCompileShaderARB) | ||
1418 | pGlCompileShaderARB(shader); | ||
1419 | #elif defined(GL_ARB_shader_objects) | ||
1420 | glCompileShaderARB(shader); | ||
1421 | #else | ||
1422 | os::Printer::log("glCompileShader not supported", ELL_ERROR); | ||
1423 | #endif | ||
1424 | } | ||
1425 | |||
1426 | inline void COpenGLExtensionHandler::extGlCompileShader(GLuint shader) | ||
1427 | { | ||
1428 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1429 | if (pGlCompileShader) | ||
1430 | pGlCompileShader(shader); | ||
1431 | #elif defined(GL_VERSION_2_0) | ||
1432 | glCompileShader(shader); | ||
1433 | #else | ||
1434 | os::Printer::log("glCompileShader not supported", ELL_ERROR); | ||
1435 | #endif | ||
1436 | } | ||
1437 | |||
1438 | inline GLhandleARB COpenGLExtensionHandler::extGlCreateProgramObject(void) | ||
1439 | { | ||
1440 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1441 | if (pGlCreateProgramObjectARB) | ||
1442 | return pGlCreateProgramObjectARB(); | ||
1443 | #elif defined(GL_ARB_shader_objects) | ||
1444 | return glCreateProgramObjectARB(); | ||
1445 | #else | ||
1446 | os::Printer::log("glCreateProgramObject not supported", ELL_ERROR); | ||
1447 | #endif | ||
1448 | return 0; | ||
1449 | } | ||
1450 | |||
1451 | inline GLuint COpenGLExtensionHandler::extGlCreateProgram(void) | ||
1452 | { | ||
1453 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1454 | if (pGlCreateProgram) | ||
1455 | return pGlCreateProgram(); | ||
1456 | #elif defined(GL_VERSION_2_0) | ||
1457 | return glCreateProgram(); | ||
1458 | #else | ||
1459 | os::Printer::log("glCreateProgram not supported", ELL_ERROR); | ||
1460 | #endif | ||
1461 | return 0; | ||
1462 | } | ||
1463 | |||
1464 | inline void COpenGLExtensionHandler::extGlAttachObject(GLhandleARB program, GLhandleARB shader) | ||
1465 | { | ||
1466 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1467 | if (pGlAttachObjectARB) | ||
1468 | pGlAttachObjectARB(program, shader); | ||
1469 | #elif defined(GL_ARB_shader_objects) | ||
1470 | glAttachObjectARB(program, shader); | ||
1471 | #else | ||
1472 | os::Printer::log("glAttachObject not supported", ELL_ERROR); | ||
1473 | #endif | ||
1474 | } | ||
1475 | |||
1476 | inline void COpenGLExtensionHandler::extGlAttachShader(GLuint program, GLuint shader) | ||
1477 | { | ||
1478 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1479 | if (pGlAttachShader) | ||
1480 | pGlAttachShader(program, shader); | ||
1481 | #elif defined(GL_VERSION_2_0) | ||
1482 | glAttachShader(program, shader); | ||
1483 | #else | ||
1484 | os::Printer::log("glAttachShader not supported", ELL_ERROR); | ||
1485 | #endif | ||
1486 | } | ||
1487 | |||
1488 | inline void COpenGLExtensionHandler::extGlLinkProgramARB(GLhandleARB program) | ||
1489 | { | ||
1490 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1491 | if (pGlLinkProgramARB) | ||
1492 | pGlLinkProgramARB(program); | ||
1493 | #elif defined(GL_ARB_shader_objects) | ||
1494 | glLinkProgramARB(program); | ||
1495 | #else | ||
1496 | os::Printer::log("glLinkProgram not supported", ELL_ERROR); | ||
1497 | #endif | ||
1498 | } | ||
1499 | |||
1500 | inline void COpenGLExtensionHandler::extGlLinkProgram(GLuint program) | ||
1501 | { | ||
1502 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1503 | if (pGlLinkProgram) | ||
1504 | pGlLinkProgram(program); | ||
1505 | #elif defined(GL_VERSION_2_0) | ||
1506 | glLinkProgram(program); | ||
1507 | #else | ||
1508 | os::Printer::log("glLinkProgram not supported", ELL_ERROR); | ||
1509 | #endif | ||
1510 | } | ||
1511 | |||
1512 | inline void COpenGLExtensionHandler::extGlUseProgramObject(GLhandleARB prog) | ||
1513 | { | ||
1514 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1515 | if (pGlUseProgramObjectARB) | ||
1516 | pGlUseProgramObjectARB(prog); | ||
1517 | #elif defined(GL_ARB_shader_objects) | ||
1518 | glUseProgramObjectARB(prog); | ||
1519 | #else | ||
1520 | os::Printer::log("glUseProgramObject not supported", ELL_ERROR); | ||
1521 | #endif | ||
1522 | } | ||
1523 | |||
1524 | inline void COpenGLExtensionHandler::extGlUseProgram(GLuint prog) | ||
1525 | { | ||
1526 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1527 | if (pGlUseProgram) | ||
1528 | pGlUseProgram(prog); | ||
1529 | #elif defined(GL_VERSION_2_0) | ||
1530 | glUseProgram(prog); | ||
1531 | #else | ||
1532 | os::Printer::log("glUseProgram not supported", ELL_ERROR); | ||
1533 | #endif | ||
1534 | } | ||
1535 | |||
1536 | inline void COpenGLExtensionHandler::extGlDeleteObject(GLhandleARB object) | ||
1537 | { | ||
1538 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1539 | if (pGlDeleteObjectARB) | ||
1540 | pGlDeleteObjectARB(object); | ||
1541 | #elif defined(GL_ARB_shader_objects) | ||
1542 | glDeleteObjectARB(object); | ||
1543 | #else | ||
1544 | os::Printer::log("glDeleteObject not supported", ELL_ERROR); | ||
1545 | #endif | ||
1546 | } | ||
1547 | |||
1548 | inline void COpenGLExtensionHandler::extGlDeleteProgram(GLuint object) | ||
1549 | { | ||
1550 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1551 | if (pGlDeleteProgram) | ||
1552 | pGlDeleteProgram(object); | ||
1553 | #elif defined(GL_VERSION_2_0) | ||
1554 | glDeleteProgram(object); | ||
1555 | #else | ||
1556 | os::Printer::log("glDeleteProgram not supported", ELL_ERROR); | ||
1557 | #endif | ||
1558 | } | ||
1559 | |||
1560 | inline void COpenGLExtensionHandler::extGlDeleteShader(GLuint shader) | ||
1561 | { | ||
1562 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1563 | if (pGlDeleteShader) | ||
1564 | pGlDeleteShader(shader); | ||
1565 | #elif defined(GL_VERSION_2_0) | ||
1566 | glDeleteShader(shader); | ||
1567 | #else | ||
1568 | os::Printer::log("glDeleteShader not supported", ELL_ERROR); | ||
1569 | #endif | ||
1570 | } | ||
1571 | |||
1572 | inline void COpenGLExtensionHandler::extGlGetAttachedObjects(GLhandleARB program, GLsizei maxcount, GLsizei* count, GLhandleARB* shaders) | ||
1573 | { | ||
1574 | if (count) | ||
1575 | *count=0; | ||
1576 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1577 | if (pGlGetAttachedObjectsARB) | ||
1578 | pGlGetAttachedObjectsARB(program, maxcount, count, shaders); | ||
1579 | #elif defined(GL_ARB_shader_objects) | ||
1580 | glGetAttachedObjectsARB(program, maxcount, count, shaders); | ||
1581 | #else | ||
1582 | os::Printer::log("glGetAttachedObjects not supported", ELL_ERROR); | ||
1583 | #endif | ||
1584 | } | ||
1585 | |||
1586 | inline void COpenGLExtensionHandler::extGlGetAttachedShaders(GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders) | ||
1587 | { | ||
1588 | if (count) | ||
1589 | *count=0; | ||
1590 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1591 | if (pGlGetAttachedShaders) | ||
1592 | pGlGetAttachedShaders(program, maxcount, count, shaders); | ||
1593 | #elif defined(GL_VERSION_2_0) | ||
1594 | glGetAttachedShaders(program, maxcount, count, shaders); | ||
1595 | #else | ||
1596 | os::Printer::log("glGetAttachedShaders not supported", ELL_ERROR); | ||
1597 | #endif | ||
1598 | } | ||
1599 | |||
1600 | inline void COpenGLExtensionHandler::extGlGetInfoLog(GLhandleARB object, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog) | ||
1601 | { | ||
1602 | if (length) | ||
1603 | *length=0; | ||
1604 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1605 | if (pGlGetInfoLogARB) | ||
1606 | pGlGetInfoLogARB(object, maxLength, length, infoLog); | ||
1607 | #elif defined(GL_ARB_shader_objects) | ||
1608 | glGetInfoLogARB(object, maxLength, length, infoLog); | ||
1609 | #else | ||
1610 | os::Printer::log("glGetInfoLog not supported", ELL_ERROR); | ||
1611 | #endif | ||
1612 | } | ||
1613 | |||
1614 | inline void COpenGLExtensionHandler::extGlGetShaderInfoLog(GLuint shader, GLsizei maxLength, GLsizei *length, GLchar *infoLog) | ||
1615 | { | ||
1616 | if (length) | ||
1617 | *length=0; | ||
1618 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1619 | if (pGlGetShaderInfoLog) | ||
1620 | pGlGetShaderInfoLog(shader, maxLength, length, infoLog); | ||
1621 | #elif defined(GL_VERSION_2_0) | ||
1622 | glGetShaderInfoLog(shader, maxLength, length, infoLog); | ||
1623 | #else | ||
1624 | os::Printer::log("glGetShaderInfoLog not supported", ELL_ERROR); | ||
1625 | #endif | ||
1626 | } | ||
1627 | |||
1628 | inline void COpenGLExtensionHandler::extGlGetProgramInfoLog(GLuint program, GLsizei maxLength, GLsizei *length, GLchar *infoLog) | ||
1629 | { | ||
1630 | if (length) | ||
1631 | *length=0; | ||
1632 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1633 | if (pGlGetProgramInfoLog) | ||
1634 | pGlGetProgramInfoLog(program, maxLength, length, infoLog); | ||
1635 | #elif defined(GL_VERSION_2_0) | ||
1636 | glGetProgramInfoLog(program, maxLength, length, infoLog); | ||
1637 | #else | ||
1638 | os::Printer::log("glGetProgramInfoLog not supported", ELL_ERROR); | ||
1639 | #endif | ||
1640 | } | ||
1641 | |||
1642 | inline void COpenGLExtensionHandler::extGlGetObjectParameteriv(GLhandleARB object, GLenum type, GLint *param) | ||
1643 | { | ||
1644 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1645 | if (pGlGetObjectParameterivARB) | ||
1646 | pGlGetObjectParameterivARB(object, type, param); | ||
1647 | #elif defined(GL_ARB_shader_objects) | ||
1648 | glGetObjectParameterivARB(object, type, param); | ||
1649 | #else | ||
1650 | os::Printer::log("glGetObjectParameteriv not supported", ELL_ERROR); | ||
1651 | #endif | ||
1652 | } | ||
1653 | |||
1654 | inline void COpenGLExtensionHandler::extGlGetShaderiv(GLuint shader, GLenum type, GLint *param) | ||
1655 | { | ||
1656 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1657 | if (pGlGetShaderiv) | ||
1658 | pGlGetShaderiv(shader, type, param); | ||
1659 | #elif defined(GL_VERSION_2_0) | ||
1660 | glGetShaderiv(shader, type, param); | ||
1661 | #else | ||
1662 | os::Printer::log("glGetShaderiv not supported", ELL_ERROR); | ||
1663 | #endif | ||
1664 | } | ||
1665 | |||
1666 | inline void COpenGLExtensionHandler::extGlGetProgramiv(GLuint program, GLenum type, GLint *param) | ||
1667 | { | ||
1668 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1669 | if (pGlGetProgramiv) | ||
1670 | pGlGetProgramiv(program, type, param); | ||
1671 | #elif defined(GL_VERSION_2_0) | ||
1672 | glGetProgramiv(program, type, param); | ||
1673 | #else | ||
1674 | os::Printer::log("glGetProgramiv not supported", ELL_ERROR); | ||
1675 | #endif | ||
1676 | } | ||
1677 | |||
1678 | inline GLint COpenGLExtensionHandler::extGlGetUniformLocationARB(GLhandleARB program, const char *name) | ||
1679 | { | ||
1680 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1681 | if (pGlGetUniformLocationARB) | ||
1682 | return pGlGetUniformLocationARB(program, name); | ||
1683 | #elif defined(GL_ARB_shader_objects) | ||
1684 | return glGetUniformLocationARB(program, name); | ||
1685 | #else | ||
1686 | os::Printer::log("glGetUniformLocation not supported", ELL_ERROR); | ||
1687 | #endif | ||
1688 | return 0; | ||
1689 | } | ||
1690 | |||
1691 | inline GLint COpenGLExtensionHandler::extGlGetUniformLocation(GLuint program, const char *name) | ||
1692 | { | ||
1693 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1694 | if (pGlGetUniformLocation) | ||
1695 | return pGlGetUniformLocation(program, name); | ||
1696 | #elif defined(GL_VERSION_2_0) | ||
1697 | return glGetUniformLocation(program, name); | ||
1698 | #else | ||
1699 | os::Printer::log("glGetUniformLocation not supported", ELL_ERROR); | ||
1700 | #endif | ||
1701 | return 0; | ||
1702 | } | ||
1703 | |||
1704 | inline void COpenGLExtensionHandler::extGlUniform1fv(GLint loc, GLsizei count, const GLfloat *v) | ||
1705 | { | ||
1706 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1707 | if (pGlUniform1fvARB) | ||
1708 | pGlUniform1fvARB(loc, count, v); | ||
1709 | #elif defined(GL_ARB_shader_objects) | ||
1710 | glUniform1fvARB(loc, count, v); | ||
1711 | #else | ||
1712 | os::Printer::log("glUniform1fv not supported", ELL_ERROR); | ||
1713 | #endif | ||
1714 | } | ||
1715 | |||
1716 | inline void COpenGLExtensionHandler::extGlUniform2fv(GLint loc, GLsizei count, const GLfloat *v) | ||
1717 | { | ||
1718 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1719 | if (pGlUniform2fvARB) | ||
1720 | pGlUniform2fvARB(loc, count, v); | ||
1721 | #elif defined(GL_ARB_shader_objects) | ||
1722 | glUniform2fvARB(loc, count, v); | ||
1723 | #else | ||
1724 | os::Printer::log("glUniform2fv not supported", ELL_ERROR); | ||
1725 | #endif | ||
1726 | } | ||
1727 | |||
1728 | inline void COpenGLExtensionHandler::extGlUniform3fv(GLint loc, GLsizei count, const GLfloat *v) | ||
1729 | { | ||
1730 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1731 | if (pGlUniform3fvARB) | ||
1732 | pGlUniform3fvARB(loc, count, v); | ||
1733 | #elif defined(GL_ARB_shader_objects) | ||
1734 | glUniform3fvARB(loc, count, v); | ||
1735 | #else | ||
1736 | os::Printer::log("glUniform3fv not supported", ELL_ERROR); | ||
1737 | #endif | ||
1738 | } | ||
1739 | |||
1740 | inline void COpenGLExtensionHandler::extGlUniform4fv(GLint loc, GLsizei count, const GLfloat *v) | ||
1741 | { | ||
1742 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1743 | if (pGlUniform4fvARB) | ||
1744 | pGlUniform4fvARB(loc, count, v); | ||
1745 | #elif defined(GL_ARB_shader_objects) | ||
1746 | glUniform4fvARB(loc, count, v); | ||
1747 | #else | ||
1748 | os::Printer::log("glUniform4fv not supported", ELL_ERROR); | ||
1749 | #endif | ||
1750 | } | ||
1751 | |||
1752 | inline void COpenGLExtensionHandler::extGlUniform1iv(GLint loc, GLsizei count, const GLint *v) | ||
1753 | { | ||
1754 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1755 | if (pGlUniform1ivARB) | ||
1756 | pGlUniform1ivARB(loc, count, v); | ||
1757 | #elif defined(GL_ARB_shader_objects) | ||
1758 | glUniform1ivARB(loc, count, v); | ||
1759 | #else | ||
1760 | os::Printer::log("glUniform1iv not supported", ELL_ERROR); | ||
1761 | #endif | ||
1762 | } | ||
1763 | |||
1764 | inline void COpenGLExtensionHandler::extGlUniform2iv(GLint loc, GLsizei count, const GLint *v) | ||
1765 | { | ||
1766 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1767 | if (pGlUniform2ivARB) | ||
1768 | pGlUniform2ivARB(loc, count, v); | ||
1769 | #elif defined(GL_ARB_shader_objects) | ||
1770 | glUniform2ivARB(loc, count, v); | ||
1771 | #else | ||
1772 | os::Printer::log("glUniform2iv not supported", ELL_ERROR); | ||
1773 | #endif | ||
1774 | } | ||
1775 | |||
1776 | inline void COpenGLExtensionHandler::extGlUniform3iv(GLint loc, GLsizei count, const GLint *v) | ||
1777 | { | ||
1778 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1779 | if (pGlUniform3ivARB) | ||
1780 | pGlUniform3ivARB(loc, count, v); | ||
1781 | #elif defined(GL_ARB_shader_objects) | ||
1782 | glUniform3ivARB(loc, count, v); | ||
1783 | #else | ||
1784 | os::Printer::log("glUniform3iv not supported", ELL_ERROR); | ||
1785 | #endif | ||
1786 | } | ||
1787 | |||
1788 | inline void COpenGLExtensionHandler::extGlUniform4iv(GLint loc, GLsizei count, const GLint *v) | ||
1789 | { | ||
1790 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1791 | if (pGlUniform4ivARB) | ||
1792 | pGlUniform4ivARB(loc, count, v); | ||
1793 | #elif defined(GL_ARB_shader_objects) | ||
1794 | glUniform4ivARB(loc, count, v); | ||
1795 | #else | ||
1796 | os::Printer::log("glUniform4iv not supported", ELL_ERROR); | ||
1797 | #endif | ||
1798 | } | ||
1799 | |||
1800 | inline void COpenGLExtensionHandler::extGlUniformMatrix2fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v) | ||
1801 | { | ||
1802 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1803 | if (pGlUniformMatrix2fvARB) | ||
1804 | pGlUniformMatrix2fvARB(loc, count, transpose, v); | ||
1805 | #elif defined(GL_ARB_shader_objects) | ||
1806 | glUniformMatrix2fvARB(loc, count, transpose, v); | ||
1807 | #else | ||
1808 | os::Printer::log("glUniformMatrix2fv not supported", ELL_ERROR); | ||
1809 | #endif | ||
1810 | } | ||
1811 | |||
1812 | inline void COpenGLExtensionHandler::extGlUniformMatrix3fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v) | ||
1813 | { | ||
1814 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1815 | if (pGlUniformMatrix3fvARB) | ||
1816 | pGlUniformMatrix3fvARB(loc, count, transpose, v); | ||
1817 | #elif defined(GL_ARB_shader_objects) | ||
1818 | glUniformMatrix3fvARB(loc, count, transpose, v); | ||
1819 | #else | ||
1820 | os::Printer::log("glUniformMatrix3fv not supported", ELL_ERROR); | ||
1821 | #endif | ||
1822 | } | ||
1823 | |||
1824 | inline void COpenGLExtensionHandler::extGlUniformMatrix4fv(GLint loc, GLsizei count, GLboolean transpose, const GLfloat *v) | ||
1825 | { | ||
1826 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1827 | if (pGlUniformMatrix4fvARB) | ||
1828 | pGlUniformMatrix4fvARB(loc, count, transpose, v); | ||
1829 | #elif defined(GL_ARB_shader_objects) | ||
1830 | glUniformMatrix4fvARB(loc, count, transpose, v); | ||
1831 | #else | ||
1832 | os::Printer::log("glUniformMatrix4fv not supported", ELL_ERROR); | ||
1833 | #endif | ||
1834 | } | ||
1835 | |||
1836 | inline void COpenGLExtensionHandler::extGlGetActiveUniformARB(GLhandleARB program, | ||
1837 | GLuint index, GLsizei maxlength, GLsizei *length, | ||
1838 | GLint *size, GLenum *type, GLcharARB *name) | ||
1839 | { | ||
1840 | if (length) | ||
1841 | *length=0; | ||
1842 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1843 | if (pGlGetActiveUniformARB) | ||
1844 | pGlGetActiveUniformARB(program, index, maxlength, length, size, type, name); | ||
1845 | #elif defined(GL_ARB_shader_objects) | ||
1846 | glGetActiveUniformARB(program, index, maxlength, length, size, type, name); | ||
1847 | #else | ||
1848 | os::Printer::log("glGetActiveUniform not supported", ELL_ERROR); | ||
1849 | #endif | ||
1850 | } | ||
1851 | |||
1852 | inline void COpenGLExtensionHandler::extGlGetActiveUniform(GLuint program, | ||
1853 | GLuint index, GLsizei maxlength, GLsizei *length, | ||
1854 | GLint *size, GLenum *type, GLchar *name) | ||
1855 | { | ||
1856 | if (length) | ||
1857 | *length=0; | ||
1858 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1859 | if (pGlGetActiveUniform) | ||
1860 | pGlGetActiveUniform(program, index, maxlength, length, size, type, name); | ||
1861 | #elif defined(GL_VERSION_2_0) | ||
1862 | glGetActiveUniform(program, index, maxlength, length, size, type, name); | ||
1863 | #else | ||
1864 | os::Printer::log("glGetActiveUniform not supported", ELL_ERROR); | ||
1865 | #endif | ||
1866 | } | ||
1867 | |||
1868 | inline void COpenGLExtensionHandler::extGlPointParameterf(GLint loc, GLfloat f) | ||
1869 | { | ||
1870 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1871 | if (pGlPointParameterfARB) | ||
1872 | pGlPointParameterfARB(loc, f); | ||
1873 | #elif defined(GL_ARB_point_parameters) | ||
1874 | glPointParameterfARB(loc, f); | ||
1875 | #else | ||
1876 | os::Printer::log("glPointParameterf not supported", ELL_ERROR); | ||
1877 | #endif | ||
1878 | } | ||
1879 | |||
1880 | inline void COpenGLExtensionHandler::extGlPointParameterfv(GLint loc, const GLfloat *v) | ||
1881 | { | ||
1882 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1883 | if (pGlPointParameterfvARB) | ||
1884 | pGlPointParameterfvARB(loc, v); | ||
1885 | #elif defined(GL_ARB_point_parameters) | ||
1886 | glPointParameterfvARB(loc, v); | ||
1887 | #else | ||
1888 | os::Printer::log("glPointParameterfv not supported", ELL_ERROR); | ||
1889 | #endif | ||
1890 | } | ||
1891 | |||
1892 | inline void COpenGLExtensionHandler::extGlStencilFuncSeparate (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask) | ||
1893 | { | ||
1894 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1895 | if (pGlStencilFuncSeparate) | ||
1896 | pGlStencilFuncSeparate(frontfunc, backfunc, ref, mask); | ||
1897 | else if (pGlStencilFuncSeparateATI) | ||
1898 | pGlStencilFuncSeparateATI(frontfunc, backfunc, ref, mask); | ||
1899 | #elif defined(GL_VERSION_2_0) | ||
1900 | glStencilFuncSeparate(frontfunc, backfunc, ref, mask); | ||
1901 | #elif defined(GL_ATI_separate_stencil) | ||
1902 | glStencilFuncSeparateATI(frontfunc, backfunc, ref, mask); | ||
1903 | #else | ||
1904 | os::Printer::log("glStencilFuncSeparate not supported", ELL_ERROR); | ||
1905 | #endif | ||
1906 | } | ||
1907 | |||
1908 | inline void COpenGLExtensionHandler::extGlStencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass) | ||
1909 | { | ||
1910 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1911 | if (pGlStencilOpSeparate) | ||
1912 | pGlStencilOpSeparate(face, fail, zfail, zpass); | ||
1913 | else if (pGlStencilOpSeparateATI) | ||
1914 | pGlStencilOpSeparateATI(face, fail, zfail, zpass); | ||
1915 | #elif defined(GL_VERSION_2_0) | ||
1916 | glStencilOpSeparate(face, fail, zfail, zpass); | ||
1917 | #elif defined(GL_ATI_separate_stencil) | ||
1918 | glStencilOpSeparateATI(face, fail, zfail, zpass); | ||
1919 | #else | ||
1920 | os::Printer::log("glStencilOpSeparate not supported", ELL_ERROR); | ||
1921 | #endif | ||
1922 | } | ||
1923 | |||
1924 | inline void COpenGLExtensionHandler::extGlCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, | ||
1925 | GLsizei height, GLint border, GLsizei imageSize, const void* data) | ||
1926 | { | ||
1927 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1928 | if (pGlCompressedTexImage2D) | ||
1929 | pGlCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); | ||
1930 | #elif defined(GL_ARB_texture_compression) | ||
1931 | glCompressedTexImage2D(target, level, internalformat, width, height, border, imageSize, data); | ||
1932 | #else | ||
1933 | os::Printer::log("glCompressedTexImage2D not supported", ELL_ERROR); | ||
1934 | #endif | ||
1935 | } | ||
1936 | |||
1937 | inline void COpenGLExtensionHandler::extGlBindFramebuffer(GLenum target, GLuint framebuffer) | ||
1938 | { | ||
1939 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1940 | if (pGlBindFramebuffer) | ||
1941 | pGlBindFramebuffer(target, framebuffer); | ||
1942 | else if (pGlBindFramebufferEXT) | ||
1943 | pGlBindFramebufferEXT(target, framebuffer); | ||
1944 | #elif defined(GL_ARB_framebuffer_object) | ||
1945 | glBindFramebuffer(target, framebuffer); | ||
1946 | #elif defined(GL_EXT_framebuffer_object) | ||
1947 | glBindFramebufferEXT(target, framebuffer); | ||
1948 | #else | ||
1949 | os::Printer::log("glBindFramebuffer not supported", ELL_ERROR); | ||
1950 | #endif | ||
1951 | } | ||
1952 | |||
1953 | inline void COpenGLExtensionHandler::extGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers) | ||
1954 | { | ||
1955 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1956 | if (pGlDeleteFramebuffers) | ||
1957 | pGlDeleteFramebuffers(n, framebuffers); | ||
1958 | else if (pGlDeleteFramebuffersEXT) | ||
1959 | pGlDeleteFramebuffersEXT(n, framebuffers); | ||
1960 | #elif defined(GL_ARB_framebuffer_object) | ||
1961 | glDeleteFramebuffers(n, framebuffers); | ||
1962 | #elif defined(GL_EXT_framebuffer_object) | ||
1963 | glDeleteFramebuffersEXT(n, framebuffers); | ||
1964 | #else | ||
1965 | os::Printer::log("glDeleteFramebuffers not supported", ELL_ERROR); | ||
1966 | #endif | ||
1967 | } | ||
1968 | |||
1969 | inline void COpenGLExtensionHandler::extGlGenFramebuffers(GLsizei n, GLuint *framebuffers) | ||
1970 | { | ||
1971 | if (framebuffers) | ||
1972 | memset(framebuffers,0,n*sizeof(GLuint)); | ||
1973 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1974 | if (pGlGenFramebuffers) | ||
1975 | pGlGenFramebuffers(n, framebuffers); | ||
1976 | else if (pGlGenFramebuffersEXT) | ||
1977 | pGlGenFramebuffersEXT(n, framebuffers); | ||
1978 | #elif defined(GL_ARB_framebuffer_object) | ||
1979 | glGenFramebuffers(n, framebuffers); | ||
1980 | #elif defined(GL_EXT_framebuffer_object) | ||
1981 | glGenFramebuffersEXT(n, framebuffers); | ||
1982 | #else | ||
1983 | os::Printer::log("glGenFramebuffers not supported", ELL_ERROR); | ||
1984 | #endif | ||
1985 | } | ||
1986 | |||
1987 | inline GLenum COpenGLExtensionHandler::extGlCheckFramebufferStatus(GLenum target) | ||
1988 | { | ||
1989 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
1990 | if (pGlCheckFramebufferStatus) | ||
1991 | return pGlCheckFramebufferStatus(target); | ||
1992 | else if (pGlCheckFramebufferStatusEXT) | ||
1993 | return pGlCheckFramebufferStatusEXT(target); | ||
1994 | else | ||
1995 | return 0; | ||
1996 | #elif defined(GL_ARB_framebuffer_object) | ||
1997 | return glCheckFramebufferStatus(target); | ||
1998 | #elif defined(GL_EXT_framebuffer_object) | ||
1999 | return glCheckFramebufferStatusEXT(target); | ||
2000 | #else | ||
2001 | os::Printer::log("glCheckFramebufferStatus not supported", ELL_ERROR); | ||
2002 | return 0; | ||
2003 | #endif | ||
2004 | } | ||
2005 | |||
2006 | inline void COpenGLExtensionHandler::extGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) | ||
2007 | { | ||
2008 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2009 | if (pGlFramebufferTexture2D) | ||
2010 | pGlFramebufferTexture2D(target, attachment, textarget, texture, level); | ||
2011 | else if (pGlFramebufferTexture2DEXT) | ||
2012 | pGlFramebufferTexture2DEXT(target, attachment, textarget, texture, level); | ||
2013 | #elif defined(GL_ARB_framebuffer_object) | ||
2014 | glFramebufferTexture2D(target, attachment, textarget, texture, level); | ||
2015 | #elif defined(GL_EXT_framebuffer_object) | ||
2016 | glFramebufferTexture2DEXT(target, attachment, textarget, texture, level); | ||
2017 | #else | ||
2018 | os::Printer::log("glFramebufferTexture2D not supported", ELL_ERROR); | ||
2019 | #endif | ||
2020 | } | ||
2021 | |||
2022 | inline void COpenGLExtensionHandler::extGlBindRenderbuffer(GLenum target, GLuint renderbuffer) | ||
2023 | { | ||
2024 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2025 | if (pGlBindRenderbuffer) | ||
2026 | pGlBindRenderbuffer(target, renderbuffer); | ||
2027 | else if (pGlBindRenderbufferEXT) | ||
2028 | pGlBindRenderbufferEXT(target, renderbuffer); | ||
2029 | #elif defined(GL_ARB_framebuffer_object) | ||
2030 | glBindRenderbuffer(target, renderbuffer); | ||
2031 | #elif defined(GL_EXT_framebuffer_object) | ||
2032 | glBindRenderbufferEXT(target, renderbuffer); | ||
2033 | #else | ||
2034 | os::Printer::log("glBindRenderbuffer not supported", ELL_ERROR); | ||
2035 | #endif | ||
2036 | } | ||
2037 | |||
2038 | inline void COpenGLExtensionHandler::extGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers) | ||
2039 | { | ||
2040 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2041 | if (pGlDeleteRenderbuffers) | ||
2042 | pGlDeleteRenderbuffers(n, renderbuffers); | ||
2043 | else if (pGlDeleteRenderbuffersEXT) | ||
2044 | pGlDeleteRenderbuffersEXT(n, renderbuffers); | ||
2045 | #elif defined(GL_ARB_framebuffer_object) | ||
2046 | glDeleteRenderbuffers(n, renderbuffers); | ||
2047 | #elif defined(GL_EXT_framebuffer_object) | ||
2048 | glDeleteRenderbuffersEXT(n, renderbuffers); | ||
2049 | #else | ||
2050 | os::Printer::log("glDeleteRenderbuffers not supported", ELL_ERROR); | ||
2051 | #endif | ||
2052 | } | ||
2053 | |||
2054 | inline void COpenGLExtensionHandler::extGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers) | ||
2055 | { | ||
2056 | if (renderbuffers) | ||
2057 | memset(renderbuffers,0,n*sizeof(GLuint)); | ||
2058 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2059 | if (pGlGenRenderbuffers) | ||
2060 | pGlGenRenderbuffers(n, renderbuffers); | ||
2061 | else if (pGlGenRenderbuffersEXT) | ||
2062 | pGlGenRenderbuffersEXT(n, renderbuffers); | ||
2063 | #elif defined(GL_ARB_framebuffer_object) | ||
2064 | glGenRenderbuffers(n, renderbuffers); | ||
2065 | #elif defined(GL_EXT_framebuffer_object) | ||
2066 | glGenRenderbuffersEXT(n, renderbuffers); | ||
2067 | #else | ||
2068 | os::Printer::log("glGenRenderbuffers not supported", ELL_ERROR); | ||
2069 | #endif | ||
2070 | } | ||
2071 | |||
2072 | inline void COpenGLExtensionHandler::extGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height) | ||
2073 | { | ||
2074 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2075 | if (pGlRenderbufferStorage) | ||
2076 | pGlRenderbufferStorage(target, internalformat, width, height); | ||
2077 | else if (pGlRenderbufferStorageEXT) | ||
2078 | pGlRenderbufferStorageEXT(target, internalformat, width, height); | ||
2079 | #elif defined(GL_ARB_framebuffer_object) | ||
2080 | glRenderbufferStorage(target, internalformat, width, height); | ||
2081 | #elif defined(GL_EXT_framebuffer_object) | ||
2082 | glRenderbufferStorageEXT(target, internalformat, width, height); | ||
2083 | #else | ||
2084 | os::Printer::log("glRenderbufferStorage not supported", ELL_ERROR); | ||
2085 | #endif | ||
2086 | } | ||
2087 | |||
2088 | inline void COpenGLExtensionHandler::extGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) | ||
2089 | { | ||
2090 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2091 | if (pGlFramebufferRenderbuffer) | ||
2092 | pGlFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); | ||
2093 | else if (pGlFramebufferRenderbufferEXT) | ||
2094 | pGlFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer); | ||
2095 | #elif defined(GL_ARB_framebuffer_object) | ||
2096 | glFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer); | ||
2097 | #elif defined(GL_EXT_framebuffer_object) | ||
2098 | glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer); | ||
2099 | #else | ||
2100 | os::Printer::log("glFramebufferRenderbuffer not supported", ELL_ERROR); | ||
2101 | #endif | ||
2102 | } | ||
2103 | |||
2104 | inline void COpenGLExtensionHandler::extGlGenerateMipmap(GLenum target) | ||
2105 | { | ||
2106 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2107 | if (pGlGenerateMipmap) | ||
2108 | pGlGenerateMipmap(target); | ||
2109 | else if (pGlGenerateMipmapEXT) | ||
2110 | pGlGenerateMipmapEXT(target); | ||
2111 | #elif defined(GL_ARB_framebuffer_object) | ||
2112 | glGenerateMipmap(target); | ||
2113 | #elif defined(GL_EXT_framebuffer_object) | ||
2114 | glGenerateMipmapEXT(target); | ||
2115 | #else | ||
2116 | os::Printer::log("glGenerateMipmap not supported", ELL_ERROR); | ||
2117 | #endif | ||
2118 | } | ||
2119 | |||
2120 | inline void COpenGLExtensionHandler::extGlActiveStencilFace(GLenum face) | ||
2121 | { | ||
2122 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2123 | if (pGlActiveStencilFaceEXT) | ||
2124 | pGlActiveStencilFaceEXT(face); | ||
2125 | #elif defined(GL_EXT_stencil_two_side) | ||
2126 | glActiveStencilFaceEXT(face); | ||
2127 | #else | ||
2128 | os::Printer::log("glActiveStencilFace not supported", ELL_ERROR); | ||
2129 | #endif | ||
2130 | } | ||
2131 | |||
2132 | inline void COpenGLExtensionHandler::extGlDrawBuffers(GLsizei n, const GLenum *bufs) | ||
2133 | { | ||
2134 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2135 | if (pGlDrawBuffersARB) | ||
2136 | pGlDrawBuffersARB(n, bufs); | ||
2137 | else if (pGlDrawBuffersATI) | ||
2138 | pGlDrawBuffersATI(n, bufs); | ||
2139 | #elif defined(GL_ARB_draw_buffers) | ||
2140 | glDrawBuffersARB(n, bufs); | ||
2141 | #elif defined(GL_ATI_draw_buffers) | ||
2142 | glDrawBuffersATI(n, bufs); | ||
2143 | #else | ||
2144 | os::Printer::log("glDrawBuffers not supported", ELL_ERROR); | ||
2145 | #endif | ||
2146 | } | ||
2147 | |||
2148 | |||
2149 | inline void COpenGLExtensionHandler::extGlGenBuffers(GLsizei n, GLuint *buffers) | ||
2150 | { | ||
2151 | if (buffers) | ||
2152 | memset(buffers,0,n*sizeof(GLuint)); | ||
2153 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2154 | if (pGlGenBuffersARB) | ||
2155 | pGlGenBuffersARB(n, buffers); | ||
2156 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2157 | glGenBuffers(n, buffers); | ||
2158 | #else | ||
2159 | os::Printer::log("glGenBuffers not supported", ELL_ERROR); | ||
2160 | #endif | ||
2161 | } | ||
2162 | |||
2163 | inline void COpenGLExtensionHandler::extGlBindBuffer(GLenum target, GLuint buffer) | ||
2164 | { | ||
2165 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2166 | if (pGlBindBufferARB) | ||
2167 | pGlBindBufferARB(target, buffer); | ||
2168 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2169 | glBindBuffer(target, buffer); | ||
2170 | #else | ||
2171 | os::Printer::log("glBindBuffer not supported", ELL_ERROR); | ||
2172 | #endif | ||
2173 | } | ||
2174 | |||
2175 | inline void COpenGLExtensionHandler::extGlBufferData(GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage) | ||
2176 | { | ||
2177 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2178 | if (pGlBufferDataARB) | ||
2179 | pGlBufferDataARB(target, size, data, usage); | ||
2180 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2181 | glBufferData(target, size, data, usage); | ||
2182 | #else | ||
2183 | os::Printer::log("glBufferData not supported", ELL_ERROR); | ||
2184 | #endif | ||
2185 | } | ||
2186 | |||
2187 | inline void COpenGLExtensionHandler::extGlDeleteBuffers(GLsizei n, const GLuint *buffers) | ||
2188 | { | ||
2189 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2190 | if (pGlDeleteBuffersARB) | ||
2191 | pGlDeleteBuffersARB(n, buffers); | ||
2192 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2193 | glDeleteBuffers(n, buffers); | ||
2194 | #else | ||
2195 | os::Printer::log("glDeleteBuffers not supported", ELL_ERROR); | ||
2196 | #endif | ||
2197 | } | ||
2198 | |||
2199 | inline void COpenGLExtensionHandler::extGlBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data) | ||
2200 | { | ||
2201 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2202 | if (pGlBufferSubDataARB) | ||
2203 | pGlBufferSubDataARB(target, offset, size, data); | ||
2204 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2205 | glBufferSubData(target, offset, size, data); | ||
2206 | #else | ||
2207 | os::Printer::log("glBufferSubData not supported", ELL_ERROR); | ||
2208 | #endif | ||
2209 | } | ||
2210 | |||
2211 | inline void COpenGLExtensionHandler::extGlGetBufferSubData(GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data) | ||
2212 | { | ||
2213 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2214 | if (pGlGetBufferSubDataARB) | ||
2215 | pGlGetBufferSubDataARB(target, offset, size, data); | ||
2216 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2217 | glGetBufferSubData(target, offset, size, data); | ||
2218 | #else | ||
2219 | os::Printer::log("glGetBufferSubData not supported", ELL_ERROR); | ||
2220 | #endif | ||
2221 | } | ||
2222 | |||
2223 | inline void *COpenGLExtensionHandler::extGlMapBuffer(GLenum target, GLenum access) | ||
2224 | { | ||
2225 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2226 | if (pGlMapBufferARB) | ||
2227 | return pGlMapBufferARB(target, access); | ||
2228 | return 0; | ||
2229 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2230 | return glMapBuffer(target, access); | ||
2231 | #else | ||
2232 | os::Printer::log("glMapBuffer not supported", ELL_ERROR); | ||
2233 | return 0; | ||
2234 | #endif | ||
2235 | } | ||
2236 | |||
2237 | inline GLboolean COpenGLExtensionHandler::extGlUnmapBuffer(GLenum target) | ||
2238 | { | ||
2239 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2240 | if (pGlUnmapBufferARB) | ||
2241 | return pGlUnmapBufferARB(target); | ||
2242 | return false; | ||
2243 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2244 | return glUnmapBuffer(target); | ||
2245 | #else | ||
2246 | os::Printer::log("glUnmapBuffer not supported", ELL_ERROR); | ||
2247 | return false; | ||
2248 | #endif | ||
2249 | } | ||
2250 | |||
2251 | inline GLboolean COpenGLExtensionHandler::extGlIsBuffer(GLuint buffer) | ||
2252 | { | ||
2253 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2254 | if (pGlIsBufferARB) | ||
2255 | return pGlIsBufferARB(buffer); | ||
2256 | return false; | ||
2257 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2258 | return glIsBuffer(buffer); | ||
2259 | #else | ||
2260 | os::Printer::log("glDeleteBuffers not supported", ELL_ERROR); | ||
2261 | return false; | ||
2262 | #endif | ||
2263 | } | ||
2264 | |||
2265 | inline void COpenGLExtensionHandler::extGlGetBufferParameteriv(GLenum target, GLenum pname, GLint *params) | ||
2266 | { | ||
2267 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2268 | if (pGlGetBufferParameterivARB) | ||
2269 | pGlGetBufferParameterivARB(target, pname, params); | ||
2270 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2271 | glGetBufferParameteriv(target, pname, params); | ||
2272 | #else | ||
2273 | os::Printer::log("glGetBufferParameteriv not supported", ELL_ERROR); | ||
2274 | #endif | ||
2275 | } | ||
2276 | |||
2277 | inline void COpenGLExtensionHandler::extGlGetBufferPointerv(GLenum target, GLenum pname, GLvoid **params) | ||
2278 | { | ||
2279 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2280 | if (pGlGetBufferPointervARB) | ||
2281 | pGlGetBufferPointervARB(target, pname, params); | ||
2282 | #elif defined(GL_ARB_vertex_buffer_object) | ||
2283 | glGetBufferPointerv(target, pname, params); | ||
2284 | #else | ||
2285 | os::Printer::log("glGetBufferPointerv not supported", ELL_ERROR); | ||
2286 | #endif | ||
2287 | } | ||
2288 | |||
2289 | |||
2290 | inline void COpenGLExtensionHandler::extGlProvokingVertex(GLenum mode) | ||
2291 | { | ||
2292 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2293 | if (FeatureAvailable[IRR_ARB_provoking_vertex] && pGlProvokingVertexARB) | ||
2294 | pGlProvokingVertexARB(mode); | ||
2295 | else if (FeatureAvailable[IRR_EXT_provoking_vertex] && pGlProvokingVertexEXT) | ||
2296 | pGlProvokingVertexEXT(mode); | ||
2297 | #elif defined(GL_ARB_provoking_vertex) | ||
2298 | glProvokingVertex(mode); | ||
2299 | #elif defined(GL_EXT_provoking_vertex) | ||
2300 | glProvokingVertexEXT(mode); | ||
2301 | #else | ||
2302 | os::Printer::log("glProvokingVertex not supported", ELL_ERROR); | ||
2303 | #endif | ||
2304 | } | ||
2305 | |||
2306 | |||
2307 | inline void COpenGLExtensionHandler::extGlColorMaskIndexed(GLuint buf, GLboolean r, GLboolean g, GLboolean b, GLboolean a) | ||
2308 | { | ||
2309 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2310 | if (FeatureAvailable[IRR_EXT_draw_buffers2] && pGlColorMaskIndexedEXT) | ||
2311 | pGlColorMaskIndexedEXT(buf, r, g, b, a); | ||
2312 | #elif defined(GL_EXT_draw_buffers2) | ||
2313 | glColorMaskIndexedEXT(buf, r, g, b, a); | ||
2314 | #else | ||
2315 | os::Printer::log("glColorMaskIndexed not supported", ELL_ERROR); | ||
2316 | #endif | ||
2317 | } | ||
2318 | |||
2319 | |||
2320 | inline void COpenGLExtensionHandler::extGlEnableIndexed(GLenum target, GLuint index) | ||
2321 | { | ||
2322 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2323 | if (FeatureAvailable[IRR_EXT_draw_buffers2] && pGlEnableIndexedEXT) | ||
2324 | pGlEnableIndexedEXT(target, index); | ||
2325 | #elif defined(GL_EXT_draw_buffers2) | ||
2326 | glEnableIndexedEXT(target, index); | ||
2327 | #else | ||
2328 | os::Printer::log("glEnableIndexed not supported", ELL_ERROR); | ||
2329 | #endif | ||
2330 | } | ||
2331 | |||
2332 | inline void COpenGLExtensionHandler::extGlDisableIndexed(GLenum target, GLuint index) | ||
2333 | { | ||
2334 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2335 | if (FeatureAvailable[IRR_EXT_draw_buffers2] && pGlDisableIndexedEXT) | ||
2336 | pGlDisableIndexedEXT(target, index); | ||
2337 | #elif defined(GL_EXT_draw_buffers2) | ||
2338 | glDisableIndexedEXT(target, index); | ||
2339 | #else | ||
2340 | os::Printer::log("glDisableIndexed not supported", ELL_ERROR); | ||
2341 | #endif | ||
2342 | } | ||
2343 | |||
2344 | inline void COpenGLExtensionHandler::extGlBlendFuncIndexed(GLuint buf, GLenum src, GLenum dst) | ||
2345 | { | ||
2346 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2347 | if (FeatureAvailable[IRR_ARB_draw_buffers_blend] && pGlBlendFunciARB) | ||
2348 | pGlBlendFunciARB(buf, src, dst); | ||
2349 | else if (FeatureAvailable[IRR_AMD_draw_buffers_blend] && pGlBlendFuncIndexedAMD) | ||
2350 | pGlBlendFuncIndexedAMD(buf, src, dst); | ||
2351 | #elif defined(GL_ARB_draw_buffers_blend) | ||
2352 | glBlendFunciARB(buf, src, dst); | ||
2353 | #elif defined(GL_AMD_draw_buffers_blend) | ||
2354 | glBlendFuncIndexedAMD(buf, src, dst); | ||
2355 | #else | ||
2356 | os::Printer::log("glBlendFuncIndexed not supported", ELL_ERROR); | ||
2357 | #endif | ||
2358 | } | ||
2359 | |||
2360 | inline void COpenGLExtensionHandler::extGlBlendEquationIndexed(GLuint buf, GLenum mode) | ||
2361 | { | ||
2362 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2363 | if (FeatureAvailable[IRR_ARB_draw_buffers_blend] && pGlBlendEquationiARB) | ||
2364 | pGlBlendEquationiARB(buf, mode); | ||
2365 | else if (FeatureAvailable[IRR_AMD_draw_buffers_blend] && pGlBlendEquationIndexedAMD) | ||
2366 | pGlBlendEquationIndexedAMD(buf, mode); | ||
2367 | #elif defined(GL_ARB_draw_buffers_blend) | ||
2368 | glBlendEquationiARB(buf, mode); | ||
2369 | #elif defined(GL_AMD_draw_buffers_blend) | ||
2370 | glBlendEquationIndexedAMD(buf, mode); | ||
2371 | #else | ||
2372 | os::Printer::log("glBlendEquationIndexed not supported", ELL_ERROR); | ||
2373 | #endif | ||
2374 | } | ||
2375 | |||
2376 | inline void COpenGLExtensionHandler::extGlProgramParameteri(GLuint program, GLenum pname, GLint value) | ||
2377 | { | ||
2378 | #if defined(_IRR_OPENGL_USE_EXTPOINTER_) | ||
2379 | if (queryFeature(EVDF_GEOMETRY_SHADER)) | ||
2380 | { | ||
2381 | if (pGlProgramParameteriARB) | ||
2382 | pGlProgramParameteriARB(program, pname, value); | ||
2383 | else if (pGlProgramParameteriEXT) | ||
2384 | pGlProgramParameteriEXT(program, pname, value); | ||
2385 | } | ||
2386 | #elif defined(GL_ARB_geometry_shader4) | ||
2387 | glProgramParameteriARB(program, pname, value); | ||
2388 | #elif defined(GL_EXT_geometry_shader4) | ||
2389 | glProgramParameteriEXT(program, pname, value); | ||
2390 | #elif defined(GL_NV_geometry_program4) || defined(GL_NV_geometry_shader4) | ||
2391 | glProgramParameteriNV(program, pname, value); | ||
2392 | #else | ||
2393 | os::Printer::log("glProgramParameteri not supported", ELL_ERROR); | ||
2394 | #endif | ||
2395 | } | ||
2396 | |||
2397 | inline void COpenGLExtensionHandler::extGlGenQueries(GLsizei n, GLuint *ids) | ||
2398 | { | ||
2399 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2400 | if (pGlGenQueriesARB) | ||
2401 | pGlGenQueriesARB(n, ids); | ||
2402 | else if (pGlGenOcclusionQueriesNV) | ||
2403 | pGlGenOcclusionQueriesNV(n, ids); | ||
2404 | #elif defined(GL_ARB_occlusion_query) | ||
2405 | glGenQueriesARB(n, ids); | ||
2406 | #elif defined(GL_NV_occlusion_query) | ||
2407 | glGenOcclusionQueriesNV(n, ids); | ||
2408 | #else | ||
2409 | os::Printer::log("glGenQueries not supported", ELL_ERROR); | ||
2410 | #endif | ||
2411 | } | ||
2412 | |||
2413 | inline void COpenGLExtensionHandler::extGlDeleteQueries(GLsizei n, const GLuint *ids) | ||
2414 | { | ||
2415 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2416 | if (pGlDeleteQueriesARB) | ||
2417 | pGlDeleteQueriesARB(n, ids); | ||
2418 | else if (pGlDeleteOcclusionQueriesNV) | ||
2419 | pGlDeleteOcclusionQueriesNV(n, ids); | ||
2420 | #elif defined(GL_ARB_occlusion_query) | ||
2421 | glDeleteQueriesARB(n, ids); | ||
2422 | #elif defined(GL_NV_occlusion_query) | ||
2423 | glDeleteOcclusionQueriesNV(n, ids); | ||
2424 | #else | ||
2425 | os::Printer::log("glDeleteQueries not supported", ELL_ERROR); | ||
2426 | #endif | ||
2427 | } | ||
2428 | |||
2429 | inline GLboolean COpenGLExtensionHandler::extGlIsQuery(GLuint id) | ||
2430 | { | ||
2431 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2432 | if (pGlIsQueryARB) | ||
2433 | return pGlIsQueryARB(id); | ||
2434 | else if (pGlIsOcclusionQueryNV) | ||
2435 | return pGlIsOcclusionQueryNV(id); | ||
2436 | return false; | ||
2437 | #elif defined(GL_ARB_occlusion_query) | ||
2438 | return glIsQueryARB(id); | ||
2439 | #elif defined(GL_NV_occlusion_query) | ||
2440 | return glIsOcclusionQueryNV(id); | ||
2441 | #else | ||
2442 | return false; | ||
2443 | #endif | ||
2444 | } | ||
2445 | |||
2446 | inline void COpenGLExtensionHandler::extGlBeginQuery(GLenum target, GLuint id) | ||
2447 | { | ||
2448 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2449 | if (pGlBeginQueryARB) | ||
2450 | pGlBeginQueryARB(target, id); | ||
2451 | else if (pGlBeginOcclusionQueryNV) | ||
2452 | pGlBeginOcclusionQueryNV(id); | ||
2453 | #elif defined(GL_ARB_occlusion_query) | ||
2454 | glBeginQueryARB(target, id); | ||
2455 | #elif defined(GL_NV_occlusion_query) | ||
2456 | glBeginOcclusionQueryNV(id); | ||
2457 | #else | ||
2458 | os::Printer::log("glBeginQuery not supported", ELL_ERROR); | ||
2459 | #endif | ||
2460 | } | ||
2461 | |||
2462 | inline void COpenGLExtensionHandler::extGlEndQuery(GLenum target) | ||
2463 | { | ||
2464 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2465 | if (pGlEndQueryARB) | ||
2466 | pGlEndQueryARB(target); | ||
2467 | else if (pGlEndOcclusionQueryNV) | ||
2468 | pGlEndOcclusionQueryNV(); | ||
2469 | #elif defined(GL_ARB_occlusion_query) | ||
2470 | glEndQueryARB(target); | ||
2471 | #elif defined(GL_NV_occlusion_query) | ||
2472 | glEndOcclusionQueryNV(); | ||
2473 | #else | ||
2474 | os::Printer::log("glEndQuery not supported", ELL_ERROR); | ||
2475 | #endif | ||
2476 | } | ||
2477 | |||
2478 | inline void COpenGLExtensionHandler::extGlGetQueryiv(GLenum target, GLenum pname, GLint *params) | ||
2479 | { | ||
2480 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2481 | if (pGlGetQueryivARB) | ||
2482 | pGlGetQueryivARB(target, pname, params); | ||
2483 | #elif defined(GL_ARB_occlusion_query) | ||
2484 | glGetQueryivARB(target, pname, params); | ||
2485 | #else | ||
2486 | os::Printer::log("glGetQueryivARB not supported", ELL_ERROR); | ||
2487 | #endif | ||
2488 | } | ||
2489 | |||
2490 | inline void COpenGLExtensionHandler::extGlGetQueryObjectiv(GLuint id, GLenum pname, GLint *params) | ||
2491 | { | ||
2492 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2493 | if (pGlGetQueryObjectivARB) | ||
2494 | pGlGetQueryObjectivARB(id, pname, params); | ||
2495 | else if (pGlGetOcclusionQueryivNV) | ||
2496 | pGlGetOcclusionQueryivNV(id, pname, params); | ||
2497 | #elif defined(GL_ARB_occlusion_query) | ||
2498 | glGetQueryObjectivARB(id, pname, params); | ||
2499 | #elif defined(GL_NV_occlusion_query) | ||
2500 | glGetOcclusionQueryivNV(id, pname, params); | ||
2501 | #else | ||
2502 | os::Printer::log("glGetQueryObjectiv not supported", ELL_ERROR); | ||
2503 | #endif | ||
2504 | } | ||
2505 | |||
2506 | inline void COpenGLExtensionHandler::extGlGetQueryObjectuiv(GLuint id, GLenum pname, GLuint *params) | ||
2507 | { | ||
2508 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2509 | if (pGlGetQueryObjectuivARB) | ||
2510 | pGlGetQueryObjectuivARB(id, pname, params); | ||
2511 | else if (pGlGetOcclusionQueryuivNV) | ||
2512 | pGlGetOcclusionQueryuivNV(id, pname, params); | ||
2513 | #elif defined(GL_ARB_occlusion_query) | ||
2514 | glGetQueryObjectuivARB(id, pname, params); | ||
2515 | #elif defined(GL_NV_occlusion_query) | ||
2516 | glGetOcclusionQueryuivNV(id, pname, params); | ||
2517 | #else | ||
2518 | os::Printer::log("glGetQueryObjectuiv not supported", ELL_ERROR); | ||
2519 | #endif | ||
2520 | } | ||
2521 | |||
2522 | inline void COpenGLExtensionHandler::extGlSwapInterval(int interval) | ||
2523 | { | ||
2524 | // we have wglext, so try to use that | ||
2525 | #if defined(_IRR_WINDOWS_API_) && defined(_IRR_COMPILE_WITH_WINDOWS_DEVICE_) | ||
2526 | #ifdef WGL_EXT_swap_control | ||
2527 | if (pWglSwapIntervalEXT) | ||
2528 | pWglSwapIntervalEXT(interval); | ||
2529 | #endif | ||
2530 | #endif | ||
2531 | #ifdef _IRR_COMPILE_WITH_X11_DEVICE_ | ||
2532 | //TODO: Check GLX_EXT_swap_control and GLX_MESA_swap_control | ||
2533 | #ifdef GLX_SGI_swap_control | ||
2534 | // does not work with interval==0 | ||
2535 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2536 | if (interval && pGlxSwapIntervalSGI) | ||
2537 | pGlxSwapIntervalSGI(interval); | ||
2538 | #else | ||
2539 | if (interval) | ||
2540 | glXSwapIntervalSGI(interval); | ||
2541 | #endif | ||
2542 | #elif defined(GLX_EXT_swap_control) | ||
2543 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2544 | Display *dpy = glXGetCurrentDisplay(); | ||
2545 | GLXDrawable drawable = glXGetCurrentDrawable(); | ||
2546 | |||
2547 | if (pGlxSwapIntervalEXT) | ||
2548 | pGlxSwapIntervalEXT(dpy, drawable, interval); | ||
2549 | #else | ||
2550 | pGlXSwapIntervalEXT(dpy, drawable, interval); | ||
2551 | #endif | ||
2552 | #elif defined(GLX_MESA_swap_control) | ||
2553 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2554 | if (pGlxSwapIntervalMESA) | ||
2555 | pGlxSwapIntervalMESA(interval); | ||
2556 | #else | ||
2557 | pGlXSwapIntervalMESA(interval); | ||
2558 | #endif | ||
2559 | #endif | ||
2560 | #endif | ||
2561 | } | ||
2562 | |||
2563 | inline void COpenGLExtensionHandler::extGlBlendEquation(GLenum mode) | ||
2564 | { | ||
2565 | #ifdef _IRR_OPENGL_USE_EXTPOINTER_ | ||
2566 | if (pGlBlendEquation) | ||
2567 | pGlBlendEquation(mode); | ||
2568 | else if (pGlBlendEquationEXT) | ||
2569 | pGlBlendEquationEXT(mode); | ||
2570 | #elif defined(GL_EXT_blend_minmax) || defined(GL_EXT_blend_subtract) || defined(GL_EXT_blend_logic_op) | ||
2571 | glBlendEquationEXT(mode); | ||
2572 | #elif defined(GL_VERSION_1_2) | ||
2573 | glBlendEquation(mode); | ||
2574 | #else | ||
2575 | os::Printer::log("glBlendEquation not supported", ELL_ERROR); | ||
2576 | #endif | ||
2577 | } | ||
2578 | |||
2579 | |||
2580 | } | ||
2581 | } | ||
2582 | |||
2583 | #endif | ||
2584 | |||
2585 | #endif | ||
2586 | |||