zgl_glx_wgl.pas 77 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473
  1. (*
  2. * Copyright (c) 2022 Serge - SSW
  3. *
  4. * This software is provided 'as-is', without any express or
  5. * implied warranty. In no event will the authors be held
  6. * liable for any damages arising from the use of this software.
  7. *
  8. * Permission is granted to anyone to use this software for any purpose,
  9. * including commercial applications, and to alter it and redistribute
  10. * it freely, subject to the following restrictions:
  11. *
  12. * 1. The origin of this software must not be misrepresented;
  13. * you must not claim that you wrote the original software.
  14. * If you use this software in a product, an acknowledgment
  15. * in the product documentation would be appreciated but
  16. * is not required.
  17. *
  18. * 2. Altered source versions must be plainly marked as such,
  19. * and must not be misrepresented as being the original software.
  20. *
  21. * 3. This notice may not be removed or altered from any
  22. * source distribution.
  23. *)
  24. unit zgl_glx_wgl;
  25. {$I zgl_config.cfg}
  26. {$I GLdefine.cfg}
  27. interface
  28. uses
  29. {$IfDef LINUX}
  30. X,
  31. XLib,
  32. XUtil,
  33. {$EndIf}
  34. {$IfDef WINDOWS}
  35. Windows,
  36. {$EndIf}
  37. // zgl_opengl_all,
  38. zgl_gltypeconst;
  39. {$IfDef WINDOWS}
  40. var
  41. WGL_ARB_buffer_region: Boolean;
  42. WGL_ARB_context_flush_control: Boolean;
  43. WGL_ARB_create_context: Boolean;
  44. WGL_ARB_create_context_no_error: Boolean;
  45. WGL_ARB_create_context_profile: Boolean;
  46. WGL_ARB_create_context_robustness: Boolean;
  47. WGL_ARB_make_current_read: Boolean;
  48. WGL_ARB_extensions_string: Boolean;
  49. WGL_ARB_framebuffer_sRGB: Boolean;
  50. WGL_ARB_multisample: Boolean;
  51. WGL_ARB_pbuffer: Boolean;
  52. WGL_ARB_pixel_format: Boolean;
  53. WGL_ARB_pixel_format_float: Boolean;
  54. WGL_ARB_render_texture: Boolean;
  55. WGL_ARB_robustness_application_isolation: Boolean;
  56. WGL_ARB_robustness_share_group_isolation: Boolean;
  57. WGL_3DFX_multisample: Boolean;
  58. WGL_3DL_stereo_control: Boolean;
  59. WGL_AMD_gpu_association: Boolean;
  60. WGL_ATI_pixel_format_float: Boolean;
  61. WGL_ATI_render_texture_rectangle: Boolean;
  62. WGL_EXT_colorspace: Boolean;
  63. WGL_EXT_create_context_es2_profile: Boolean;
  64. WGL_EXT_create_context_es_profile: Boolean;
  65. WGL_EXT_depth_float: Boolean;
  66. WGL_EXT_display_color_table: Boolean;
  67. WGL_EXT_framebuffer_sRGB: Boolean;
  68. WGL_EXT_make_current_read: Boolean;
  69. WGL_EXT_multisample: Boolean;
  70. WGL_EXT_pbuffer: Boolean;
  71. WGL_EXT_extensions_string: Boolean;
  72. WGL_EXT_pixel_format: Boolean;
  73. WGL_EXT_pixel_format_packed_float: Boolean;
  74. WGL_EXT_swap_control: Boolean;
  75. WGL_EXT_swap_control_tear: Boolean;
  76. WGL_I3D_digital_video_control: Boolean;
  77. WGL_I3D_gamma: Boolean;
  78. WGL_I3D_genlock: Boolean;
  79. WGL_I3D_image_buffer: Boolean;
  80. WGL_I3D_swap_frame_lock: Boolean;
  81. WGL_I3D_swap_frame_usage: Boolean;
  82. WGL_NV_DX_interop: Boolean;
  83. WGL_NV_DX_interop2: Boolean;
  84. WGL_NV_copy_image: Boolean;
  85. WGL_NV_delay_before_swap: Boolean;
  86. WGL_NV_float_buffer: Boolean;
  87. WGL_NV_gpu_affinity: Boolean;
  88. WGL_NV_multigpu_context: Boolean;
  89. WGL_NV_multisample_coverage: Boolean;
  90. WGL_NV_present_video: Boolean;
  91. WGL_NV_render_depth_texture: Boolean;
  92. WGL_NV_render_texture_rectangle: Boolean;
  93. WGL_NV_swap_group: Boolean;
  94. WGL_NV_vertex_array_range: Boolean;
  95. WGL_NV_video_capture: Boolean;
  96. WGL_NV_video_output: Boolean;
  97. WGL_OML_sync_control: Boolean;
  98. { wgl Windows OpenGL helper functions }
  99. {$IfNDef FPC}
  100. function wglGetProcAddress(ProcName: LPCSTR): Pointer; stdcall; external 'opengl32.dll';
  101. {$IfDef USE_FULL_WGL}
  102. var
  103. (* WGL_VERSION_1_0 *)
  104. wglCopyContext: function(glrcSrc: HGLRC; glrcDst: HGLRC; mask: UINT): WINBOOL; stdcall;
  105. wglCreateContext: function(hdc: HDC): HGLRC; stdcall;
  106. wglCreateLayerContext: function(hdc: HDC; iLayerPlane: longint): HGLRC; stdcall;
  107. wglDeleteContext: function(glrc: HGLRC): WINBOOL; stdcall;
  108. wglDescribeLayerPlane: function(DC: HDC; iPixelFormat: longint; iLayerPane: longint; nBytes: UINT; plpd: LPLAYERPLANEDESCRIPTOR): WINBOOL; stdcall;
  109. wglGetCurrentContext: function: HGLRC; stdcall;
  110. wglGetCurrentDC: function: HDC; stdcall;
  111. wglGetLayerPaletteEntries: function(DC: HDC; iLayerPlane: longint; iStart: longint; cEntries: longint; var cr: COLORREF): longint; stdcall;
  112. wglMakeCurrent: function(DC: HDC; glrc: HGLRC): WINBOOL; stdcall;
  113. wglRealizeLayerPalette: function(DC: HDC; iLayerPlane: longint; bRealize: WINBOOL): WINBOOL; stdcall;
  114. wglSetLayerPaletteEntries: function(DC: HDC; iLayerPlane: longint; iStart: longint; cEntries: longint; var cr: COLORREF): longint; stdcall;
  115. wglShareLists: function(glrc1: HGLRC; glrc2: HGLRC): WINBOOL; stdcall;
  116. wglSwapLayerBuffers: function(DC: HDC; fuPlanes: UINT): WINBOOL; stdcall;
  117. { откуда взялась эта функция? Нет ни каких указаний на неё - wglSwapMultipleBuffers: function(p1: UINT; const p2: PWGLSWAP): DWORD; stdcall; }
  118. wglUseFontBitmaps: function(DC: HDC; first: DWORD; count: DWORD; listbase: DWORD):WINBOOL; stdcall;
  119. wglUseFontBitmapsW: function(DC: HDC; first: DWORD; count: DWORD; listbase: DWORD):WINBOOL; stdcall;
  120. wglUseFontBitmapsA: function(DC: HDC; first: DWORD; count: DWORD; listbase: DWORD):WINBOOL; stdcall;
  121. wglUseFontOutlines: function(DC: HDC; first: DWORD; count: DWORD; listbase: DWORD; deviation: Single; extrusion: Single; format: longint; lpgmf: LPGLYPHMETRICSFLOAT): WINBOOL; stdcall;
  122. wglUseFontOutlinesA: function(DC: HDC; first: DWORD; count: DWORD; listbase: DWORD; deviation: Single; extrusion: Single; format: longint; lpgmf: LPGLYPHMETRICSFLOAT): WINBOOL; stdcall;
  123. wglUseFontOutlinesW: function(DC: HDC; first: DWORD; count: DWORD; listbase: DWORD; deviation: Single; extrusion: Single; format: longint; lpgmf: LPGLYPHMETRICSFLOAT): WINBOOL; stdcall;
  124. {$EndIf}
  125. {$EndIf}
  126. var
  127. {$if defined(WGL_ARB_pixel_format) or defined(WGL_EXT_pixel_format)} // WGL_ARB_pixel_format or WGL_EXT_pixel_format => WGL_ARB_pixel_format
  128. wglGetPixelFormatAttribivARB: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; const piAttributes: PGLint; piValues: PGLint): Boolean; stdcall;
  129. wglGetPixelFormatAttribfvARB: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; const piAttributes: PGLint; pfValues: PGLfloat): Boolean; stdcall;
  130. wglChoosePixelFormatARB: function(hdc: HDC; const piAttribIList: PGLint; const pfAttribFList: PGLfloat; nMaxFormats: GLuint; piFormats: PGLint; nNumFormats: PGLuint): BOOL; stdcall;
  131. {$IfEnd}
  132. {$ifdef WGL_EXT_swap_control}
  133. wglSwapIntervalEXT: function(interval: GLint): Boolean; stdcall;
  134. wglGetSwapIntervalEXT: function(): GLint; stdcall;
  135. {$EndIf}
  136. {$If defined(WGL_ARB_pbuffer) or defined(WGL_EXT_pbuffer)} // (WGL_ARB_pbuffer or WGL_EXT_pbuffer) => WGL_ARB_pbuffer
  137. wglCreatePbufferARB: function(hDC: HDC; iPixelFormat: GLint; iWidth: GLint; iHeight: GLint; const piAttribList: PGLint): THANDLE; stdcall;
  138. wglGetPbufferDCARB: function(hPbuffer: THandle): HDC; stdcall;
  139. wglReleasePbufferDCARB: function(hPbuffer: THandle; hDC: HDC): GLint; stdcall;
  140. wglDestroyPbufferARB: function(hPbuffer: THandle): Boolean; stdcall;
  141. // вернуть значения ширины, высоты или потеря пиксельного буфера.
  142. wglQueryPbufferARB: function(hPbuffer: THandle; iAttribute: GLint; piValue: PGLint): Boolean; stdcall;
  143. {$IfEnd}
  144. {$If defined(WGL_ARB_extensions_string) or defined(WGL_EXT_extensions_string)}
  145. // это полный кабздец... для каждого окна эта функция может возвращать разные значения!!!
  146. // это означает, что создавая новое окно, вы заново должны переопределить эту функцию (так же и с другими, которые запрашивают окно).
  147. wglGetExtensionsStringARB: function(hdc: HDC): PAnsiChar; stdcall;
  148. {$IfEnd}
  149. {$ifdef WGL_ARB_buffer_region}
  150. wglCreateBufferRegionARB: function(hDC: HDC; iLayerPlane: GLint; uType: GLuint): THandle; stdcall;
  151. wglDeleteBufferRegionARB: procedure(hRegion: THandle); stdcall;
  152. wglSaveBufferRegionARB: function(hRegion: THandle; x: GLint; y: GLint; width: GLint; height: GLint): Boolean; stdcall;
  153. wglRestoreBufferRegionARB: function(hRegion: THandle; x: GLint; y: GLint; width: GLint; height: GLint; xSrc: GLint; ySrc: GLint): Boolean; stdcall;
  154. {$EndIf}
  155. {$if defined(WGL_ARB_make_current_read) or defined(WGL_EXT_make_current_read)}
  156. wglMakeContextCurrentARB: function(hDrawDC: HDC; hReadDC: HDC; hglrc: HGLRC): Boolean; stdcall;
  157. wglGetCurrentReadDCARB: function(): HDC; stdcall;
  158. {$IfEnd}
  159. // WGL_ARB_color_buffer_float - удалено???
  160. // wglClampColorARB: procedure(target: GLenum; clamp: GLenum); stdcall;
  161. {$ifdef WGL_ARB_render_texture}
  162. wglBindTexImageARB: function(hPbuffer: THandle; iBuffer: GLint): Boolean; stdcall;
  163. wglReleaseTexImageARB: function(hPbuffer: THandle; iBuffer: GLint): Boolean; stdcall;
  164. wglSetPbufferAttribARB: function(hPbuffer: THandle; const piAttribList: PGLint): Boolean; stdcall;
  165. {$EndIf}
  166. {$ifdef WGL_ARB_create_context}
  167. wglCreateContextAttribsARB: function(hDC: HDC; hShareContext: HGLRC; const attribList: PGLint): HGLRC; stdcall;
  168. {$EndIf}
  169. {$IfDef WGL_AMD_gpu_association}
  170. wglGetGPUIDsAMD: function(maxCount: Cardinal; ids: PCardinal): Cardinal; stdcall;
  171. wglGetGPUInfoAMD: function(id: Cardinal; property_: Integer; dataType: GLenum; size: Cardinal; data: Pointer): Integer; stdcall;
  172. wglGetContextGPUIDAMD: function(hglrc: HGLRC): Cardinal; stdcall;
  173. wglCreateAssociatedContextAMD: function(id: Cardinal): HGLRC; stdcall;
  174. wglCreateAssociatedContextAttribsAMD: function(id: Cardinal; hShareContext: HGLRC; const attribList: PInteger): HGLRC; stdcall;
  175. wglDeleteAssociatedContextAMD: function(hglrc: HGLRC): Boolean; stdcall;
  176. wglMakeAssociatedContextCurrentAMD: function(hglrc: HGLRC): Boolean; stdcall;
  177. wglGetCurrentAssociatedContextAMD: function(): HGLRC; stdcall;
  178. wglBlitContextFramebufferAMD: procedure(dstCtx: HGLRC; srcX0: GLint; srcY0: GLint; srcX1: GLint; srcY1: GLint; dstX0: GLint; dstY0: GLint; dstX1: GLint; dstY1: GLint; mask: GLbitfield; filter: GLenum); stdcall;
  179. {$EndIf}
  180. {$IfDef WGL_EXT_display_color_table}
  181. wglCreateDisplayColorTableEXT: function(id: GLushort): GLboolean; stdcall;
  182. wglLoadDisplayColorTableEXT: function(const table: PGLushort; length: GLuint): GLboolean; stdcall;
  183. wglBindDisplayColorTableEXT: function(id: GLushort): GLboolean; stdcall;
  184. wglDestroyDisplayColorTableEXT: procedure(id: GLushort); stdcall;
  185. {$EndIf}
  186. {$IfDef WGL_EXT_extensions_string}
  187. // wglGetExtensionsStringEXT: function(): PAnsiChar{PChar}; stdcall;
  188. {$EndIf}
  189. {$IfDef WGL_EXT_make_current_read}
  190. // wglMakeContextCurrentEXT: function(hDrawDC: HDC; hReadDC: HDC; hglrc: HGLRC): Boolean; stdcall;
  191. // wglGetCurrentReadDCEXT: function(): HDC; stdcall;
  192. {$EndIf}
  193. {$ifdef WGL_EXT_pbuffer}
  194. // wglCreatePbufferEXT: function(hDC: HDC; iPixelFormat: GLint; iWidth: GLint; iHeight: GLint; const piAttribList: PGLint): HPBUFFEREXT; stdcall;
  195. // wglGetPbufferDCEXT: function(hPbuffer: HPBUFFEREXT): HDC; stdcall;
  196. // wglReleasePbufferDCEXT: function(hPbuffer: HPBUFFEREXT; hDC: HDC): GLint; stdcall;
  197. // wglDestroyPbufferEXT: function(hPbuffer: HPBUFFEREXT): Boolean; stdcall;
  198. // wglQueryPbufferEXT: function(hPbuffer: HPBUFFEREXT; iAttribute: GLint; piValue: PGLint): Boolean; stdcall;
  199. {$EndIf}
  200. {$IfDef WGL_EXT_pixel_format}
  201. // wglGetPixelFormatAttribivEXT: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; piAttributes: PGLint; piValues: PGLint): Boolean; stdcall;
  202. // wglGetPixelFormatAttribfvEXT: function(hdc: HDC; iPixelFormat: GLint; iLayerPlane: GLint; nAttributes: GLuint; piAttributes: PGLint; pfValues: PGLfloat): Boolean; stdcall;
  203. // wglChoosePixelFormatEXT: function(hdc: HDC; const piAttribIList: PGLint; const pfAttribFList: PGLfloat; nMaxFormats: GLuint; piFormats: PGLint; nNumFormats: PGLuint): Boolean; stdcall;
  204. {$EndIf}
  205. {$IfDef WGL_I3D_digital_video_control}
  206. wglGetDigitalVideoParametersI3D: function(hDC: HDC; iAttribute: GLint; piValue: PGLint): Boolean; stdcall;
  207. wglSetDigitalVideoParametersI3D: function(hDC: HDC; iAttribute: GLint; const piValue: PGLint): Boolean; stdcall;
  208. {$EndIf}
  209. {$IfDef WGL_I3D_gamma}
  210. wglGetGammaTableParametersI3D: function(hDC: HDC; iAttribute: GLint; piValue: PGLint): Boolean; stdcall;
  211. wglSetGammaTableParametersI3D: function(hDC: HDC; iAttribute: GLint; const piValue: PGLint): Boolean; stdcall;
  212. wglGetGammaTableI3D: function(hDC: HDC; iEntries: GLint; puRed: PGLushort; puGreen: PGLushort; puBlue: PGLushort): Boolean; stdcall;
  213. wglSetGammaTableI3D: function(hDC: HDC; iEntries: GLint; const puRed: PGLushort; const puGreen: PGLushort; const puBlue: PGLushort): Boolean; stdcall;
  214. {$EndIf}
  215. {$IfDef WGL_I3D_genlock}
  216. wglEnableGenlockI3D: function(hDC: HDC): Boolean; stdcall;
  217. wglDisableGenlockI3D: function(hDC: HDC): Boolean; stdcall;
  218. wglIsEnabledGenlockI3D: function(hDC: HDC; pFlag: Boolean): Boolean; stdcall;
  219. wglGenlockSourceI3D: function(hDC: HDC; uSource: GLuint): Boolean; stdcall;
  220. wglGetGenlockSourceI3D: function(hDC: HDC; uSource: PGLuint): Boolean; stdcall;
  221. wglGenlockSourceEdgeI3D: function(hDC: HDC; uEdge: GLuint): Boolean; stdcall;
  222. wglGetGenlockSourceEdgeI3D: function(hDC: HDC; uEdge: PGLuint): Boolean; stdcall;
  223. wglGenlockSampleRateI3D: function(hDC: HDC; uRate: GLuint): Boolean; stdcall;
  224. wglGetGenlockSampleRateI3D: function(hDC: HDC; uRate: PGLuint): Boolean; stdcall;
  225. wglGenlockSourceDelayI3D: function(hDC: HDC; uDelay: GLuint): Boolean; stdcall;
  226. wglGetGenlockSourceDelayI3D: function(hDC: HDC; uDelay: PGLuint): Boolean; stdcall;
  227. wglQueryGenlockMaxSourceDelayI3D: function(hDC: HDC; uMaxLineDelay: PGLuint; uMaxPixelDelay: PGLuint): Boolean; stdcall;
  228. {$EndIf}
  229. {$IfDef WGL_I3D_image_buffer}
  230. wglCreateImageBufferI3D: function(hDC: HDC; dwSize: GLuint; uFlags: GLuint): GLvoid; stdcall;
  231. wglDestroyImageBufferI3D: function(hDC: HDC; pAddress: GLvoid): Boolean; stdcall;
  232. wglAssociateImageBufferEventsI3D: function(hDC: HDC; const pEvent: THandle; const pAddress: PGLvoid; const pSize: PGLuint; count: GLuint): Boolean; stdcall;
  233. wglReleaseImageBufferEventsI3D: function(hDC: HDC; const pAddress: PGLvoid; count: GLuint): Boolean; stdcall;
  234. {$EndIf}
  235. {$IfDef WGL_I3D_swap_frame_lock}
  236. wglEnableFrameLockI3D: function(): Boolean; stdcall;
  237. wglDisableFrameLockI3D: function(): Boolean; stdcall;
  238. wglIsEnabledFrameLockI3D: function(pFlag: Boolean): Boolean; stdcall;
  239. wglQueryFrameLockMasterI3D: function(pFlag: Boolean): Boolean; stdcall;
  240. {$EndIf}
  241. {$IfDef WGL_I3D_swap_frame_usage}
  242. wglGetFrameUsageI3D: function(pUsage: PGLfloat): Boolean; stdcall;
  243. wglBeginFrameTrackingI3D: function(): Boolean; stdcall;
  244. wglEndFrameTrackingI3D: function(): Boolean; stdcall;
  245. wglQueryFrameTrackingI3D: function(pFrameCount: PGLuint; pMissedFrames: PGLuint; pLastMissedUsage: PGLfloat): Boolean; stdcall;
  246. {$EndIf}
  247. {$IfDef WGL_NV_vertex_array_range}
  248. wglAllocateMemoryNV: procedure(size: GLsizei; readfreq: GLfloat; writefreq: GLfloat; priority: GLfloat); stdcall;
  249. wglFreeMemoryNV: procedure(_pointer: Pointer); stdcall;
  250. {$EndIf}
  251. {$IfDef WGL_NV_present_video}
  252. wglEnumerateVideoDevicesNV: function(hdc: HDC; phDeviceList: PHVIDEOOUTPUTDEVICENV): Integer; stdcall;
  253. wglBindVideoDeviceNV: function(hd: HDC; uVideoSlot: Cardinal; hVideoDevice: HVIDEOOUTPUTDEVICENV; piAttribList: PInteger): Boolean; stdcall;
  254. wglQueryCurrentContextNV: function(iAttribute: Integer; piValue: PInteger): Boolean; stdcall;
  255. {$EndIf}
  256. {$IfDef WGL_NV_video_output}
  257. wglGetVideoDeviceNV: function(hDC: HDC; numDevices: Integer; hVideoDevice: PHPVIDEODEV): Boolean; stdcall;
  258. wglReleaseVideoDeviceNV: function(hVideoDevice: HPVIDEODEV): Boolean; stdcall;
  259. wglBindVideoImageNV: function(hVideoDevice: HPVIDEODEV; hPbuffer: THandle; iVideoBuffer: Integer): Boolean; stdcall;
  260. wglReleaseVideoImageNV: function(hPbuffer: THandle; iVideoBuffer: Integer): Boolean; stdcall;
  261. wglSendPbufferToVideoNV: function(hPbuffer: THandle; iBufferType: Integer; pulCounterPbuffer: PCardinal; bBlock: Boolean): Boolean; stdcall;
  262. wglGetVideoInfoNV: function(hpVideoDevice: HPVIDEODEV; pulCounterOutputPbuffer: PCardinal; pulCounterOutputVideo: PCardinal): Boolean; stdcall;
  263. {$EndIf}
  264. {$IfDef WGL_NV_swap_group}
  265. wglJoinSwapGroupNV: function(hDC: HDC; group: GLuint): Boolean; stdcall;
  266. wglBindSwapBarrierNV: function(group: GLuint; barrier: GLuint): Boolean; stdcall;
  267. wglQuerySwapGroupNV: function(hDC: HDC; group: PGLuint; barrier: PGLuint): Boolean; stdcall;
  268. wglQueryMaxSwapGroupsNV: function(hDC: HDC; mxGroups: PGLuint; maxBarriers: PGLuint): Boolean; stdcall;
  269. wglQueryFrameCountNV: function(hDC: HDC; count: PGLuint): Boolean; stdcall;
  270. wglResetFrameCountNV: function(hDC: HDC): Boolean; stdcall;
  271. {$EndIf}
  272. {$IfDef WGL_NV_gpu_affinity}
  273. wglEnumGpusNV: function(iGpuIndex: Cardinal; phGpu: PHGPUNV): Boolean; stdcall;
  274. wglEnumGpuDevicesNV: function(hGpu: HGPUNV; iDeviceIndex: Cardinal; lpGpuDevice: PGPU_DEVICE): Boolean; stdcall;
  275. wglCreateAffinityDCNV: function(const phGpuList: PHGPUNV): HDC; stdcall;
  276. wglEnumGpusFromAffinityDCNV: function(hAffinityDC: HDC; iGpuIndex: Cardinal; hGpu: PHGPUNV): Boolean; stdcall;
  277. wglDeleteDCNV: function(hDC: HDC): Boolean; stdcall;
  278. {$EndIf}
  279. {$ifdef WGL_NV_video_capture}
  280. wglBindVideoCaptureDeviceNV: function(uVideoSlot: Cardinal; hDevice: HVIDEOINPUTDEVICENV): Boolean; stdcall;
  281. wglEnumerateVideoCaptureDevicesNV: function(hDc: HDC; phDeviceList: PHVIDEOINPUTDEVICENV): Cardinal; stdcall;
  282. wglLockVideoCaptureDeviceNV: function(hDc: HDC; hDevice: HVIDEOINPUTDEVICENV): Boolean; stdcall;
  283. wglQueryVideoCaptureDeviceNV: function(hDc: HDC; hDevice: HVIDEOINPUTDEVICENV; iAttribute: Integer; piValue: PInteger): Boolean; stdcall;
  284. wglReleaseVideoCaptureDeviceNV: function(hDc: HDC; hDevice: HVIDEOINPUTDEVICENV): Boolean; stdcall;
  285. {$EndIf}
  286. {$IfDef WGL_NV_copy_image}
  287. wglCopyImageSubDataNV: function(hSrcRc: HGLRC; srcName: GLuint; srcTarget: GLenum; srcLevel: GLint; srcX: GLint; srcY: GLint; srcZ: GLint; hDstRC: HGLRC; dstName: GLuint; dstTarget: GLenum; dstLevel: GLint; dstX: GLint; dstY: GLint; dstZ: GLint; width: GLsizei; height: GLsizei; depth: GLsizei): Boolean; stdcall;
  288. {$EndIf}
  289. {$ifdef WGL_NV_delay_before_swap}
  290. wglDelayBeforeSwapNV: function (hDC:HDC; seconds:GLfloat): Boolean; stdcall;
  291. {$EndIf}
  292. {$IfDef WGL_NV_DX_interop}
  293. wglDXSetResourceShareHandleNV: function(dxObject : PGLVoid; hareHandle : Cardinal) : Boolean; stdcall;
  294. wglDXOpenDeviceNV: function(dxDevice : PGLVoid) : Cardinal; stdcall;
  295. wglDXCloseDeviceNV: function(hDevice : Cardinal) : Boolean; stdcall;
  296. wglDXRegisterObjectNV: function(hDevice : Cardinal; dxObject : PGLVoid; name : GLUInt; _type : GLEnum; access : GLenum) : Cardinal; stdcall;
  297. wglDXUnregisterObjectNV: function(hDevice : Cardinal; hObject : Cardinal) : Boolean; stdcall;
  298. wglDXObjectAccessNV: function(hObject : Cardinal; access : GLenum) : Boolean; stdcall;
  299. wglDXLockObjectsNV: function(hDevice : Cardinal; count : GLint; hObjects : PCardinal) : Boolean; stdcall;
  300. wglDXUnlockObjectsNV: function (hDevice : Cardinal; count : GLint; hObjects : PCardinal) : Boolean; stdcall;
  301. {$EndIf}
  302. {$IfDef WGL_OML_sync_control}
  303. wglGetSyncValuesOML: function(hdc: HDC; ust: PGLint64; msc: PGLint64; sbc: PGLint64): Boolean; stdcall;
  304. wglGetMscRateOML: function(hdc: HDC; numerator: PGLint; denominator: PGLint): Boolean; stdcall;
  305. wglSwapBuffersMscOML: function(hdc: HDC; target_msc: GLint64; divisor: GLint64; remainder: GLint64): GLint64; stdcall;
  306. wglSwapLayerBuffersMscOML: function(hdc: HDC; fuPlanes: GLint; target_msc: GLint64; divisor: GLint64; remainder: GLint64): GLint64; stdcall;
  307. wglWaitForMscOML: function(hdc: HDC; target_msc: GLint64; divisor: GLint64; remainder: GLint64; ust: PGLint64; msc: PGLint64; sbc: PGLint64): Boolean; stdcall;
  308. wglWaitForSbcOML: function(hdc: HDC; target_sbc: GLint64; ust: PGLint64; msc: PGLint64; sbc: PGLint64): Boolean; stdcall;
  309. {$EndIf}
  310. {$IfDef WGL_3DL_stereo_control}
  311. wglSetStereoEmitterState3DL: function(hDC: HDC; uState: UINT): Boolean; stdcall;
  312. {$EndIf}
  313. // WIN_draw_range_elements узнать что это за функции и здесь ли они должны быть?
  314. // glDrawRangeElementsWIN = procedure(mode: GLenum; start: GLuint; _end: GLuint; count: GLsizei; _type: GLenum; const indices: PGLvoid); stdcall;
  315. // WIN_swap_hint
  316. // glAddSwapHintRectWIN = procedure(x: GLint; y: GLint; width: GLsizei; height: GLsizei); stdcall;
  317. {$EndIf}
  318. {$IfDef LINUX}
  319. var
  320. GLX_VERSION_1_3: Boolean;
  321. GLX_VERSION_1_4: Boolean;
  322. // ZenGL ++
  323. GLX_SGIX_fbconfig: boolean;
  324. GLX_SGIX_pbuffer: boolean;
  325. GLX_SGI_swap_control: boolean;
  326. {$IFDEF GL_VERSION_3_0}
  327. GLX_ARB_create_context: boolean;
  328. {$ENDIF}
  329. {$IfDef USE_FULL_GLX}
  330. GLX_ARB_context_flush_control: Boolean;
  331. GLX_ARB_create_context_no_error: boolean;
  332. GLX_ARB_create_context_profile: boolean;
  333. GLX_ARB_create_context_robustness: boolean;
  334. GLX_ARB_fbconfig_float: boolean;
  335. GLX_ARB_framebuffer_sRGB: boolean;
  336. GLX_ARB_get_proc_address: boolean;
  337. GLX_ARB_multisample: boolean;
  338. GLX_ARB_robustness_application_isolation: boolean;
  339. GLX_ARB_robustness_share_group_isolation: boolean;
  340. GLX_ARB_vertex_buffer_object: boolean;
  341. GLX_3DFX_multisample: boolean;
  342. GLX_AMD_gpu_association: boolean;
  343. GLX_EXT_buffer_age: boolean;
  344. GLX_EXT_context_priority: boolean;
  345. GLX_EXT_create_context_es2_profile: boolean;
  346. GLX_EXT_create_context_es_profile: boolean;
  347. GLX_EXT_fbconfig_packed_float: boolean;
  348. GLX_EXT_framebuffer_sRGB: boolean;
  349. GLX_EXT_get_drawable_type: boolean;
  350. GLX_EXT_import_context: boolean;
  351. GLX_EXT_libglvnd: boolean;
  352. GLX_EXT_no_config_context: boolean;
  353. GLX_EXT_stereo_tree: boolean;
  354. GLX_EXT_swap_control: boolean;
  355. GLX_EXT_swap_control_tear: boolean;
  356. GLX_EXT_texture_from_pixmap: Boolean;
  357. GLX_EXT_visual_info: boolean;
  358. GLX_EXT_visual_rating: boolean;
  359. GLX_INTEL_swap_event: boolean;
  360. GLX_MESA_agp_offset: boolean;
  361. GLX_MESA_copy_sub_buffer: boolean;
  362. GLX_MESA_pixmap_colormap: boolean;
  363. GLX_MESA_query_renderer: boolean;
  364. GLX_MESA_release_buffers: boolean;
  365. GLX_MESA_set_3dfx_mode: boolean;
  366. GLX_MESA_swap_control: boolean;
  367. GLX_NV_copy_buffer: boolean;
  368. GLX_NV_copy_image: boolean;
  369. GLX_NV_delay_before_swap: boolean;
  370. GLX_NV_float_buffer: boolean;
  371. GLX_NV_multigpu_context: boolean;
  372. GLX_NV_multisample_coverage: boolean;
  373. GLX_NV_present_video: boolean;
  374. GLX_NV_robustness_video_memory_purge: boolean;
  375. GLX_NV_swap_group: boolean;
  376. GLX_NV_video_capture: boolean;
  377. GLX_NV_video_out: boolean;
  378. GLX_OML_swap_method: boolean;
  379. GLX_OML_sync_control: boolean;
  380. GLX_SGIS_blended_overlay: boolean;
  381. GLX_SGIS_multisample: boolean;
  382. GLX_SGIS_shared_multisample: boolean;
  383. GLX_SGIX_dmbuffer: boolean;
  384. GLX_SGIX_hyperpipe: boolean;
  385. GLX_SGIX_swap_barrier: boolean;
  386. GLX_SGIX_swap_group: boolean;
  387. GLX_SGIX_video_resize: boolean;
  388. GLX_SGIX_video_source: boolean;
  389. GLX_SGIX_visual_select_group: boolean;
  390. GLX_SGI_cushion: boolean;
  391. GLX_SGI_make_current_read: boolean;
  392. GLX_SGI_video_sync: boolean;
  393. GLX_SUN_get_transparent_index: boolean;
  394. // GLX_SGIX_fbconfig: boolean;
  395. // GLX_SGIX_pbuffer: boolean;
  396. // GLX_SGI_swap_control: boolean;
  397. {$EndIf}
  398. // GLX_VERSION_1_0
  399. glXChooseVisual: function(dpy: PDisplay; screen: Integer; attribList: PInteger): PXVisualInfo; cdecl;
  400. glXCreateContext: function(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: GLBoolean): GLXContext; cdecl;
  401. glXDestroyContext: procedure(dpy: PDisplay; ctx: GLXContext); cdecl;
  402. glXMakeCurrent: function(dpy: PDisplay; drawable: GLXDrawable; ctx: GLXContext): Boolean; cdecl;
  403. glXSwapBuffers: procedure(dpy: PDisplay; drawable: GLXDrawable); cdecl;
  404. glXQueryExtension: function(dpy: PDisplay; out errorb, event: Integer): Boolean; cdecl;
  405. // возвращаем версию GLX
  406. glXQueryVersion: function(dpy: PDisplay; out major, minor: Integer): Boolean; cdecl;
  407. glXIsDirect: function(dpy: PDisplay; ctx: GLXContext): Boolean; cdecl;
  408. // GLX_VERSION_1_1
  409. // вернуть строку - GLX_VENDOR , GLX_VERSION или GLX_EXTENSIONS.
  410. glXQueryServerString: function(dpy: PDisplay; screen: Integer; name: Integer): PAnsiChar; cdecl;
  411. // GLX_VERSION_1_3
  412. glXGetFBConfigAttrib: function(dpy: PDisplay; config: GLXFBConfig; attribute: GLint; var value: GLint): glint; cdecl;
  413. // создание нового контекста рендеринга GLX
  414. glXCreateNewContext: function(dpy: PDisplay; config: GLXFBConfig; render_type: GLint; share_list: GLXContext; direct: GLboolean): GLXContext cdecl;
  415. {$IfDef USE_FULL_GLX}
  416. // Rus: Важно знать, это полная версия переведённая библиотека GLX для ZenGL.
  417. // Вы можете использовать вместо этого модуля модуль GLX.
  418. // Eng: It is important to know, this is the full version of the translated GLX
  419. // library for ZenGL. You can use the GLX module instead.
  420. // GLX_VERSION_1_0
  421. glXCopyContext: procedure(dpy: PDisplay; src: GLXContext; dst: GLXContext; mask: GLuint); cdecl;
  422. glXCreateGLXPixmap: function(dpy: PDisplay; vis: PXVisualInfo; pixmap: XPixmap): GLXPixmap cdecl;
  423. glXDestroyGLXPixmap: procedure(dpy: PDisplay; pix: GLXPixmap); cdecl;
  424. glXGetConfig: function(dpy: PDisplay; vis: PXVisualInfo; attrib: GLint; value: PGLint): GLint; cdecl;
  425. glXGetCurrentContext: function: GLXContext; cdecl;
  426. glXGetCurrentDrawable: function: GLXDrawable; cdecl;
  427. glXUseXFont: procedure(font: XFont; first: GLint; count: GLint; listBase: GLint); cdecl;
  428. glXWaitGL: procedure; cdecl;
  429. glXWaitX: procedure; cdecl;
  430. // GLX_VERSION_1_1
  431. glXGetClientString: function(dpy: PDisplay; name: GLint): PGLchar; cdecl;
  432. glXQueryExtensionsString: function(dpy: PDisplay; screen: GLint): PGLchar; cdecl;
  433. {$IfDef GLX_VERSION_1_3} // - http://code.nabla.net/doc/OpenGL/index_man1.html
  434. glXGetFBConfigs: function(dpy: PDisplay; screen: GLint; var nelements: GLint): PGLXFBConfig; cdecl;
  435. // создание области рендеринга на экране
  436. glXCreateWindow: function(dpy: PDisplay; config: GLXFBConfig; win: XWindow; attrib_list: PGLint): GLXWindow; cdecl;
  437. // уничтожение области рендеринга
  438. glXDestroyWindow: procedure(dpy: PDisplay; win: GLXWindow); cdecl;
  439. // создание области рендеринга вне экрана (вне окна? или вообще не на экране?)
  440. glXCreatePixmap: function(dpy: PDisplay; config: GLXFBConfig; pixmap: XPixmap; attrib_list: PGLint): GLXPixmap; cdecl;
  441. // уничтожение области рендеринга вне экрана
  442. glXDestroyPixmap: procedure(dpy: PDisplay; pixmap: GLXPixmap); cdecl;
  443. // возвращает атрибут, связанный с возможностью рисования GLX
  444. glXQueryDrawable: procedure(dpy: PDisplay; draw: GLXDrawable; attribute: GLint; value: PGLuint); cdecl;
  445. // связывание контекста GLX с окном
  446. glXMakeContextCurrent: function(display: PDisplay; draw: GLXDrawable; read_: GLXDrawable; ctx: GLXContext): GLboolean; cdecl;
  447. // вернуть текущий (контекст?) доступный для рисования
  448. glXGetCurrentReadDrawable: function: GLXDrawable; cdecl;
  449. // вернуть текущее окно? Удалена???
  450. // glXGetCurreentDisplay: function: PDisplay; cdecl;
  451. // информация о контексте запроса
  452. glXQueryContext: function(dpy: PDisplay; ctx: GLXContext; attribute: GLint; value: PGLint): GLint; cdecl;
  453. // устанавливаем маску события GLX для пиксельного буфера или окна
  454. glXSelectEvent: procedure(dpy: PDisplay; draw: GLXDrawable; event_mask: GLuint); cdecl;
  455. // возвращаем маску события выбранного для рисования
  456. glXGetSelectedEvent: procedure(dpy: PDisplay; draw: GLXDrawable; event_mask: PGLuint); cdecl;
  457. {$EndIf}
  458. {$EndIf}
  459. {$ifdef GLX_ARB_create_context}
  460. glXCreateContextAttribsARB: function(dpy: PDisplay; config: GLXFBConfig; share_context: GLXContext; direct: boolean; const attrib_list: PGLint): GLXContext; cdecl;
  461. {$EndIf}
  462. {$ifdef GLX_AMD_gpu_association}
  463. glXGetGPUIDsAMD: function(maxCount: dword; ids: Pdword): dword; cdecl;
  464. glXGetGPUInfoAMD: function(id: dword; _property: longint; dataType: GLenum; size: dword; data: pointer): longint; cdecl;
  465. glXGetContextGPUIDAMD: function(ctx: GLXContext): dword; cdecl;
  466. glXCreateAssociatedContextAMD: function(id: dword; share_list: GLXContext): GLXContext; cdecl;
  467. glXCreateAssociatedContextAttribsAMD: function(id: dword; share_context: GLXContext; attribList: Plongint): GLXContext; cdecl;
  468. glXDeleteAssociatedContextAMD: function(ctx: GLXContext): Boolean; cdecl;
  469. glXMakeAssociatedContextCurrentAMD: function(ctx: GLXContext): Boolean; cdecl;
  470. glXGetCurrentAssociatedContextAMD: function: GLXContext; cdecl;
  471. glXBlitContextFramebufferAMD: procedure(dstCtx: GLXContext; srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1: GLint; mask: GLbitfield; filter: GLenum); cdecl;
  472. {$EndIf}
  473. {$ifdef GLX_EXT_import_context}
  474. glXGetCurrentDisplayEXT: function: PDisplay; cdecl;
  475. glXQueryContextInfoEXT: function(dpy: PDisplay; context: GLXContext; attribute: GLint; value: PGLint): GLint; cdecl;
  476. glXGetContextIDEXT: function(const context: GLXContext): GLXContextID; cdecl;
  477. glXImportContextEXT: function(dpy: PDisplay; contextID: GLXContextID): GLXContext; cdecl;
  478. glXFreeContextEXT: procedure(dpy: PDisplay; context: GLXContext); cdecl;
  479. {$EndIf}
  480. {$ifdef GLX_EXT_texture_from_pixmap}
  481. glXBindTexImageEXT: procedure(dpy: PDisplay; drawable: GLXDrawable; buffer: GLint; const attrib_list: PGLint); cdecl;
  482. glXReleaseTexImageEXT: procedure(dpy: PDisplay; drawable: GLXDrawable; buffer: GLint); cdecl;
  483. {$EndIf}
  484. {$ifdef GLX_EXT_swap_control}
  485. glXSwapIntervalEXT: procedure(dpy : PDisplay; drawable : GLXDrawable; interval : GLint); cdecl;
  486. {$EndIf}
  487. {$ifdef GLX_MESA_agp_offset}
  488. glXGetAGPOffsetMESA: function(pointer: pointer): dword; cdecl;
  489. {$endif}
  490. {$ifdef GLX_MESA_pixmap_colormap}
  491. glXCreateGLXPixmapMESA: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap; cmap: XColormap): GLXPixmap; cdecl;
  492. {$EndIf}
  493. {$ifdef GLX_MESA_query_renderer}
  494. glXQueryCurrentRendererIntegerMESA: function(attribute: longint; value: Pdword): Boolean; cdecl;
  495. glXQueryCurrentRendererStringMESA: function(attribute:longint): Pchar; cdecl;
  496. glXQueryRendererIntegerMESA: function(dpy: PDisplay; screen: longint; renderer: longint; attribute: longint; value: Pdword): Boolean; cdecl;
  497. glXQueryRendererStringMESA: function(dpy: PDisplay; screen: longint; renderer: longint; attribute: longint): Pchar; cdecl;
  498. {$EndIf}
  499. {$ifdef GLX_MESA_swap_control}
  500. glXSwapIntervalMESA: function(interval: cuint): cint; cdecl;
  501. glXGetSwapIntervalMESA: function: cint; cdecl;
  502. {$EndIf}
  503. // Unknown Mesa GLX extension (undocumented in current GLX C headers?)
  504. {$ifdef GLX_MESA_release_buffers}
  505. glXReleaseBuffersMESA: function(dpy: PDisplay; d: GLXDrawable): TBoolResult; cdecl;
  506. {$EndIf}
  507. {$ifdef GLX_MESA_copy_sub_buffer}
  508. glXCopySubBufferMESA: procedure(dpy: PDisplay; drawable: GLXDrawable; x, y, width, height: cint); cdecl;
  509. {$EndIf}
  510. {$ifdef GLX_MESA_set_3dfx_mode}
  511. glXSet3DfxModeMESA: function(mode: GLint): GLboolean; cdecl;
  512. {$EndIf}
  513. {$ifdef GLX_NV_copy_buffer}
  514. glXCopyBufferSubDataNV: procedure(dpy: PDisplay; readCtx, writeCtx: GLXContext; readTarget, writeTarget: GLenum; readOffset, writeOffset: GLintptr; size: GLsizeiptr); cdecl;
  515. glXNamedCopyBufferSubDataNV: procedure(dpy: PDisplay; readCtx, writeCtx: GLXContext; readBuffer, writeBuffer: GLuint; readOffset, writeOffset: GLintptr; size: GLsizeiptr); cdecl;
  516. {$endif}
  517. {$ifdef GLX_NV_copy_image}
  518. glXCopyImageSubDataNV: procedure(dpy: PDisplay; srcCtx: GLXContext; srcName: GLuint; srcTarget: GLenum; srcLevel, srcX, srcY, srcZ: GLint; dstCtx: GLXContext; dstName: GLuint; dstTarget: GLenum; dstLevel, dstX, dstY, dstZ: GLint; width, height, depth: GLsizei); cdecl;
  519. {$endif}
  520. {$ifdef GLX_NV_delay_before_swap}
  521. glXDelayBeforeSwapNV: function(dpy: PDisplay; drawable: GLXDrawable; seconds: GLfloat): Boolean; cdecl;
  522. {$endif}
  523. {$ifdef GLX_NV_present_video}
  524. glXEnumerateVideoDevicesNV: function(dpy: PDisplay; screen: longint; nelements: Plongint): Pdword; cdecl;
  525. glXBindVideoDeviceNV: function(dpy: PDisplay; video_slot: dword; video_device: dword; attrib_list: Plongint): longint; cdecl;
  526. {$EndIf}
  527. {$ifdef GLX_NV_swap_group}
  528. glXJoinSwapGroupNV: function(dpy: PDisplay; drawable: GLXDrawable; group: GLuint): Boolean; cdecl;
  529. glXBindSwapBarrierNV: function(dpy: PDisplay; group: GLuint; barrier: GLuint): Boolean; cdecl;
  530. glXQuerySwapGroupNV: function(dpy: PDisplay; drawable: GLXDrawable; group: PGLuint; barrier: PGLuint): Boolean; cdecl;
  531. glXQueryMaxSwapGroupsNV: function(dpy: PDisplay; screen: longint; maxGroups: PGLuint; maxBarriers: PGLuint): Boolean; cdecl;
  532. glXQueryFrameCountNV: function(dpy: PDisplay; screen: longint; count: PGLuint): Boolean; cdecl;
  533. glXResetFrameCountNV: function(dpy: PDisplay; screen: longint):Boolean; cdecl;
  534. {$endif}
  535. {$ifdef GLX_NV_video_capture}
  536. glXBindVideoCaptureDeviceNV: function(dpy: PDisplay; video_capture_slot: dword; device: GLXVideoCaptureDeviceNV): longint; cdecl;
  537. glXEnumerateVideoCaptureDevicesNV: function(dpy: PDisplay; screen: longint; nelements: Plongint): PGLXVideoCaptureDeviceNV; cdecl;
  538. glXLockVideoCaptureDeviceNV: procedure(dpy: PDisplay; device: GLXVideoCaptureDeviceNV); cdecl;
  539. glXQueryVideoCaptureDeviceNV: function(dpy: PDisplay; device: GLXVideoCaptureDeviceNV; attribute: longint; value: Plongint): longint; cdecl;
  540. glXReleaseVideoCaptureDeviceNV: procedure(dpy: PDisplay; device: GLXVideoCaptureDeviceNV); cdecl;
  541. {$EndIf}
  542. {$ifdef GLX_NV_video_out}
  543. glXGetVideoDeviceNV: function(dpy: PDisplay; screen: longint; numVideoDevices: longint; pVideoDevice: PGLXVideoDeviceNV): longint; cdecl;
  544. glXReleaseVideoDeviceNV: function(dpy: PDisplay; screen: longint; VideoDevice: GLXVideoDeviceNV): longint; cdecl;
  545. glXBindVideoImageNV: function(dpy: PDisplay; VideoDevice: GLXVideoDeviceNV; pbuf: GLXPbuffer; iVideoBuffer: longint): longint; cdecl;
  546. glXReleaseVideoImageNV: function(dpy: PDisplay; pbuf: GLXPbuffer): longint; cdecl;
  547. glXSendPbufferToVideoNV: function(dpy: PDisplay; pbuf: GLXPbuffer; iBufferType: longint; pulCounterPbuffer: Pdword; bBlock: GLboolean): longint; cdecl;
  548. glXGetVideoInfoNV: function(dpy: PDisplay; screen: longint; VideoDevice: GLXVideoDeviceNV; pulCounterOutputPbuffer: Pdword; pulCounterOutputVideo: Pdword): longint; cdecl;
  549. {$EndIf}
  550. {$ifdef GLX_OML_sync_control}
  551. glXGetSyncValuesOML: function(dpy: PDisplay; drawable: GLXDrawable; ust: Pint64_t; msc: Pint64_t; sbc: Pint64_t): Boolean; cdecl;
  552. glXGetMscRateOML: function(dpy: PDisplay; drawable: GLXDrawable; numerator: Pint32_t; denominator: Pint32_t):Boolean; cdecl;
  553. glXSwapBuffersMscOML: function(dpy: PDisplay; drawable: GLXDrawable; target_msc: int64_t; divisor: int64_t; remainder: int64_t): int64_t; cdecl;
  554. glXWaitForMscOML: function(dpy: PDisplay; drawable: GLXDrawable; target_msc: int64_t; divisor: int64_t; remainder: int64_t; ust: Pint64_t; msc: Pint64_t; sbc: Pint64_t): Boolean; cdecl;
  555. glXWaitForSbcOML: function(dpy: PDisplay; drawable: GLXDrawable; target_sbc: int64_t; ust: Pint64_t; msc: Pint64_t; sbc: Pint64_t): Boolean; cdecl;
  556. {$EndIf}
  557. {$ifdef GLX_SGIX_dmbuffer} // dm_buffer.h застрелитесь - Digital media
  558. glXAssociateDMPbufferSGIX: function(dpy: PDisplay; pbuffer: GLXPbufferSGIX; params: PDMparams; dmbuffer: DMbuffer): Boolean; cdecl;
  559. {$EndIf}
  560. {$ifdef GLX_SGIX_fbconfig}
  561. glXGetFBConfigAttribSGIX: function(dpy: PDisplay; config: GLXFBConfigSGIX; attribute: longint; var value: longint): longint; cdecl;
  562. glXChooseFBConfigSGIX: function(dpy: PDisplay; screen: longint; attrib_list: Plongint; var nelements: longint): PGLXFBConfigSGIX; cdecl;
  563. glXCreateGLXPixmapWithConfigSGIX: function(dpy: PDisplay; config: GLXFBConfigSGIX; pixmap: XPixmap): GLXPixmap; cdecl;
  564. glXCreateContextWithConfigSGIX: function(dpy: PDisplay; config: GLXFBConfigSGIX; render_type: longint; share_list: GLXContext; direct: Boolean): GLXContext; cdecl;
  565. glXGetVisualFromFBConfigSGIX: function(dpy: PDisplay; config: GLXFBConfigSGIX): PXVisualInfo; cdecl;
  566. glXGetFBConfigFromVisualSGIX: function(dpy: PDisplay; vis: PXVisualInfo): GLXFBConfigSGIX; cdecl;
  567. {$EndIf}
  568. {$ifdef GLX_SGIX_hyperpipe}
  569. glXQueryHyperpipeNetworkSGIX: function(dpy: PDisplay; npipes: Plongint): PGLXHyperpipeNetworkSGIX; cdecl;
  570. glXHyperpipeConfigSGIX: function(dpy: PDisplay; networkId: longint; npipes: longint; cfg: PGLXHyperpipeConfigSGIX; hpId: Plongint): longint; cdecl;
  571. glXQueryHyperpipeConfigSGIX: function(dpy: PDisplay; hpId: longint; npipes: Plongint): PGLXHyperpipeConfigSGIX; cdecl;
  572. glXDestroyHyperpipeConfigSGIX: function(dpy: PDisplay; hpId: longint): longint; cdecl;
  573. glXBindHyperpipeSGIX: function(dpy: PDisplay; hpId: longint): longint; cdecl;
  574. glXQueryHyperpipeBestAttribSGIX: function(dpy: PDisplay; timeSlice: longint; attrib: longint; size: longint; attribList: pointer; returnAttribList: pointer): longint; cdecl;
  575. glXHyperpipeAttribSGIX: function(dpy: PDisplay; timeSlice: longint; attrib: longint; size: longint; attribList: pointer): longint; cdecl;
  576. glXQueryHyperpipeAttribSGIX: function(dpy: PDisplay; timeSlice: longint; attrib: longint; size: longint; returnAttribList: pointer): longint; cdecl;
  577. {$EndIf}
  578. {$ifdef GLX_SGIX_swap_barrier}
  579. glXBindSwapBarrierSGIX: procedure(dpy: PDisplay; drawable: GLXDrawable; barrier: longint); cdecl;
  580. glXQueryMaxSwapBarriersSGIX: function(dpy: PDisplay; screen: longint; max: Plongint): Boolean; cdecl;
  581. {$endif}
  582. {$ifdef GLX_SGIX_swap_group}
  583. glXJoinSwapGroupSGIX: procedure(dpy: PDisplay; drawable: GLXDrawable; member: GLXDrawable); cdecl;
  584. {$endif}
  585. {$ifdef GLX_SGIX_video_resize}
  586. glXBindChannelToWindowSGIX: function(display: PDisplay; screen: longint; channel: longint; window: XWindow): longint; cdecl;
  587. glXChannelRectSGIX: function(display: PDisplay; screen: longint; channel: longint; x: longint; y: longint; w: longint; h: longint): longint; cdecl;
  588. glXQueryChannelRectSGIX: function(display: PDisplay; screen: longint; channel: longint; dx: Plongint; dy: Plongint; dw: Plongint; dh: Plongint): longint; cdecl;
  589. glXQueryChannelDeltasSGIX: function(display: PDisplay; screen: longint; channel: longint; x: Plongint; y: Plongint; w: Plongint; h: Plongint): longint; cdecl;
  590. glXChannelRectSyncSGIX: function(display: PDisplay; screen: longint; channel: longint; synctype: GLenum): longint; cdecl;
  591. {$EndIf}
  592. {$ifdef GLX_SGIX_video_source} // afs_vl.h https://wiki.gentoo.org/wiki/OpenAFS#What_is_AFS.3F
  593. glXCreateGLXVideoSourceSGIX: function(display: PDisplay; screen: longint; server: VLServer; path: VLPath; nodeClass: longint; drainNode: VLNode): GLXVideoSourceSGIX; cdecl;
  594. glXDestroyGLXVideoSourceSGIX: procedure(dpy: PDisplay; glxvideosource: GLXVideoSourceSGIX); cdecl;
  595. {$EndIf}
  596. {$ifdef GLX_SGI_cushion}
  597. glXCushionSGI: procedure(dpy: PDisplay; window: XWindow; cushion: single); cdecl;
  598. {$endif}
  599. {$ifdef GLX_SGI_make_current_read}
  600. glXMakeCurrentReadSGI: function(dpy: PDisplay; draw: GLXDrawable; read: GLXDrawable; ctx: GLXContext): Boolean; cdecl;
  601. glXGetCurrentReadDrawableSGI: function: GLXDrawable; cdecl;
  602. {$endif}
  603. {$ifdef GLX_SGI_video_sync}
  604. glXGetVideoSyncSGI: function(var count: cuint): cint; cdecl;
  605. glXWaitVideoSyncSGI: function(divisor, remainder: cint; var count: cuint): cint; cdecl;
  606. {$EndIf}
  607. {$ifdef GLX_SUN_get_transparent_index}
  608. glXGetTransparentIndexSUN: function(dpy: PDisplay; overlay: XWindow; underlay: XWindow; pTransparentIndex: Pdword): Integer {Status}; cdecl;
  609. {$endif}
  610. {$If defined(GLX_VERSION_1_4) or defined(GLX_ARB_get_proc_address)}
  611. glXGetProcAddressARB: function(name: PAnsiChar): Pointer; cdecl;
  612. {$IfEnd}
  613. {$IfDef GLX_SGI_swap_control}
  614. glXSwapIntervalSGI: function(interval: Integer): Integer; cdecl;
  615. {$EndIf}
  616. // 1.3
  617. {$IfDef GLX_VERSION_1_3}
  618. // PBuffer
  619. glXGetVisualFromFBConfig: function(dpy: PDisplay; config: GLXFBConfig): PXVisualInfo; cdecl;
  620. glXChooseFBConfig: function(dpy: PDisplay; screen: GLint; attribList: PGLint; var nitems: GLint): PGLXFBConfig; cdecl;
  621. // создание области рендеринга вне экрана
  622. glXCreatePbuffer: function(dpy: PDisplay; config: Integer; attribList: PInteger): GLXPBuffer; cdecl;
  623. // уничтожение области рендеринга вне экрана
  624. glXDestroyPbuffer: procedure(dpy: PDisplay; pbuf: GLXPBuffer); cdecl;
  625. {$EndIf}
  626. {$IfDef GLX_SGIX_pbuffer}
  627. glXCreateGLXPbufferSGIX: function(dpy: PDisplay; config: Integer; width, height: LongWord; attribList: PInteger): GLXPBuffer; cdecl;
  628. glXDestroyGLXPbufferSGIX: procedure(dpy: PDisplay; pbuf: GLXPBuffer); cdecl;
  629. glXQueryGLXPbufferSGIX: procedure(dpy: PDisplay; pbuf: GLXPbufferSGIX; attribute: longint; value: Pdword); cdecl;
  630. glXSelectEventSGIX: procedure(dpy: PDisplay; drawable: GLXDrawable; mask: dword); cdecl;
  631. glXGetSelectedEventSGIX: procedure(dpy: PDisplay; drawable: GLXDrawable; mask: Pdword); cdecl;
  632. {$EndIf}
  633. {$EndIf}
  634. procedure AllCheckWGLorGLXExtension;
  635. procedure Init_GLX_WGL;
  636. implementation
  637. uses
  638. {$IfDef LINUX}
  639. zgl_screen,
  640. {$EndIf}
  641. zgl_opengl_all,
  642. zgl_opengl;
  643. procedure AllCheckWGLorGLXExtension;
  644. begin
  645. {$IfDef LINUX}
  646. // ZenGL ++
  647. GLX_SGIX_fbconfig := gl_IsSupported('GLX_SGIX_fbconfig', oglXExtensions);
  648. GLX_SGIX_pbuffer := gl_IsSupported('GLX_SGIX_pbuffer', oglXExtensions);
  649. GLX_SGI_swap_control := gl_IsSupported('GLX_SGI_swap_control', oglXExtensions);
  650. {$IFDEF GL_VERSION_3_0}
  651. GLX_ARB_create_context := gl_IsSupported('GLX_ARB_create_context', oglXExtensions);
  652. {$ENDIF}
  653. {$IfDef USE_FULL_GLX}
  654. GLX_ARB_context_flush_control := gl_IsSupported('GLX_ARB_context_flush_control', oglXExtensions);
  655. GLX_ARB_create_context_no_error := gl_IsSupported('GLX_ARB_create_context_no_error', oglXExtensions);
  656. GLX_ARB_create_context_profile := gl_IsSupported('GLX_ARB_create_context_profile', oglXExtensions);
  657. GLX_ARB_create_context_robustness := gl_IsSupported('GLX_ARB_create_context_robustness', oglXExtensions);
  658. GLX_ARB_fbconfig_float := gl_IsSupported('GLX_ARB_fbconfig_float', oglXExtensions);
  659. GLX_ARB_framebuffer_sRGB := gl_IsSupported('GLX_ARB_framebuffer_sRGB', oglXExtensions);
  660. GLX_ARB_get_proc_address := gl_IsSupported('GLX_ARB_get_proc_address', oglXExtensions);
  661. GLX_ARB_multisample := gl_IsSupported('GLX_ARB_multisample', oglXExtensions);
  662. GLX_ARB_robustness_application_isolation := gl_IsSupported('GLX_ARB_robustness_application_isolation', oglXExtensions);
  663. GLX_ARB_robustness_share_group_isolation := gl_IsSupported('GLX_ARB_robustness_share_group_isolation', oglXExtensions);
  664. GLX_ARB_vertex_buffer_object := gl_IsSupported('GLX_ARB_vertex_buffer_object', oglXExtensions);
  665. GLX_3DFX_multisample := gl_IsSupported('GLX_3DFX_multisample', oglXExtensions);
  666. GLX_AMD_gpu_association := gl_IsSupported('GLX_AMD_gpu_association', oglXExtensions);
  667. GLX_EXT_buffer_age := gl_IsSupported('GLX_EXT_buffer_age', oglXExtensions);
  668. GLX_EXT_context_priority := gl_IsSupported('GLX_EXT_context_priority', oglXExtensions);
  669. GLX_EXT_create_context_es2_profile := gl_IsSupported('GLX_EXT_create_context_es2_profile', oglXExtensions);
  670. GLX_EXT_create_context_es_profile := gl_IsSupported('GLX_EXT_create_context_es_profile', oglXExtensions);
  671. GLX_EXT_fbconfig_packed_float := gl_IsSupported('GLX_EXT_fbconfig_packed_float', oglXExtensions);
  672. GLX_EXT_framebuffer_sRGB := gl_IsSupported('GLX_EXT_framebuffer_sRGB', oglXExtensions);
  673. GLX_EXT_get_drawable_type := gl_IsSupported('GLX_EXT_get_drawable_type', oglXExtensions);
  674. GLX_EXT_import_context := gl_IsSupported('GLX_EXT_import_context', oglXExtensions);
  675. GLX_EXT_libglvnd := gl_IsSupported('GLX_EXT_libglvnd', oglXExtensions);
  676. GLX_EXT_no_config_context := gl_IsSupported('GLX_EXT_no_config_context', oglXExtensions);
  677. GLX_EXT_stereo_tree := gl_IsSupported('GLX_EXT_stereo_tree', oglXExtensions);
  678. GLX_EXT_swap_control := gl_IsSupported('GLX_EXT_swap_control', oglXExtensions);
  679. GLX_EXT_swap_control_tear := gl_IsSupported('GLX_EXT_swap_control_tear', oglXExtensions);
  680. GLX_EXT_texture_from_pixmap := gl_IsSupported('GLX_EXT_texture_from_pixmap', oglXExtensions);
  681. GLX_EXT_visual_info := gl_IsSupported('GLX_EXT_visual_info', oglXExtensions);
  682. GLX_EXT_visual_rating := gl_IsSupported('GLX_EXT_visual_rating', oglXExtensions);
  683. GLX_INTEL_swap_event := gl_IsSupported('GLX_INTEL_swap_event', oglXExtensions);
  684. GLX_MESA_agp_offset := gl_IsSupported('GLX_MESA_agp_offset', oglXExtensions);
  685. GLX_MESA_copy_sub_buffer := gl_IsSupported('GLX_MESA_copy_sub_buffer', oglXExtensions);
  686. GLX_MESA_pixmap_colormap := gl_IsSupported('GLX_MESA_pixmap_colormap', oglXExtensions);
  687. GLX_MESA_query_renderer := gl_IsSupported('GLX_MESA_query_renderer', oglXExtensions);
  688. GLX_MESA_release_buffers := gl_IsSupported('GLX_MESA_release_buffers', oglXExtensions);
  689. GLX_MESA_set_3dfx_mode := gl_IsSupported('GLX_MESA_set_3dfx_mode', oglXExtensions);
  690. GLX_MESA_swap_control := gl_IsSupported('GLX_MESA_swap_control', oglXExtensions);
  691. GLX_NV_copy_buffer := gl_IsSupported('GLX_NV_copy_buffer', oglXExtensions);
  692. GLX_NV_copy_image := gl_IsSupported('GLX_NV_copy_image', oglXExtensions);
  693. GLX_NV_delay_before_swap := gl_IsSupported('GLX_NV_delay_before_swap', oglXExtensions);
  694. GLX_NV_float_buffer := gl_IsSupported('GLX_NV_float_buffer', oglXExtensions);
  695. GLX_NV_multigpu_context := gl_IsSupported('GLX_NV_multigpu_context', oglXExtensions);
  696. GLX_NV_multisample_coverage := gl_IsSupported('GLX_NV_multisample_coverage', oglXExtensions);
  697. GLX_NV_present_video := gl_IsSupported('GLX_NV_present_video', oglXExtensions);
  698. GLX_NV_robustness_video_memory_purge := gl_IsSupported('GLX_NV_robustness_video_memory_purge', oglXExtensions);
  699. GLX_NV_swap_group := gl_IsSupported('GLX_NV_swap_group', oglXExtensions);
  700. GLX_NV_video_capture := gl_IsSupported('GLX_NV_video_capture', oglXExtensions);
  701. GLX_NV_video_out := gl_IsSupported('GLX_NV_video_out', oglXExtensions);
  702. GLX_OML_swap_method := gl_IsSupported('GLX_OML_swap_method', oglXExtensions);
  703. GLX_OML_sync_control := gl_IsSupported('GLX_OML_sync_control', oglXExtensions);
  704. GLX_SGIS_blended_overlay := gl_IsSupported('GLX_SGIS_blended_overlay', oglXExtensions);
  705. GLX_SGIS_multisample := gl_IsSupported('GLX_SGIS_multisample', oglXExtensions);
  706. GLX_SGIS_shared_multisample := gl_IsSupported('GLX_SGIS_shared_multisample', oglXExtensions);
  707. GLX_SGIX_dmbuffer := gl_IsSupported('GLX_SGIX_dmbuffer', oglXExtensions);
  708. GLX_SGIX_hyperpipe := gl_IsSupported('GLX_SGIX_hyperpipe', oglXExtensions);
  709. GLX_SGIX_swap_barrier := gl_IsSupported('GLX_SGIX_swap_barrier', oglXExtensions);
  710. GLX_SGIX_swap_group := gl_IsSupported('GLX_SGIX_swap_group', oglXExtensions);
  711. GLX_SGIX_video_resize := gl_IsSupported('GLX_SGIX_video_resize', oglXExtensions);
  712. GLX_SGIX_video_source := gl_IsSupported('GLX_SGIX_video_source', oglXExtensions);
  713. GLX_SGIX_visual_select_group := gl_IsSupported('GLX_SGIX_visual_select_group', oglXExtensions);
  714. GLX_SGI_cushion := gl_IsSupported('GLX_SGI_cushion', oglXExtensions);
  715. GLX_SGI_make_current_read := gl_IsSupported('GLX_SGI_make_current_read', oglXExtensions);
  716. GLX_SGI_video_sync := gl_IsSupported('GLX_SGI_video_sync', oglXExtensions);
  717. GLX_SUN_get_transparent_index := gl_IsSupported('GLX_SUN_get_transparent_index', oglXExtensions);
  718. {$EndIf}
  719. {$EndIf}
  720. {$IfDef WINDOWS}
  721. // 1 - запросить версию OpenGL
  722. // 2 - запросить glGetString для нужной версии, получить строку расширений.
  723. // 3 - проверить расширение wglGetExtensionsStringARB, если существует, второй раз запрашиваем строку расширений.
  724. // замкнутый круг... без расширений нельзя использовать WGL,
  725. // для использования WGL нужно получить расширение... олени.
  726. WGL_ARB_extensions_string := gl_IsSupported('WGL_ARB_extensions_string', oWGLExtensions);
  727. WGL_EXT_extensions_string := gl_IsSupported('WGL_EXT_extensions_string', oWGLExtensions);
  728. {$IfDef GL_VERSION_3_0}
  729. WGL_ARB_create_context := gl_IsSupported('WGL_ARB_create_context', oWGLExtensions);
  730. {$EndIf}
  731. {$IfDef USE_FULL_WGL}
  732. WGL_ARB_buffer_region := gl_IsSupported('WGL_ARB_buffer_region', oWGLExtensions);
  733. WGL_ARB_context_flush_control := gl_IsSupported('WGL_ARB_context_flush_control', oWGLExtensions);
  734. WGL_ARB_create_context_no_error := gl_IsSupported('WGL_ARB_create_context_no_error', oWGLExtensions);
  735. WGL_ARB_create_context_profile := gl_IsSupported('WGL_ARB_create_context_profile', oWGLExtensions);
  736. WGL_ARB_create_context_robustness := gl_IsSupported('WGL_ARB_create_context_robustness', oWGLExtensions);
  737. WGL_ARB_make_current_read := gl_IsSupported('WGL_ARB_make_current_read', oWGLExtensions);
  738. {$EndIf}
  739. WGL_ARB_framebuffer_sRGB := gl_IsSupported('WGL_ARB_framebuffer_sRGB', oWGLExtensions);
  740. WGL_ARB_multisample := gl_IsSupported('WGL_ARB_multisample', oWGLExtensions);
  741. WGL_ARB_pbuffer := gl_IsSupported('WGL_ARB_pbuffer', oWGLExtensions);
  742. WGL_ARB_pixel_format := gl_IsSupported('WGL_ARB_pixel_format', oWGLExtensions);
  743. {$IfDef USE_FULL_WGL}
  744. WGL_ARB_pixel_format_float := gl_IsSupported('WGL_ARB_pixel_format_float', oWGLExtensions);
  745. WGL_ARB_render_texture := gl_IsSupported('WGL_ARB_render_texture', oWGLExtensions);
  746. WGL_ARB_robustness_application_isolation := gl_IsSupported('WGL_ARB_robustness_application_isolation', oWGLExtensions);
  747. WGL_ARB_robustness_share_group_isolation := gl_IsSupported('WGL_ARB_robustness_share_group_isolation', oWGLExtensions);
  748. WGL_3DFX_multisample := gl_IsSupported('WGL_3DFX_multisample', oWGLExtensions);
  749. WGL_3DL_stereo_control := gl_IsSupported('WGL_3DL_stereo_control', oWGLExtensions);
  750. WGL_AMD_gpu_association := gl_IsSupported('WGL_AMD_gpu_association', oWGLExtensions);
  751. WGL_ATI_pixel_format_float := gl_IsSupported('WGL_ATI_pixel_format_float', oWGLExtensions);
  752. WGL_ATI_render_texture_rectangle := gl_IsSupported('WGL_ATI_render_texture_rectangle', oWGLExtensions);
  753. WGL_EXT_colorspace := gl_IsSupported('WGL_EXT_colorspace', oWGLExtensions);
  754. WGL_EXT_create_context_es2_profile := gl_IsSupported('WGL_EXT_create_context_es2_profile', oWGLExtensions);
  755. WGL_EXT_create_context_es_profile := gl_IsSupported('WGL_EXT_create_context_es_profile', oWGLExtensions);
  756. WGL_EXT_depth_float := gl_IsSupported('WGL_EXT_depth_float', oWGLExtensions);
  757. WGL_EXT_display_color_table := gl_IsSupported('WGL_EXT_display_color_table', oWGLExtensions);
  758. WGL_EXT_framebuffer_sRGB := gl_IsSupported('WGL_EXT_framebuffer_sRGB', oWGLExtensions);
  759. WGL_EXT_make_current_read := gl_IsSupported('WGL_EXT_make_current_read', oWGLExtensions);
  760. WGL_EXT_multisample := gl_IsSupported('WGL_EXT_multisample', oWGLExtensions);
  761. {$EndIf}
  762. WGL_EXT_pbuffer := gl_IsSupported('WGL_EXT_pbuffer', oWGLExtensions);
  763. WGL_EXT_pixel_format := gl_IsSupported('WGL_EXT_pixel_format', oWGLExtensions);
  764. WGL_EXT_pixel_format_packed_float := gl_IsSupported('WGL_EXT_pixel_format_packed_float', oWGLExtensions);
  765. WGL_EXT_swap_control := gl_IsSupported('WGL_EXT_swap_control', oWGLExtensions);
  766. {$IfDef USE_FULL_WGL}
  767. WGL_EXT_swap_control_tear := gl_IsSupported('WGL_EXT_swap_control_tear', oWGLExtensions);
  768. WGL_I3D_digital_video_control := gl_IsSupported('WGL_I3D_digital_video_control', oWGLExtensions);
  769. WGL_I3D_gamma := gl_IsSupported('WGL_I3D_gamma', oWGLExtensions);
  770. WGL_I3D_genlock := gl_IsSupported('WGL_I3D_genlock', oWGLExtensions);
  771. WGL_I3D_image_buffer := gl_IsSupported('WGL_I3D_image_buffer', oWGLExtensions);
  772. WGL_I3D_swap_frame_lock := gl_IsSupported('WGL_I3D_swap_frame_lock', oWGLExtensions);
  773. WGL_I3D_swap_frame_usage := gl_IsSupported('WGL_I3D_swap_frame_usage', oWGLExtensions);
  774. WGL_NV_DX_interop := gl_IsSupported('WGL_NV_DX_interop', oWGLExtensions);
  775. WGL_NV_DX_interop2 := gl_IsSupported('WGL_NV_DX_interop2', oWGLExtensions);
  776. WGL_NV_copy_image := gl_IsSupported('WGL_NV_copy_image', oWGLExtensions);
  777. WGL_NV_delay_before_swap := gl_IsSupported('WGL_NV_delay_before_swap', oWGLExtensions);
  778. WGL_NV_float_buffer := gl_IsSupported('WGL_NV_float_buffer', oWGLExtensions);
  779. WGL_NV_gpu_affinity := gl_IsSupported('WGL_NV_gpu_affinity', oWGLExtensions);
  780. WGL_NV_multigpu_context := gl_IsSupported('WGL_NV_multigpu_context', oWGLExtensions);
  781. WGL_NV_multisample_coverage := gl_IsSupported('WGL_NV_multisample_coverage', oWGLExtensions);
  782. WGL_NV_present_video := gl_IsSupported('WGL_NV_present_video', oWGLExtensions);
  783. WGL_NV_render_depth_texture := gl_IsSupported('WGL_NV_render_depth_texture', oWGLExtensions);
  784. WGL_NV_render_texture_rectangle := gl_IsSupported('WGL_NV_render_texture_rectangle', oWGLExtensions);
  785. WGL_NV_swap_group := gl_IsSupported('WGL_NV_swap_group', oWGLExtensions);
  786. WGL_NV_vertex_array_range := gl_IsSupported('WGL_NV_vertex_array_range', oWGLExtensions);
  787. WGL_NV_video_capture := gl_IsSupported('WGL_NV_video_capture', oWGLExtensions);
  788. WGL_NV_video_output := gl_IsSupported('WGL_NV_video_output', oWGLExtensions);
  789. WGL_OML_sync_control := gl_IsSupported('WGL_OML_sync_control', oWGLExtensions);
  790. {$EndIf}
  791. {$EndIf}
  792. end;
  793. procedure Init_GLX_WGL;
  794. {$IfDef LINUX}
  795. var
  796. i, j: Integer;
  797. {$EndIf}
  798. begin
  799. {$IfDef LINUX}
  800. glXGetProcAddressARB := gl_GetProc('glXGetProcAddress');
  801. glXChooseVisual := gl_GetProc('glXChooseVisual');
  802. glXCreateContext := gl_GetProc('glXCreateContext');
  803. glXDestroyContext := gl_GetProc('glXDestroyContext');
  804. glXMakeCurrent := gl_GetProc('glXMakeCurrent');
  805. glXSwapBuffers := gl_GetProc('glXSwapBuffers');
  806. glXQueryExtension := gl_GetProc('glXQueryExtension');
  807. glXQueryVersion := gl_GetProc('glXQueryVersion');
  808. glXIsDirect := gl_GetProc('glXIsDirect');
  809. glXQueryServerString := gl_GetProc('glXQueryServerString');
  810. oglxExtensions := glXQueryServerString(scrDisplay, scrDefault, GLX_EXTENSIONS);
  811. glXQueryVersion(scrDisplay, i, j);
  812. if i = 1 then
  813. begin
  814. if j >= 3 then
  815. GLX_VERSION_1_3 := true;
  816. if j = 4 then
  817. GLX_VERSION_1_4 := true;
  818. end;
  819. {$EndIf}
  820. AllCheckWGLorGLXExtension;
  821. {$IfDef LINUX}
  822. if GLX_VERSION_1_3 then
  823. begin
  824. glXGetFBConfigAttrib := gl_GetProc('glXGetFBConfigAttrib');
  825. glXCreateNewContext := gl_GetProc('glXCreateNewContext');;
  826. end;
  827. // for ZenGL
  828. // PBUFFER or OpenGL 3+
  829. if GLX_VERSION_1_4 or GLX_VERSION_1_3 then
  830. oglPBufferMode := 1
  831. else
  832. if GLX_SGIX_fbconfig and GLX_SGIX_pbuffer Then
  833. oglPBufferMode := 2
  834. else
  835. oglPBufferMode := 0;
  836. oglCanPBuffer := oglPBufferMode <> 0;
  837. case oglPBufferMode of
  838. 1:
  839. begin
  840. glXGetVisualFromFBConfig := gl_GetProc('glXGetVisualFromFBConfig');
  841. glXChooseFBConfig := gl_GetProc('glXChooseFBConfig');
  842. glXCreatePbuffer := gl_GetProc('glXCreatePbuffer');
  843. glXDestroyPbuffer := gl_GetProc('glXDestroyPbuffer');
  844. end;
  845. 2:
  846. begin
  847. glXGetVisualFromFBConfig := gl_GetProc('glXGetVisualFromFBConfigSGIX');
  848. glXChooseFBConfig := gl_GetProc('glXChooseFBConfigSGIX');
  849. glXCreateGLXPbufferSGIX := gl_GetProc('glXCreateGLXPbufferSGIX');
  850. glXDestroyGLXPbufferSGIX := gl_GetProc('glXDestroyGLXPbufferSGIX');
  851. end;
  852. end;
  853. {$IfDef USE_FULL_GLX}
  854. glXCopyContext := gl_GetProc('glXCopyContext');
  855. glXCreateGLXPixmap := gl_GetProc('glXCreateGLXPixmap');
  856. glXDestroyGLXPixmap := gl_GetProc('glXDestroyGLXPixmap');
  857. glXGetConfig := gl_GetProc('glXGetConfig');
  858. glXGetCurrentContext := gl_GetProc('glXGetCurrentContext');
  859. glXGetCurrentDrawable := gl_GetProc('glXGetCurrentDrawable');
  860. glXUseXFont := gl_GetProc('glXUseXFont');
  861. glXWaitGL := gl_GetProc('glXWaitGL');
  862. glXWaitX := gl_GetProc('glXWaitX');
  863. glXGetClientString := gl_GetProc('glXGetClientString');
  864. glXQueryExtensionsString := gl_GetProc('glXQueryExtensionsString');
  865. {$IfDef GLX_VERSION_1_3}
  866. if GLX_VERSION_1_3 then
  867. begin
  868. glXGetFBConfigs := gl_GetProc('glXGetFBConfigs');
  869. glXCreateWindow := gl_GetProc('glXCreateWindow');
  870. glXDestroyWindow := gl_GetProc('glXDestroyWindow');
  871. glXCreatePixmap := gl_GetProc('glXCreatePixmap');
  872. glXDestroyPixmap := gl_GetProc('glXDestroyPixmap');
  873. glXQueryDrawable := gl_GetProc('glXQueryDrawable');
  874. glXMakeContextCurrent := gl_GetProc('glXMakeContextCurrent');
  875. glXGetCurrentReadDrawable := gl_GetProc('glXGetCurrentReadDrawable');
  876. // glXGetCurreentDisplay := gl_GetProc('glXGetCurreentDisplay');
  877. glXQueryContext := gl_GetProc('glXQueryContext');
  878. glXSelectEvent := gl_GetProc('glXSelectEvent');
  879. glXGetSelectedEvent := gl_GetProc('glXGetSelectedEvent');
  880. end;
  881. {$EndIf}
  882. {$EndIf}
  883. {$ifdef GLX_ARB_create_context}
  884. if GLX_ARB_create_context then
  885. glXCreateContextAttribsARB := gl_GetProc('glXCreateContextAttribsARB');
  886. {$EndIf}
  887. {$ifdef GLX_AMD_gpu_association}
  888. if GLX_AMD_gpu_association then
  889. begin
  890. glXGetGPUIDsAMD := gl_GetProc('glXGetGPUIDsAMD');
  891. glXGetGPUInfoAMD := gl_GetProc('glXGetGPUInfoAMD');
  892. glXGetContextGPUIDAMD := gl_GetProc('glXGetContextGPUIDAMD');
  893. glXCreateAssociatedContextAMD := gl_GetProc('glXCreateAssociatedContextAMD');
  894. glXCreateAssociatedContextAttribsAMD := gl_GetProc('glXCreateAssociatedContextAttribsAMD');
  895. glXDeleteAssociatedContextAMD := gl_GetProc('glXDeleteAssociatedContextAMD');
  896. glXMakeAssociatedContextCurrentAMD := gl_GetProc('glXMakeAssociatedContextCurrentAMD');
  897. glXGetCurrentAssociatedContextAMD := gl_GetProc('glXGetCurrentAssociatedContextAMD');
  898. glXBlitContextFramebufferAMD := gl_GetProc('glXBlitContextFramebufferAMD');
  899. end;
  900. {$EndIf}
  901. {$ifdef GLX_EXT_import_context}
  902. if GLX_EXT_import_context then
  903. begin
  904. glXGetCurrentDisplayEXT := gl_GetProc('glXGetCurrentDisplayEXT');
  905. glXQueryContextInfoEXT := gl_GetProc('glXQueryContextInfoEXT');
  906. glXGetContextIDEXT := gl_GetProc('glXGetContextIDEXT');
  907. glXImportContextEXT := gl_GetProc('glXImportContextEXT');
  908. glXFreeContextEXT := gl_GetProc('glXFreeContextEXT');
  909. end;
  910. {$EndIf}
  911. {$ifdef GLX_EXT_texture_from_pixmap}
  912. if GLX_EXT_texture_from_pixmap then
  913. begin
  914. glXBindTexImageEXT := gl_GetProc('glXBindTexImageEXT');
  915. glXReleaseTexImageEXT := gl_GetProc('glXReleaseTexImageEXT');
  916. end;
  917. {$EndIf}
  918. {$ifdef GLX_EXT_swap_control}
  919. if GLX_EXT_swap_control then
  920. glXSwapIntervalEXT := gl_GetProc('glXSwapIntervalEXT');
  921. {$EndIf}
  922. {$ifdef GLX_MESA_agp_offset}
  923. if GLX_MESA_agp_offset then
  924. glXGetAGPOffsetMESA := gl_GetProc('glXGetAGPOffsetMESA');
  925. {$endif}
  926. {$ifdef GLX_MESA_pixmap_colormap}
  927. if GLX_MESA_pixmap_colormap then
  928. glXCreateGLXPixmapMESA := gl_GetProc('glXCreateGLXPixmapMESA');
  929. {$EndIf}
  930. {$ifdef GLX_MESA_query_renderer}
  931. if GLX_MESA_query_renderer then
  932. begin
  933. glXQueryCurrentRendererIntegerMESA := gl_GetProc('glXQueryCurrentRendererIntegerMESA');
  934. glXQueryCurrentRendererStringMESA := gl_GetProc('glXQueryCurrentRendererStringMESA');
  935. glXQueryRendererIntegerMESA := gl_GetProc('glXQueryRendererIntegerMESA');
  936. glXQueryRendererStringMESA := gl_GetProc('glXQueryRendererStringMESA');
  937. end;
  938. {$EndIf}
  939. {$ifdef GLX_MESA_swap_control}
  940. if GLX_MESA_swap_control then
  941. begin
  942. glXSwapIntervalMESA := gl_GetProc('glXSwapIntervalMESA');
  943. glXGetSwapIntervalMESA := gl_GetProc('glXGetSwapIntervalMESA');
  944. end;
  945. {$EndIf}
  946. {$ifdef GLX_MESA_release_buffers}
  947. if GLX_MESA_release_buffers then
  948. glXReleaseBuffersMESA := gl_GetProc('glXReleaseBuffersMESA');
  949. {$EndIf}
  950. {$ifdef GLX_MESA_set_3dfx_mode}
  951. if GLX_MESA_set_3dfx_mode then
  952. glXSet3DfxModeMESA := gl_GetProc('glXSet3DfxModeMESA');
  953. {$EndIf}
  954. {$ifdef GLX_MESA_copy_sub_buffer}
  955. if GLX_MESA_copy_sub_buffer then
  956. glXCopySubBufferMESA := gl_GetProc('glXCopySubBufferMESA');
  957. {$EndIf}
  958. {$ifdef GLX_NV_copy_buffer}
  959. if GLX_NV_copy_buffer then
  960. begin
  961. glXCopyBufferSubDataNV := gl_GetProc('glXCopyBufferSubDataNV');
  962. glXNamedCopyBufferSubDataNV := gl_GetProc('glXNamedCopyBufferSubDataNV');
  963. end;
  964. {$EndIf}
  965. {$ifdef GLX_NV_copy_image}
  966. if GLX_NV_copy_image then
  967. glXCopyImageSubDataNV := gl_GetProc('glXCopyImageSubDataNV');
  968. {$EndIf}
  969. {$ifdef GLX_NV_delay_before_swap}
  970. if GLX_NV_delay_before_swap then
  971. glXDelayBeforeSwapNV := gl_GetProc('glXDelayBeforeSwapNV');
  972. {$EndIf}
  973. {$ifdef GLX_NV_present_video}
  974. if GLX_NV_present_video then
  975. begin
  976. glXEnumerateVideoDevicesNV := gl_GetProc('glXEnumerateVideoDevicesNV');
  977. glXBindVideoDeviceNV := gl_GetProc('glXBindVideoDeviceNV');
  978. end;
  979. {$EndIf}
  980. {$ifdef GLX_NV_swap_group}
  981. if GLX_NV_swap_group then
  982. begin
  983. glXJoinSwapGroupNV := gl_GetProc('glXJoinSwapGroupNV');
  984. glXBindSwapBarrierNV := gl_GetProc('glXBindSwapBarrierNV');
  985. glXQuerySwapGroupNV := gl_GetProc('glXQuerySwapGroupNV');
  986. glXQueryMaxSwapGroupsNV := gl_GetProc('glXQueryMaxSwapGroupsNV');
  987. glXQueryFrameCountNV := gl_GetProc('glXQueryFrameCountNV');
  988. glXResetFrameCountNV := gl_GetProc('glXResetFrameCountNV');
  989. end;
  990. {$EndIf}
  991. {$ifdef GLX_NV_video_capture}
  992. if GLX_NV_video_capture then
  993. begin
  994. glXBindVideoCaptureDeviceNV := gl_GetProc('glXBindVideoCaptureDeviceNV');
  995. glXEnumerateVideoCaptureDevicesNV := gl_GetProc('glXEnumerateVideoCaptureDevicesNV');
  996. glXLockVideoCaptureDeviceNV := gl_GetProc('glXLockVideoCaptureDeviceNV');
  997. glXQueryVideoCaptureDeviceNV := gl_GetProc('glXQueryVideoCaptureDeviceNV');
  998. glXReleaseVideoCaptureDeviceNV := gl_GetProc('glXReleaseVideoCaptureDeviceNV');
  999. end;
  1000. {$EndIf}
  1001. {$ifdef GLX_NV_video_out}
  1002. if GLX_NV_video_out then
  1003. begin
  1004. glXGetVideoDeviceNV := gl_GetProc('glXGetVideoDeviceNV');
  1005. glXReleaseVideoDeviceNV := gl_GetProc('glXReleaseVideoDeviceNV');
  1006. glXBindVideoImageNV := gl_GetProc('glXBindVideoImageNV');
  1007. glXReleaseVideoImageNV := gl_GetProc('glXReleaseVideoImageNV');
  1008. glXSendPbufferToVideoNV := gl_GetProc('glXSendPbufferToVideoNV');
  1009. glXGetVideoInfoNV := gl_GetProc('glXGetVideoInfoNV');
  1010. end;
  1011. {$EndIf}
  1012. {$ifdef GLX_OML_sync_control}
  1013. if GLX_OML_sync_control then
  1014. begin
  1015. glXGetSyncValuesOML := gl_GetProc('glXGetSyncValuesOML');
  1016. glXGetMscRateOML := gl_GetProc('glXGetMscRateOML');
  1017. glXSwapBuffersMscOML := gl_GetProc('glXSwapBuffersMscOML');
  1018. glXWaitForMscOML := gl_GetProc('glXWaitForMscOML');
  1019. glXWaitForSbcOML := gl_GetProc('glXWaitForSbcOML');
  1020. end;
  1021. {$EndIf}
  1022. {$ifdef GLX_SGIX_dmbuffer}
  1023. if GLX_SGIX_dmbuffer then
  1024. glXAssociateDMPbufferSGIX := gl_GetProc('glXAssociateDMPbufferSGIX');
  1025. {$EndIf}
  1026. {$ifdef GLX_SGIX_hyperpipe}
  1027. if GLX_SGIX_hyperpipe then
  1028. begin
  1029. glXQueryHyperpipeNetworkSGIX := gl_GetProc('glXQueryHyperpipeNetworkSGIX');
  1030. glXHyperpipeConfigSGIX := gl_GetProc('glXHyperpipeConfigSGIX');
  1031. glXQueryHyperpipeConfigSGIX := gl_GetProc('glXQueryHyperpipeConfigSGIX');
  1032. glXDestroyHyperpipeConfigSGIX := gl_GetProc('glXDestroyHyperpipeConfigSGIX');
  1033. glXBindHyperpipeSGIX := gl_GetProc('glXBindHyperpipeSGIX');
  1034. glXQueryHyperpipeBestAttribSGIX := gl_GetProc('glXQueryHyperpipeBestAttribSGIX');
  1035. glXHyperpipeAttribSGIX := gl_GetProc('glXHyperpipeAttribSGIX');
  1036. glXQueryHyperpipeAttribSGIX := gl_GetProc('glXQueryHyperpipeAttribSGIX');
  1037. end;
  1038. {$EndIf}
  1039. {$ifdef GLX_SGIX_swap_barrier}
  1040. if GLX_SGIX_swap_barrier then
  1041. begin
  1042. glXBindSwapBarrierSGIX := gl_GetProc('glXBindSwapBarrierSGIX');
  1043. glXQueryMaxSwapBarriersSGIX := gl_GetProc('glXQueryMaxSwapBarriersSGIX');
  1044. end;
  1045. {$EndIf}
  1046. {$ifdef GLX_SGIX_swap_group}
  1047. if GLX_SGIX_swap_group then
  1048. glXJoinSwapGroupSGIX := gl_GetProc('glXJoinSwapGroupSGIX');
  1049. {$EndIf}
  1050. {$ifdef GLX_SGIX_video_resize}
  1051. if GLX_SGIX_video_resize then
  1052. begin
  1053. glXBindChannelToWindowSGIX := gl_GetProc('glXBindChannelToWindowSGIX');
  1054. glXChannelRectSGIX := gl_GetProc('glXChannelRectSGIX');
  1055. glXQueryChannelRectSGIX := gl_GetProc('glXQueryChannelRectSGIX');
  1056. glXQueryChannelDeltasSGIX := gl_GetProc('glXQueryChannelDeltasSGIX');
  1057. glXChannelRectSyncSGIX := gl_GetProc('glXChannelRectSyncSGIX');
  1058. end;
  1059. {$EndIf}
  1060. {$ifdef GLX_SGIX_video_source}
  1061. if GLX_SGIX_video_source then
  1062. begin
  1063. glXCreateGLXVideoSourceSGIX := gl_GetProc('glXCreateGLXVideoSourceSGIX');
  1064. glXDestroyGLXVideoSourceSGIX := gl_GetProc('glXDestroyGLXVideoSourceSGIX');
  1065. end;
  1066. {$EndIf}
  1067. {$ifdef GLX_SGI_cushion}
  1068. if GLX_SGI_cushion then
  1069. glXCushionSGI := gl_GetProc('glXCushionSGI');
  1070. {$EndIf}
  1071. {$ifdef GLX_SGI_make_current_read}
  1072. if GLX_SGI_make_current_read then
  1073. begin
  1074. glXMakeCurrentReadSGI := gl_GetProc('glXMakeCurrentReadSGI');
  1075. glXGetCurrentReadDrawableSGI := gl_GetProc('glXGetCurrentReadDrawableSGI');
  1076. end;
  1077. {$EndIf}
  1078. {$ifdef GLX_SGI_video_sync}
  1079. if GLX_SGI_video_sync then
  1080. begin
  1081. glXGetVideoSyncSGI := gl_GetProc('glXGetVideoSyncSGI');
  1082. glXWaitVideoSyncSGI := gl_GetProc('glXWaitVideoSyncSGI');
  1083. end;
  1084. {$EndIf}
  1085. {$ifdef GLX_SUN_get_transparent_index}
  1086. if GLX_SUN_get_transparent_index then
  1087. glXGetTransparentIndexSUN := gl_GetProc('glXGetTransparentIndexSUN');
  1088. {$EndIf}
  1089. {$ifdef GLX_SGIX_fbconfig}
  1090. if GLX_SGIX_fbconfig then
  1091. begin
  1092. glXGetFBConfigAttribSGIX := gl_GetProc('glXGetFBConfigAttribSGIX');
  1093. // glXChooseFBConfigSGIX := gl_GetProc('glXChooseFBConfigSGIX');
  1094. glXCreateGLXPixmapWithConfigSGIX := gl_GetProc('glXCreateGLXPixmapWithConfigSGIX');
  1095. glXCreateContextWithConfigSGIX := gl_GetProc('glXCreateContextWithConfigSGIX');
  1096. // glXGetVisualFromFBConfigSGIX := gl_GetProc('glXGetVisualFromFBConfigSGIX');
  1097. glXGetFBConfigFromVisualSGIX := gl_GetProc('glXGetFBConfigFromVisualSGIX');
  1098. end;
  1099. {$EndIf}
  1100. (* {$IfDef GLX_SGI_swap_control}
  1101. glXSwapIntervalSGI := gl_GetProc('glXSwapIntervalSGI');
  1102. {$EndIf}
  1103. {$IfDef GLX_VERSION_1_3}
  1104. glXCreatePbuffer := gl_GetProc('glXCreatePbuffer');
  1105. glXDestroyPbuffer := gl_GetProc('glXDestroyPbuffer');
  1106. {$EndIf} *)
  1107. {$ifdef GLX_SGIX_pbuffer}
  1108. if GLX_SGIX_pbuffer then
  1109. begin
  1110. { glXCreateGLXPbufferSGIX := gl_GetProc('glXCreateGLXPbufferSGIX');
  1111. glXDestroyGLXPbufferSGIX := gl_GetProc('glXDestroyGLXPbufferSGIX'); }
  1112. glXQueryGLXPbufferSGIX := gl_GetProc('glXQueryGLXPbufferSGIX');
  1113. glXSelectEventSGIX := gl_GetProc('glXSelectEventSGIX');
  1114. glXGetSelectedEventSGIX := gl_GetProc('glXGetSelectedEventSGIX');
  1115. end;
  1116. {$EndIf}
  1117. {$EndIf}
  1118. {$IfDef WINDOWS}
  1119. { wglCopyContext := gl_GetProc('wglCopyContext');
  1120. wglCreateContext := gl_GetProc('wglCreateContext');
  1121. wglCreateLayerContext := gl_GetProc('wglCreateLayerContext');
  1122. wglDeleteContext := gl_GetProc('wglDeleteContext');
  1123. wglDescribeLayerPlane := gl_GetProc('wglDescribeLayerPlane');
  1124. wglGetCurrentContext := gl_GetProc('wglGetCurrentContext');
  1125. wglGetCurrentDC := gl_GetProc('wglGetCurrentDC');
  1126. wglGetLayerPaletteEntries := gl_GetProc('wglGetLayerPaletteEntries');
  1127. wglMakeCurrent := gl_GetProc('wglMakeCurrent');
  1128. wglRealizeLayerPalette := gl_GetProc('wglRealizeLayerPalette');
  1129. wglSetLayerPaletteEntries := gl_GetProc('wglSetLayerPaletteEntries');
  1130. wglShareLists := gl_GetProc('wglShareLists');
  1131. wglSwapLayerBuffers := gl_GetProc('wglSwapLayerBuffers');
  1132. wglUseFontBitmaps := gl_GetProc('wglUseFontBitmaps');
  1133. wglUseFontBitmapsW := gl_GetProc('wglUseFontBitmapsW');
  1134. wglUseFontBitmapsA := gl_GetProc('wglUseFontBitmapsA');
  1135. wglUseFontOutlines := gl_GetProc('wglUseFontOutlines');
  1136. wglUseFontOutlinesA := gl_GetProc('wglUseFontOutlinesA');
  1137. wglUseFontOutlinesW := gl_GetProc('wglUseFontOutlinesW'); }
  1138. {$If defined(WGL_ARB_extensions_string) or defined(WGL_EXT_extensions_string)}
  1139. if WGL_ARB_extensions_string or WGL_EXT_extensions_string then
  1140. wglGetExtensionsStringARB := gl_GetProc('wglGetExtensionsString');
  1141. {$IfEnd}
  1142. {$if defined(WGL_ARB_pixel_format) or defined(WGL_EXT_pixel_format)}
  1143. if WGL_ARB_pixel_format or WGL_EXT_pixel_format then
  1144. begin
  1145. wglChoosePixelFormatARB := gl_GetProc('wglChoosePixelFormat');
  1146. wglGetPixelFormatAttribivARB := gl_GetProc('wglGetPixelFormatAttribiv');
  1147. wglGetPixelFormatAttribfvARB := gl_GetProc('wglGetPixelFormatAttribfv');
  1148. end;
  1149. {$IfEnd}
  1150. {$ifdef WGL_EXT_swap_control}
  1151. if WGL_EXT_swap_control then
  1152. begin
  1153. // wglSwapIntervalEXT := gl_GetProc('wglSwapIntervalEXT');
  1154. wglGetSwapIntervalEXT := gl_GetProc('wglGetSwapIntervalEXT');
  1155. end;
  1156. {$EndIf}
  1157. {$If defined(WGL_ARB_pbuffer) or defined(WGL_EXT_pbuffer)}
  1158. if WGL_ARB_pbuffer or WGL_EXT_pbuffer then
  1159. begin
  1160. wglCreatePbufferARB := gl_GetProc('wglCreatePbuffer');
  1161. // wglGetPbufferDCARB := gl_GetProc('wglGetPbufferDC');
  1162. // wglReleasePbufferDCARB := gl_GetProc('wglReleasePbufferDC');
  1163. // wglDestroyPbufferARB := gl_GetProc('wglDestroyPbuffer');
  1164. // wglQueryPbufferARB := gl_GetProc('wglQueryPbuffer');
  1165. end;
  1166. {$IfEnd}
  1167. {$ifdef WGL_ARB_buffer_region}
  1168. if WGL_ARB_buffer_region then
  1169. begin
  1170. wglCreateBufferRegionARB := gl_GetProc('wglCreateBufferRegionARB');
  1171. wglDeleteBufferRegionARB := gl_GetProc('wglDeleteBufferRegionARB');
  1172. wglSaveBufferRegionARB := gl_GetProc('wglSaveBufferRegionARB');
  1173. wglRestoreBufferRegionARB := gl_GetProc('wglRestoreBufferRegionARB');
  1174. end;
  1175. {$EndIf}
  1176. {$if defined(WGL_ARB_make_current_read) or defined(WGL_EXT_make_current_read)}
  1177. if WGL_ARB_make_current_read or WGL_EXT_make_current_read then
  1178. begin
  1179. wglMakeContextCurrentARB := gl_GetProc('wglMakeContextCurrent');
  1180. wglGetCurrentReadDCARB := gl_GetProc('wglGetCurrentReadDC');
  1181. end;
  1182. {$IfEnd}
  1183. // wglClampColorARB := gl_GetProc('wglClampColorARB');
  1184. {$ifdef WGL_ARB_render_texture}
  1185. if WGL_ARB_render_texture then
  1186. begin
  1187. wglBindTexImageARB := gl_GetProc('wglBindTexImageARB');
  1188. wglReleaseTexImageARB := gl_GetProc('wglReleaseTexImageARB');
  1189. wglSetPbufferAttribARB := gl_GetProc('wglSetPbufferAttribARB');
  1190. end;
  1191. {$EndIf}
  1192. {$ifdef WGL_ARB_create_context}
  1193. if WGL_ARB_create_context then
  1194. wglCreateContextAttribsARB := gl_GetProc('wglCreateContextAttribsARB');
  1195. {$EndIf}
  1196. {$IfDef WGL_AMD_gpu_association}
  1197. if WGL_AMD_gpu_association then
  1198. begin
  1199. wglGetGPUIDsAMD := gl_GetProc('wglGetGPUIDsAMD');
  1200. wglGetGPUInfoAMD := gl_GetProc('wglGetGPUInfoAMD');
  1201. wglGetContextGPUIDAMD := gl_GetProc('wglGetContextGPUIDAMD');
  1202. wglCreateAssociatedContextAMD := gl_GetProc('wglCreateAssociatedContextAMD');
  1203. wglCreateAssociatedContextAttribsAMD := gl_GetProc('wglCreateAssociatedContextAttribsAMD');
  1204. wglDeleteAssociatedContextAMD := gl_GetProc('wglDeleteAssociatedContextAMD');
  1205. wglMakeAssociatedContextCurrentAMD := gl_GetProc('wglMakeAssociatedContextCurrentAMD');
  1206. wglGetCurrentAssociatedContextAMD := gl_GetProc('wglGetCurrentAssociatedContextAMD');
  1207. wglBlitContextFramebufferAMD := gl_GetProc('wglBlitContextFramebufferAMD');
  1208. end;
  1209. {$EndIf}
  1210. {$IfDef WGL_EXT_display_color_table}
  1211. if WGL_EXT_display_color_table then
  1212. begin
  1213. wglCreateDisplayColorTableEXT := gl_GetProc('wglCreateDisplayColorTableEXT');
  1214. wglLoadDisplayColorTableEXT := gl_GetProc('wglLoadDisplayColorTableEXT');
  1215. wglBindDisplayColorTableEXT := gl_GetProc('wglBindDisplayColorTableEXT');
  1216. wglDestroyDisplayColorTableEXT := gl_GetProc('wglDestroyDisplayColorTableEXT');
  1217. end;
  1218. {$EndIf}
  1219. // WGL_EXT_extensions_string
  1220. // wglGetExtensionsStringEXT := gl_GetProc('wglGetExtensionsStringEXT');
  1221. // WGL_EXT_make_current_read
  1222. // wglMakeContextCurrentEXT := gl_GetProc('wglMakeContextCurrentEXT');
  1223. // wglGetCurrentReadDCEXT := gl_GetProc('wglGetCurrentReadDCEXT');
  1224. // WGL_EXT_pixel_format
  1225. // wglGetPixelFormatAttribivEXT := gl_GetProc('wglGetPixelFormatAttribivEXT');
  1226. // wglGetPixelFormatAttribfvEXT := gl_GetProc('wglGetPixelFormatAttribfvEXT');
  1227. // wglChoosePixelFormatEXT := gl_GetProc('wglChoosePixelFormatEXT');
  1228. {$IfDef WGL_I3D_digital_video_control}
  1229. if WGL_I3D_digital_video_control then
  1230. begin
  1231. wglGetDigitalVideoParametersI3D := gl_GetProc('wglGetDigitalVideoParametersI3D');
  1232. wglSetDigitalVideoParametersI3D := gl_GetProc('wglSetDigitalVideoParametersI3D');
  1233. end;
  1234. {$EndIf}
  1235. {$IfDef WGL_I3D_gamma}
  1236. if WGL_I3D_gamma then
  1237. begin
  1238. wglGetGammaTableParametersI3D := gl_GetProc('wglGetGammaTableParametersI3D');
  1239. wglSetGammaTableParametersI3D := gl_GetProc('wglSetGammaTableParametersI3D');
  1240. wglGetGammaTableI3D := gl_GetProc('wglGetGammaTableI3D');
  1241. wglSetGammaTableI3D := gl_GetProc('wglSetGammaTableI3D');
  1242. end;
  1243. {$EndIf}
  1244. {$IfDef WGL_I3D_genlock}
  1245. if WGL_I3D_genlock then
  1246. begin
  1247. wglEnableGenlockI3D := gl_GetProc('wglEnableGenlockI3D');
  1248. wglDisableGenlockI3D := gl_GetProc('wglDisableGenlockI3D');
  1249. wglIsEnabledGenlockI3D := gl_GetProc('wglIsEnabledGenlockI3D');
  1250. wglGenlockSourceI3D := gl_GetProc('wglGenlockSourceI3D');
  1251. wglGetGenlockSourceI3D := gl_GetProc('wglGetGenlockSourceI3D');
  1252. wglGenlockSourceEdgeI3D := gl_GetProc('wglGenlockSourceEdgeI3D');
  1253. wglGetGenlockSourceEdgeI3D := gl_GetProc('wglGetGenlockSourceEdgeI3D');
  1254. wglGenlockSampleRateI3D := gl_GetProc('wglGenlockSampleRateI3D');
  1255. wglGetGenlockSampleRateI3D := gl_GetProc('wglGetGenlockSampleRateI3D');
  1256. wglGenlockSourceDelayI3D := gl_GetProc('wglGenlockSourceDelayI3D');
  1257. wglGetGenlockSourceDelayI3D := gl_GetProc('wglGetGenlockSourceDelayI3D');
  1258. wglQueryGenlockMaxSourceDelayI3D := gl_GetProc('wglQueryGenlockMaxSourceDelayI3D');
  1259. end;
  1260. {$EndIf}
  1261. {$IfDef WGL_I3D_image_buffer}
  1262. if WGL_I3D_image_buffer then
  1263. begin
  1264. wglCreateImageBufferI3D := gl_GetProc('wglCreateImageBufferI3D');
  1265. wglDestroyImageBufferI3D := gl_GetProc('wglDestroyImageBufferI3D');
  1266. wglAssociateImageBufferEventsI3D := gl_GetProc('wglAssociateImageBufferEventsI3D');
  1267. wglReleaseImageBufferEventsI3D := gl_GetProc('wglReleaseImageBufferEventsI3D');
  1268. end;
  1269. {$EndIf}
  1270. {$IfDef WGL_I3D_swap_frame_lock}
  1271. if WGL_I3D_swap_frame_lock then
  1272. begin
  1273. wglEnableFrameLockI3D := gl_GetProc('wglEnableFrameLockI3D');
  1274. wglDisableFrameLockI3D := gl_GetProc('wglDisableFrameLockI3D');
  1275. wglIsEnabledFrameLockI3D := gl_GetProc('wglIsEnabledFrameLockI3D');
  1276. wglQueryFrameLockMasterI3D := gl_GetProc('wglQueryFrameLockMasterI3D');
  1277. end;
  1278. {$EndIf}
  1279. {$IfDef WGL_I3D_swap_frame_usage}
  1280. if WGL_I3D_swap_frame_usage then
  1281. begin
  1282. wglGetFrameUsageI3D := gl_GetProc('wglGetFrameUsageI3D');
  1283. wglBeginFrameTrackingI3D := gl_GetProc('wglBeginFrameTrackingI3D');
  1284. wglEndFrameTrackingI3D := gl_GetProc('wglEndFrameTrackingI3D');
  1285. wglQueryFrameTrackingI3D := gl_GetProc('wglQueryFrameTrackingI3D');
  1286. end;
  1287. {$EndIf}
  1288. {$IfDef WGL_NV_vertex_array_range}
  1289. if WGL_NV_vertex_array_range then
  1290. begin
  1291. wglAllocateMemoryNV := gl_GetProc('wglAllocateMemoryNV');
  1292. wglFreeMemoryNV := gl_GetProc('wglFreeMemoryNV');
  1293. end;
  1294. {$EndIf}
  1295. {$IfDef WGL_NV_present_video}
  1296. if WGL_NV_present_video then
  1297. begin
  1298. wglEnumerateVideoDevicesNV := gl_GetProc('wglEnumerateVideoDevicesNV');
  1299. wglBindVideoDeviceNV := gl_GetProc('wglBindVideoDeviceNV');
  1300. wglQueryCurrentContextNV := gl_GetProc('wglQueryCurrentContextNV');
  1301. end;
  1302. {$EndIf}
  1303. {$IfDef WGL_NV_video_output}
  1304. if WGL_NV_video_output then
  1305. begin
  1306. wglGetVideoDeviceNV := gl_GetProc('wglGetVideoDeviceNV');
  1307. wglReleaseVideoDeviceNV := gl_GetProc('wglReleaseVideoDeviceNV');
  1308. wglBindVideoImageNV := gl_GetProc('wglBindVideoImageNV');
  1309. wglReleaseVideoImageNV := gl_GetProc('wglReleaseVideoImageNV');
  1310. wglSendPbufferToVideoNV := gl_GetProc('wglSendPbufferToVideoNV');
  1311. wglGetVideoInfoNV := gl_GetProc('wglGetVideoInfoNV');
  1312. end;
  1313. {$EndIf}
  1314. {$IfDef WGL_NV_swap_group}
  1315. if WGL_NV_swap_group then
  1316. begin
  1317. wglJoinSwapGroupNV := gl_GetProc('wglJoinSwapGroupNV');
  1318. wglBindSwapBarrierNV := gl_GetProc('wglBindSwapBarrierNV');
  1319. wglQuerySwapGroupNV := gl_GetProc('wglQuerySwapGroupNV');
  1320. wglQueryMaxSwapGroupsNV := gl_GetProc('wglQueryMaxSwapGroupsNV');
  1321. wglQueryFrameCountNV := gl_GetProc('wglQueryFrameCountNV');
  1322. wglResetFrameCountNV := gl_GetProc('wglResetFrameCountNV');
  1323. end;
  1324. {$EndIf}
  1325. {$IfDef WGL_NV_gpu_affinity}
  1326. if WGL_NV_gpu_affinity then
  1327. begin
  1328. wglEnumGpusNV := gl_GetProc('wglEnumGpusNV');
  1329. wglEnumGpuDevicesNV := gl_GetProc('wglEnumGpuDevicesNV');
  1330. wglCreateAffinityDCNV := gl_GetProc('wglCreateAffinityDCNV');
  1331. wglEnumGpusFromAffinityDCNV := gl_GetProc('wglEnumGpusFromAffinityDCNV');
  1332. wglDeleteDCNV := gl_GetProc('wglDeleteDCNV');
  1333. end;
  1334. {$EndIf}
  1335. {$ifdef WGL_NV_video_capture}
  1336. if WGL_NV_video_capture then
  1337. begin
  1338. wglBindVideoCaptureDeviceNV := gl_GetProc('wglBindVideoCaptureDeviceNV');
  1339. wglEnumerateVideoCaptureDevicesNV := gl_GetProc('wglEnumerateVideoCaptureDevicesNV');
  1340. wglLockVideoCaptureDeviceNV := gl_GetProc('wglLockVideoCaptureDeviceNV');
  1341. wglQueryVideoCaptureDeviceNV := gl_GetProc('wglQueryVideoCaptureDeviceNV');
  1342. wglReleaseVideoCaptureDeviceNV := gl_GetProc('wglReleaseVideoCaptureDeviceNV');
  1343. end;
  1344. {$EndIf}
  1345. {$IfDef WGL_NV_copy_image}
  1346. if WGL_NV_copy_image then
  1347. wglCopyImageSubDataNV := gl_GetProc('wglCopyImageSubDataNV');
  1348. {$EndIf}
  1349. {$ifdef WGL_NV_delay_before_swap}
  1350. if WGL_NV_delay_before_swap then
  1351. wglDelayBeforeSwapNV := gl_GetProc('wglDelayBeforeSwapNV');
  1352. {$EndIf}
  1353. {$IfDef WGL_NV_DX_interop}
  1354. if WGL_NV_DX_interop then
  1355. begin
  1356. wglDXSetResourceShareHandleNV := gl_GetProc('wglDXSetResourceShareHandleNV');
  1357. wglDXOpenDeviceNV := gl_GetProc('wglDXOpenDeviceNV');
  1358. wglDXCloseDeviceNV := gl_GetProc('wglDXCloseDeviceNV');
  1359. wglDXRegisterObjectNV := gl_GetProc('wglDXRegisterObjectNV');
  1360. wglDXUnregisterObjectNV := gl_GetProc('wglDXUnregisterObjectNV');
  1361. wglDXObjectAccessNV := gl_GetProc('wglDXObjectAccessNV');
  1362. wglDXLockObjectsNV := gl_GetProc('wglDXLockObjectsNV');
  1363. wglDXUnlockObjectsNV := gl_GetProc('wglDXUnlockObjectsNV');
  1364. end;
  1365. {$EndIf}
  1366. {$IfDef WGL_OML_sync_control}
  1367. if WGL_OML_sync_control then
  1368. begin
  1369. wglGetSyncValuesOML := gl_GetProc('wglGetSyncValuesOML');
  1370. wglGetMscRateOML := gl_GetProc('wglGetMscRateOML');
  1371. wglSwapBuffersMscOML := gl_GetProc('wglSwapBuffersMscOML');
  1372. wglSwapLayerBuffersMscOML := gl_GetProc('wglSwapLayerBuffersMscOML');
  1373. wglWaitForMscOML := gl_GetProc('wglWaitForMscOML');
  1374. wglWaitForSbcOML := gl_GetProc('wglWaitForSbcOML');
  1375. end;
  1376. {$EndIf}
  1377. {$IfDef WGL_3DL_stereo_control}
  1378. if WGL_3DL_stereo_control then
  1379. wglSetStereoEmitterState3DL := gl_GetProc('wglSetStereoEmitterState3DL');
  1380. {$EndIf}
  1381. {$EndIf}
  1382. end;
  1383. end.