COpenGLExtensionHandler.h 81 KB

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