| 1 |
{ |
| 2 |
Copyright 2023-2023 Michalis Kamburelis, Benjamin 'BeRo' Rosseaux, The Khronos Group. |
| 3 |
|
| 4 |
This file is part of "Castle Game Engine". |
| 5 |
|
| 6 |
"Castle Game Engine" is free software; see the file COPYING.txt, |
| 7 |
included in this distribution, for details about the copyright. |
| 8 |
|
| 9 |
"Castle Game Engine" is distributed in the hope that it will be useful, |
| 10 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 12 |
|
| 13 |
---------------------------------------------------------------------------- |
| 14 |
The original code from BeRo has GLES 2.0 + EGL combined, |
| 15 |
we split EGL into a separate unit in Castle Game Engine, as |
| 16 |
- EGL makes sense also for OpenGL (not ES). |
| 17 |
- it is conceptually a different library - EGL initializes context, |
| 18 |
like glX or wgl. It is separate from OpenGLES concepts. |
| 19 |
- Along with it, we made a few improvements in CGE: |
| 20 |
compatibility with FreeBSD, |
| 21 |
compatibility with Delphi, |
| 22 |
usage of our cross-platform and cross-compiler TDynLib. |
| 23 |
|
| 24 |
---------------------------------------------------------------------------- |
| 25 |
Original headers: |
| 26 |
|
| 27 |
Copyright (c) 2007-2009 The Khronos Group Inc. |
| 28 |
|
| 29 |
Permission is hereby granted, free of charge, to any person obtaining a |
| 30 |
copy of this software and/or associated documentation files (the |
| 31 |
"Materials"), to deal in the Materials without restriction, including |
| 32 |
without limitation the rights to use, copy, modify, merge, publish, |
| 33 |
distribute, sublicense, and/or sell copies of the Materials, and to |
| 34 |
permit persons to whom the Materials are furnished to do so, subject to |
| 35 |
the following conditions: |
| 36 |
|
| 37 |
The above copyright notice and this permission notice shall be included |
| 38 |
in all copies or substantial portions of the Materials. |
| 39 |
|
| 40 |
THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |
| 41 |
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |
| 42 |
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. |
| 43 |
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY |
| 44 |
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, |
| 45 |
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE |
| 46 |
MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. |
| 47 |
|
| 48 |
---------------------------------------------------------------------------- |
| 49 |
} |
| 50 |
|
| 51 |
{ EGL, a cross-platform library to initialize OpenGL and OpenGLES contexts. } |
| 52 |
unit CastleInternalEgl; |
| 53 |
|
| 54 |
{$i castleconf.inc} |
| 55 |
|
| 56 |
{$ifdef FPC} |
| 57 |
{$packrecords C} |
| 58 |
{$endif} |
| 59 |
|
| 60 |
interface |
| 61 |
|
| 62 |
uses CTypes, SysUtils |
| 63 |
{$ifdef UNIX_WITH_X}, X, XLib {$endif} |
| 64 |
{$ifdef MSWINDOWS}, Windows {$endif}; |
| 65 |
|
| 66 |
type |
| 67 |
PEGLConfig = ^EGLConfig; |
| 68 |
PEGLint = ^EGLint; |
| 69 |
EGLint = CInt32; |
| 70 |
EGLConfig = pointer; |
| 71 |
|
| 72 |
{$if defined(UNIX_WITH_X)} |
| 73 |
{ Xlib types that are needed by EGL. |
| 74 |
Match EGL/eglplatform.h from Khronos: |
| 75 |
|
| 76 |
typedef Display *EGLNativeDisplayType; |
| 77 |
typedef Pixmap EGLNativePixmapType; |
| 78 |
typedef Window EGLNativeWindowType; |
| 79 |
|
| 80 |
Note that TWindow and TPixmap sizes match also Pointer type, |
| 81 |
i.e. X headers declare them as 32-bit on 32-bit CPUs, |
| 82 |
and 64-bit on 64-bit CPUs. |
| 83 |
See tests/egl_sizes_test . |
| 84 |
See TTestCastleInternalEgl.TestEglTypeSizes . |
| 85 |
|
| 86 |
This is nice, it makes things safe -- at means that at binary |
| 87 |
(ABI) level, EGL calls accept the same sizes for these arguments, |
| 88 |
whether they are compiled to be aliases to X types or to be aliases to |
| 89 |
just pointers. |
| 90 |
} |
| 91 |
EGLNativeDisplayType = PDisplay; |
| 92 |
EGLNativeWindowType = TWindow; |
| 93 |
EGLNativePixmapType = TPixmap; |
| 94 |
{$elseif defined(MSWINDOWS)} |
| 95 |
{ WinAPI types that are needed by EGL. |
| 96 |
Match EGL/eglplatform.h from Khronos: |
| 97 |
|
| 98 |
typedef HDC EGLNativeDisplayType; |
| 99 |
typedef HBITMAP EGLNativePixmapType; |
| 100 |
typedef HWND EGLNativeWindowType; |
| 101 |
|
| 102 |
Note that all these native Windows handles are aliases to System.THandle, |
| 103 |
which is 32-bit on 32-bit CPUs, and 64-bit on 64-bit CPUs. |
| 104 |
This is nice, it makes things safe -- at means that at binary |
| 105 |
(ABI) level, EGL calls accept the same sizes for these arguments, |
| 106 |
whether they are compiled to be aliases to WinAPI types or to be aliases to |
| 107 |
just pointers. |
| 108 |
} |
| 109 |
EGLNativeDisplayType = HDC; |
| 110 |
EGLNativeWindowType = HWND; |
| 111 |
EGLNativePixmapType = HBITMAP; |
| 112 |
{$else} |
| 113 |
{ Cross-platform generic definition of EGL types. |
| 114 |
Match EGL/eglplatform.h from Khronos: |
| 115 |
|
| 116 |
#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES) |
| 117 |
typedef void *EGLNativeDisplayType; |
| 118 |
typedef void *EGLNativePixmapType; |
| 119 |
typedef void *EGLNativeWindowType; |
| 120 |
} |
| 121 |
EGLNativeDisplayType = Pointer; |
| 122 |
EGLNativeWindowType = Pointer; |
| 123 |
EGLNativePixmapType = Pointer; |
| 124 |
{$endif} |
| 125 |
|
| 126 |
EGLBoolean = CUint32; |
| 127 |
EGLenum = CUint32; |
| 128 |
EGLContext = pointer; |
| 129 |
EGLDisplay = pointer; |
| 130 |
EGLSurface = pointer; |
| 131 |
EGLClientBuffer = pointer; |
| 132 |
|
| 133 |
{ EGL Versioning } |
| 134 |
const |
| 135 |
EGL_VERSION_1_0 = 1; |
| 136 |
EGL_VERSION_1_1 = 1; |
| 137 |
EGL_VERSION_1_2 = 1; |
| 138 |
EGL_VERSION_1_3 = 1; |
| 139 |
EGL_VERSION_1_4 = 1; |
| 140 |
{ EGL Enumerants. Bitmasks and other exceptional cases aside, most |
| 141 |
* enums are assigned unique values starting at 0x3000. |
| 142 |
} |
| 143 |
{ EGL aliases } |
| 144 |
EGL_FALSE = 0; |
| 145 |
EGL_TRUE = 1; |
| 146 |
|
| 147 |
{ Out-of-band handle values } |
| 148 |
{ was #define dname def_expr } |
| 149 |
function EGL_DEFAULT_DISPLAY : EGLNativeDisplayType; |
| 150 |
|
| 151 |
{ was #define dname def_expr } |
| 152 |
function EGL_NO_CONTEXT : EGLContext; |
| 153 |
|
| 154 |
{ was #define dname def_expr } |
| 155 |
function EGL_NO_DISPLAY : EGLDisplay; |
| 156 |
|
| 157 |
{ was #define dname def_expr } |
| 158 |
function EGL_NO_SURFACE : EGLSurface; |
| 159 |
|
| 160 |
{ Out-of-band attribute value } |
| 161 |
{ was #define dname def_expr } |
| 162 |
function EGL_DONT_CARE : EGLint; |
| 163 |
|
| 164 |
{ Errors / GetError return values } |
| 165 |
const |
| 166 |
EGL_SUCCESS = $3000; |
| 167 |
EGL_NOT_INITIALIZED = $3001; |
| 168 |
EGL_BAD_ACCESS = $3002; |
| 169 |
EGL_BAD_ALLOC = $3003; |
| 170 |
EGL_BAD_ATTRIBUTE = $3004; |
| 171 |
EGL_BAD_CONFIG = $3005; |
| 172 |
EGL_BAD_CONTEXT = $3006; |
| 173 |
EGL_BAD_CURRENT_SURFACE = $3007; |
| 174 |
EGL_BAD_DISPLAY = $3008; |
| 175 |
EGL_BAD_MATCH = $3009; |
| 176 |
EGL_BAD_NATIVE_PIXMAP = $300A; |
| 177 |
EGL_BAD_NATIVE_WINDOW = $300B; |
| 178 |
EGL_BAD_PARAMETER = $300C; |
| 179 |
EGL_BAD_SURFACE = $300D; |
| 180 |
{ EGL 1.1 - IMG_power_management } |
| 181 |
EGL_CONTEXT_LOST = $300E; |
| 182 |
{ Reserved 0x300F-0x301F for additional errors } |
| 183 |
{ Config attributes } |
| 184 |
EGL_BUFFER_SIZE = $3020; |
| 185 |
EGL_ALPHA_SIZE = $3021; |
| 186 |
EGL_BLUE_SIZE = $3022; |
| 187 |
EGL_GREEN_SIZE = $3023; |
| 188 |
EGL_RED_SIZE = $3024; |
| 189 |
EGL_DEPTH_SIZE = $3025; |
| 190 |
EGL_STENCIL_SIZE = $3026; |
| 191 |
EGL_CONFIG_CAVEAT = $3027; |
| 192 |
EGL_CONFIG_ID = $3028; |
| 193 |
EGL_LEVEL = $3029; |
| 194 |
EGL_MAX_PBUFFER_HEIGHT = $302A; |
| 195 |
EGL_MAX_PBUFFER_PIXELS = $302B; |
| 196 |
EGL_MAX_PBUFFER_WIDTH = $302C; |
| 197 |
EGL_NATIVE_RENDERABLE = $302D; |
| 198 |
EGL_NATIVE_VISUAL_ID = $302E; |
| 199 |
EGL_NATIVE_VISUAL_TYPE = $302F; |
| 200 |
EGL_PRESERVED_RESOURCES = $3030; |
| 201 |
EGL_SAMPLES = $3031; |
| 202 |
EGL_SAMPLE_BUFFERS = $3032; |
| 203 |
EGL_SURFACE_TYPE = $3033; |
| 204 |
EGL_TRANSPARENT_TYPE = $3034; |
| 205 |
EGL_TRANSPARENT_BLUE_VALUE = $3035; |
| 206 |
EGL_TRANSPARENT_GREEN_VALUE = $3036; |
| 207 |
EGL_TRANSPARENT_RED_VALUE = $3037; |
| 208 |
{ Attrib list terminator } |
| 209 |
EGL_NONE = $3038; |
| 210 |
EGL_BIND_TO_TEXTURE_RGB = $3039; |
| 211 |
EGL_BIND_TO_TEXTURE_RGBA = $303A; |
| 212 |
EGL_MIN_SWAP_INTERVAL = $303B; |
| 213 |
EGL_MAX_SWAP_INTERVAL = $303C; |
| 214 |
EGL_LUMINANCE_SIZE = $303D; |
| 215 |
EGL_ALPHA_MASK_SIZE = $303E; |
| 216 |
EGL_COLOR_BUFFER_TYPE = $303F; |
| 217 |
EGL_RENDERABLE_TYPE = $3040; |
| 218 |
{ Pseudo-attribute (not queryable) } |
| 219 |
EGL_MATCH_NATIVE_PIXMAP = $3041; |
| 220 |
EGL_CONFORMANT = $3042; |
| 221 |
{ Reserved 0x3041-0x304F for additional config attributes } |
| 222 |
{ Config attribute values } |
| 223 |
{ EGL_CONFIG_CAVEAT value } |
| 224 |
EGL_SLOW_CONFIG = $3050; |
| 225 |
{ EGL_CONFIG_CAVEAT value } |
| 226 |
EGL_NON_CONFORMANT_CONFIG = $3051; |
| 227 |
{ EGL_TRANSPARENT_TYPE value } |
| 228 |
EGL_TRANSPARENT_RGB = $3052; |
| 229 |
{ EGL_COLOR_BUFFER_TYPE value } |
| 230 |
EGL_RGB_BUFFER = $308E; |
| 231 |
{ EGL_COLOR_BUFFER_TYPE value } |
| 232 |
EGL_LUMINANCE_BUFFER = $308F; |
| 233 |
{ More config attribute values, for EGL_TEXTURE_FORMAT } |
| 234 |
EGL_NO_TEXTURE = $305C; |
| 235 |
EGL_TEXTURE_RGB = $305D; |
| 236 |
EGL_TEXTURE_RGBA = $305E; |
| 237 |
EGL_TEXTURE_2D = $305F; |
| 238 |
{ Config attribute mask bits } |
| 239 |
{ EGL_SURFACE_TYPE mask bits } |
| 240 |
EGL_PBUFFER_BIT = $0001; |
| 241 |
{ EGL_SURFACE_TYPE mask bits } |
| 242 |
EGL_PIXMAP_BIT = $0002; |
| 243 |
{ EGL_SURFACE_TYPE mask bits } |
| 244 |
EGL_WINDOW_BIT = $0004; |
| 245 |
{ EGL_SURFACE_TYPE mask bits } |
| 246 |
EGL_VG_COLORSPACE_LINEAR_BIT = $0020; |
| 247 |
{ EGL_SURFACE_TYPE mask bits } |
| 248 |
EGL_VG_ALPHA_FORMAT_PRE_BIT = $0040; |
| 249 |
{ EGL_SURFACE_TYPE mask bits } |
| 250 |
EGL_MULTISAMPLE_RESOLVE_BOX_BIT = $0200; |
| 251 |
{ EGL_SURFACE_TYPE mask bits } |
| 252 |
EGL_SWAP_BEHAVIOR_PRESERVED_BIT = $0400; |
| 253 |
{ EGL_RENDERABLE_TYPE mask bits } |
| 254 |
EGL_OPENGL_ES_BIT = $0001; |
| 255 |
{ EGL_RENDERABLE_TYPE mask bits } |
| 256 |
EGL_OPENVG_BIT = $0002; |
| 257 |
{ EGL_RENDERABLE_TYPE mask bits } |
| 258 |
EGL_OPENGL_ES2_BIT = $0004; |
| 259 |
{ EGL_RENDERABLE_TYPE mask bits } |
| 260 |
EGL_OPENGL_BIT = $0008; |
| 261 |
{ QueryString targets } |
| 262 |
EGL_VENDOR = $3053; |
| 263 |
EGL_VERSION = $3054; |
| 264 |
EGL_EXTENSIONS = $3055; |
| 265 |
EGL_CLIENT_APIS = $308D; |
| 266 |
{ QuerySurface / SurfaceAttrib / CreatePbufferSurface targets } |
| 267 |
EGL_HEIGHT = $3056; |
| 268 |
EGL_WIDTH = $3057; |
| 269 |
EGL_LARGEST_PBUFFER = $3058; |
| 270 |
EGL_TEXTURE_FORMAT = $3080; |
| 271 |
EGL_TEXTURE_TARGET = $3081; |
| 272 |
EGL_MIPMAP_TEXTURE = $3082; |
| 273 |
EGL_MIPMAP_LEVEL = $3083; |
| 274 |
EGL_RENDER_BUFFER = $3086; |
| 275 |
EGL_VG_COLORSPACE = $3087; |
| 276 |
EGL_VG_ALPHA_FORMAT = $3088; |
| 277 |
EGL_HORIZONTAL_RESOLUTION = $3090; |
| 278 |
EGL_VERTICAL_RESOLUTION = $3091; |
| 279 |
EGL_PIXEL_ASPECT_RATIO = $3092; |
| 280 |
EGL_SWAP_BEHAVIOR = $3093; |
| 281 |
EGL_MULTISAMPLE_RESOLVE = $3099; |
| 282 |
{ EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets } |
| 283 |
EGL_BACK_BUFFER = $3084; |
| 284 |
EGL_SINGLE_BUFFER = $3085; |
| 285 |
{ OpenVG color spaces } |
| 286 |
{ EGL_VG_COLORSPACE value } |
| 287 |
EGL_VG_COLORSPACE_sRGB = $3089; |
| 288 |
{ EGL_VG_COLORSPACE value } |
| 289 |
EGL_VG_COLORSPACE_LINEAR = $308A; |
| 290 |
{ OpenVG alpha formats } |
| 291 |
{ EGL_ALPHA_FORMAT value } |
| 292 |
EGL_VG_ALPHA_FORMAT_NONPRE = $308B; |
| 293 |
{ EGL_ALPHA_FORMAT value } |
| 294 |
EGL_VG_ALPHA_FORMAT_PRE = $308C; |
| 295 |
{ Constant scale factor by which fractional display resolutions & |
| 296 |
aspect ratio are scaled when queried as integer values. |
| 297 |
} |
| 298 |
EGL_DISPLAY_SCALING = 10000; |
| 299 |
|
| 300 |
{ Constants added in EGL 1.5 (check at runtime EGL version to make sure |
| 301 |
these are safe to use!) } |
| 302 |
EGL_CONTEXT_MAJOR_VERSION = $3098; |
| 303 |
EGL_CONTEXT_MINOR_VERSION = $30FB; |
| 304 |
EGL_CONTEXT_OPENGL_PROFILE_MASK = $30FD; |
| 305 |
EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY = $31BD; |
| 306 |
EGL_NO_RESET_NOTIFICATION = $31BE; |
| 307 |
EGL_LOSE_CONTEXT_ON_RESET = $31BF; |
| 308 |
EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT = $00000001; |
| 309 |
EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT = $00000002; |
| 310 |
EGL_CONTEXT_OPENGL_DEBUG = $31B0; |
| 311 |
EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE = $31B1; |
| 312 |
EGL_CONTEXT_OPENGL_ROBUST_ACCESS = $31B2; |
| 313 |
EGL_OPENGL_ES3_BIT = $00000040; |
| 314 |
EGL_CL_EVENT_HANDLE = $309C; |
| 315 |
EGL_SYNC_CL_EVENT = $30FE; |
| 316 |
EGL_SYNC_CL_EVENT_COMPLETE = $30FF; |
| 317 |
EGL_SYNC_PRIOR_COMMANDS_COMPLETE = $30F0; |
| 318 |
EGL_SYNC_TYPE = $30F7; |
| 319 |
EGL_SYNC_STATUS = $30F1; |
| 320 |
EGL_SYNC_CONDITION = $30F8; |
| 321 |
EGL_SIGNALED = $30F2; |
| 322 |
EGL_UNSIGNALED = $30F3; |
| 323 |
EGL_SYNC_FLUSH_COMMANDS_BIT = $0001; |
| 324 |
//EGL_FOREVER = $FFFFFFFFFFFFFFFFull; |
| 325 |
EGL_TIMEOUT_EXPIRED = $30F5; |
| 326 |
EGL_CONDITION_SATISFIED = $30F6; |
| 327 |
//EGL_NO_SYNC = EGL_CAST(EGLSync,0= ); |
| 328 |
EGL_SYNC_FENCE = $30F9; |
| 329 |
EGL_GL_COLORSPACE = $309D; |
| 330 |
EGL_GL_COLORSPACE_SRGB = $3089; |
| 331 |
EGL_GL_COLORSPACE_LINEAR = $308A; |
| 332 |
EGL_GL_RENDERBUFFER = $30B9; |
| 333 |
EGL_GL_TEXTURE_2D = $30B1; |
| 334 |
EGL_GL_TEXTURE_LEVEL = $30BC; |
| 335 |
EGL_GL_TEXTURE_3D = $30B2; |
| 336 |
EGL_GL_TEXTURE_ZOFFSET = $30BD; |
| 337 |
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X = $30B3; |
| 338 |
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X = $30B4; |
| 339 |
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y = $30B5; |
| 340 |
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = $30B6; |
| 341 |
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z = $30B7; |
| 342 |
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = $30B8; |
| 343 |
EGL_IMAGE_PRESERVED = $30D2; |
| 344 |
//EGL_NO_IMAGE = EGL_CAST(EGLImage,0); |
| 345 |
|
| 346 |
{ Unknown display resolution/aspect ratio } |
| 347 |
{ was #define dname def_expr } |
| 348 |
function EGL_UNKNOWN : EGLint; |
| 349 |
|
| 350 |
{ Back buffer swap behaviors } |
| 351 |
{ EGL_SWAP_BEHAVIOR value } |
| 352 |
|
| 353 |
const |
| 354 |
EGL_BUFFER_PRESERVED = $3094; |
| 355 |
{ EGL_SWAP_BEHAVIOR value } |
| 356 |
EGL_BUFFER_DESTROYED = $3095; |
| 357 |
{ CreatePbufferFromClientBuffer buffer types } |
| 358 |
EGL_OPENVG_IMAGE = $3096; |
| 359 |
{ QueryContext targets } |
| 360 |
EGL_CONTEXT_CLIENT_TYPE = $3097; |
| 361 |
{ CreateContext attributes } |
| 362 |
EGL_CONTEXT_CLIENT_VERSION = $3098; |
| 363 |
{ Multisample resolution behaviors } |
| 364 |
{ EGL_MULTISAMPLE_RESOLVE value } |
| 365 |
EGL_MULTISAMPLE_RESOLVE_DEFAULT = $309A; |
| 366 |
{ EGL_MULTISAMPLE_RESOLVE value } |
| 367 |
EGL_MULTISAMPLE_RESOLVE_BOX = $309B; |
| 368 |
{ BindAPI/QueryAPI targets } |
| 369 |
EGL_OPENGL_ES_API = $30A0; |
| 370 |
EGL_OPENVG_API = $30A1; |
| 371 |
EGL_OPENGL_API = $30A2; |
| 372 |
{ GetCurrentSurface targets } |
| 373 |
EGL_DRAW = $3059; |
| 374 |
EGL_READ = $305A; |
| 375 |
{ WaitNative engines } |
| 376 |
EGL_CORE_NATIVE_ENGINE = $305B; |
| 377 |
{ EGL 1.2 tokens renamed for consistency in EGL 1.3 } |
| 378 |
EGL_COLORSPACE = EGL_VG_COLORSPACE; |
| 379 |
EGL_ALPHA_FORMAT = EGL_VG_ALPHA_FORMAT; |
| 380 |
EGL_COLORSPACE_sRGB = EGL_VG_COLORSPACE_sRGB; |
| 381 |
EGL_COLORSPACE_LINEAR = EGL_VG_COLORSPACE_LINEAR; |
| 382 |
EGL_ALPHA_FORMAT_NONPRE = EGL_VG_ALPHA_FORMAT_NONPRE; |
| 383 |
EGL_ALPHA_FORMAT_PRE = EGL_VG_ALPHA_FORMAT_PRE; |
| 384 |
{ EGL extensions must request enum blocks from the Khronos |
| 385 |
API Registrar, who maintains the enumerant registry. Submit |
| 386 |
a bug in Khronos Bugzilla against task "Registry". |
| 387 |
} |
| 388 |
|
| 389 |
{ EGL Functions } |
| 390 |
var |
| 391 |
eglGetError : function:EGLint;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 392 |
eglGetDisplay : function(display_id:EGLNativeDisplayType):EGLDisplay;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 393 |
eglInitialize : function(dpy:EGLDisplay; major:pEGLint; minor:pEGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 394 |
eglTerminate : function(dpy:EGLDisplay):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 395 |
(* Const before type ignored *) |
| 396 |
eglQueryString : function(dpy:EGLDisplay; name:EGLint):PAnsiChar;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 397 |
eglGetConfigs : function(dpy:EGLDisplay; configs:pEGLConfig; config_size:EGLint; num_config:pEGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 398 |
(* Const before type ignored *) |
| 399 |
eglChooseConfig : function(dpy:EGLDisplay; attrib_list:pEGLint; configs:pEGLConfig; config_size:EGLint; num_config:pEGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 400 |
eglGetConfigAttrib : function(dpy:EGLDisplay; config:EGLConfig; attribute:EGLint; value:pEGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 401 |
(* Const before type ignored *) |
| 402 |
eglCreateWindowSurface : function(dpy:EGLDisplay; config:EGLConfig; win:EGLNativeWindowType; attrib_list:pEGLint):EGLSurface;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 403 |
(* Const before type ignored *) |
| 404 |
eglCreatePbufferSurface : function(dpy:EGLDisplay; config:EGLConfig; attrib_list:pEGLint):EGLSurface;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 405 |
(* Const before type ignored *) |
| 406 |
eglCreatePixmapSurface : function(dpy:EGLDisplay; config:EGLConfig; pixmap:EGLNativePixmapType; attrib_list:pEGLint):EGLSurface;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 407 |
eglDestroySurface : function(dpy:EGLDisplay; surface:EGLSurface):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 408 |
eglQuerySurface : function(dpy:EGLDisplay; surface:EGLSurface; attribute:EGLint; value:pEGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 409 |
eglBindAPI : function(api:EGLenum):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 410 |
eglQueryAPI : function:EGLenum;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 411 |
eglWaitClient : function:EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 412 |
eglReleaseThread : function:EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 413 |
(* Const before type ignored *) |
| 414 |
eglCreatePbufferFromClientBuffer : function(dpy:EGLDisplay; buftype:EGLenum; buffer:EGLClientBuffer; config:EGLConfig; attrib_list:pEGLint):EGLSurface;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 415 |
eglSurfaceAttrib : function(dpy:EGLDisplay; surface:EGLSurface; attribute:EGLint; value:EGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 416 |
eglBindTexImage : function(dpy:EGLDisplay; surface:EGLSurface; buffer:EGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 417 |
eglReleaseTexImage : function(dpy:EGLDisplay; surface:EGLSurface; buffer:EGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 418 |
eglSwapInterval : function(dpy:EGLDisplay; interval:EGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 419 |
(* Const before type ignored *) |
| 420 |
eglCreateContext : function(dpy:EGLDisplay; config:EGLConfig; share_context:EGLContext; attrib_list:pEGLint):EGLContext;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 421 |
eglDestroyContext : function(dpy:EGLDisplay; ctx:EGLContext):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 422 |
eglMakeCurrent : function(dpy:EGLDisplay; draw:EGLSurface; read:EGLSurface; ctx:EGLContext):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 423 |
eglGetCurrentContext : function:EGLContext;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 424 |
eglGetCurrentSurface : function(readdraw:EGLint):EGLSurface;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 425 |
eglGetCurrentDisplay : function:EGLDisplay;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 426 |
eglQueryContext : function(dpy:EGLDisplay; ctx:EGLContext; attribute:EGLint; value:pEGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 427 |
eglWaitGL : function:EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 428 |
eglWaitNative : function(engine:EGLint):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 429 |
eglSwapBuffers : function(dpy:EGLDisplay; surface:EGLSurface):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 430 |
eglCopyBuffers : function(dpy:EGLDisplay; surface:EGLSurface; target:EGLNativePixmapType):EGLBoolean;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 431 |
|
| 432 |
(* Const before type ignored *) |
| 433 |
var |
| 434 |
eglGetProcAddress : function(procname:PAnsiChar):Pointer;{$ifdef windows}stdcall;{$else}cdecl;{$endif} |
| 435 |
|
| 436 |
const |
| 437 |
{ Header file version number } |
| 438 |
{ Current version at http://www.khronos.org/registry/egl/ } |
| 439 |
EGL_EGLEXT_VERSION = 3; |
| 440 |
EGL_KHR_config_attribs = 1; |
| 441 |
{ EGLConfig attribute } |
| 442 |
EGL_CONFORMANT_KHR = $3042; |
| 443 |
{ EGL_SURFACE_TYPE bitfield } |
| 444 |
EGL_VG_COLORSPACE_LINEAR_BIT_KHR = $0020; |
| 445 |
{ EGL_SURFACE_TYPE bitfield } |
| 446 |
EGL_VG_ALPHA_FORMAT_PRE_BIT_KHR = $0040; |
| 447 |
EGL_KHR_lock_surface = 1; |
| 448 |
{ EGL_LOCK_USAGE_HINT_KHR bitfield } |
| 449 |
EGL_READ_SURFACE_BIT_KHR = $0001; |
| 450 |
{ EGL_LOCK_USAGE_HINT_KHR bitfield } |
| 451 |
EGL_WRITE_SURFACE_BIT_KHR = $0002; |
| 452 |
{ EGL_SURFACE_TYPE bitfield } |
| 453 |
EGL_LOCK_SURFACE_BIT_KHR = $0080; |
| 454 |
{ EGL_SURFACE_TYPE bitfield } |
| 455 |
EGL_OPTIMAL_FORMAT_BIT_KHR = $0100; |
| 456 |
{ EGLConfig attribute } |
| 457 |
EGL_MATCH_FORMAT_KHR = $3043; |
| 458 |
{ EGL_MATCH_FORMAT_KHR value } |
| 459 |
EGL_FORMAT_RGB_565_EXACT_KHR = $30C0; |
| 460 |
{ EGL_MATCH_FORMAT_KHR value } |
| 461 |
EGL_FORMAT_RGB_565_KHR = $30C1; |
| 462 |
{ EGL_MATCH_FORMAT_KHR value } |
| 463 |
EGL_FORMAT_RGBA_8888_EXACT_KHR = $30C2; |
| 464 |
{ EGL_MATCH_FORMAT_KHR value } |
| 465 |
EGL_FORMAT_RGBA_8888_KHR = $30C3; |
| 466 |
{ eglLockSurfaceKHR attribute } |
| 467 |
EGL_MAP_PRESERVE_PIXELS_KHR = $30C4; |
| 468 |
{ eglLockSurfaceKHR attribute } |
| 469 |
EGL_LOCK_USAGE_HINT_KHR = $30C5; |
| 470 |
{ eglQuerySurface attribute } |
| 471 |
EGL_BITMAP_POINTER_KHR = $30C6; |
| 472 |
{ eglQuerySurface attribute } |
| 473 |
EGL_BITMAP_PITCH_KHR = $30C7; |
| 474 |
{ eglQuerySurface attribute } |
| 475 |
EGL_BITMAP_ORIGIN_KHR = $30C8; |
| 476 |
{ eglQuerySurface attribute } |
| 477 |
EGL_BITMAP_PIXEL_RED_OFFSET_KHR = $30C9; |
| 478 |
{ eglQuerySurface attribute } |
| 479 |
EGL_BITMAP_PIXEL_GREEN_OFFSET_KHR = $30CA; |
| 480 |
{ eglQuerySurface attribute } |
| 481 |
EGL_BITMAP_PIXEL_BLUE_OFFSET_KHR = $30CB; |
| 482 |
{ eglQuerySurface attribute } |
| 483 |
EGL_BITMAP_PIXEL_ALPHA_OFFSET_KHR = $30CC; |
| 484 |
{ eglQuerySurface attribute } |
| 485 |
EGL_BITMAP_PIXEL_LUMINANCE_OFFSET_KHR = $30CD; |
| 486 |
{ EGL_BITMAP_ORIGIN_KHR value } |
| 487 |
EGL_LOWER_LEFT_KHR = $30CE; |
| 488 |
{ EGL_BITMAP_ORIGIN_KHR value } |
| 489 |
EGL_UPPER_LEFT_KHR = $30CF; |
| 490 |
|
| 491 |
(* Const before type ignored *) |
| 492 |
EGL_KHR_image = 1; |
| 493 |
|
| 494 |
{ eglCreateImageKHR target } |
| 495 |
EGL_NATIVE_PIXMAP_KHR = $30B0; |
| 496 |
|
| 497 |
type |
| 498 |
EGLImageKHR = pointer; |
| 499 |
|
| 500 |
{ was #define dname def_expr } |
| 501 |
function EGL_NO_IMAGE_KHR : EGLImageKHR; |
| 502 |
|
| 503 |
const |
| 504 |
(* Const before type ignored *) |
| 505 |
EGL_KHR_vg_parent_image = 1; |
| 506 |
{ eglCreateImageKHR target } |
| 507 |
EGL_VG_PARENT_IMAGE_KHR = $30BA; |
| 508 |
EGL_KHR_gl_texture_2D_image = 1; |
| 509 |
{ eglCreateImageKHR target } |
| 510 |
EGL_GL_TEXTURE_2D_KHR = $30B1; |
| 511 |
{ eglCreateImageKHR attribute } |
| 512 |
EGL_GL_TEXTURE_LEVEL_KHR = $30BC; |
| 513 |
EGL_KHR_gl_texture_cubemap_image = 1; |
| 514 |
{ eglCreateImageKHR target } |
| 515 |
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X_KHR = $30B3; |
| 516 |
{ eglCreateImageKHR target } |
| 517 |
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X_KHR = $30B4; |
| 518 |
{ eglCreateImageKHR target } |
| 519 |
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y_KHR = $30B5; |
| 520 |
{ eglCreateImageKHR target } |
| 521 |
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_KHR = $30B6; |
| 522 |
{ eglCreateImageKHR target } |
| 523 |
EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z_KHR = $30B7; |
| 524 |
{ eglCreateImageKHR target } |
| 525 |
EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_KHR = $30B8; |
| 526 |
EGL_KHR_gl_texture_3D_image = 1; |
| 527 |
{ eglCreateImageKHR target } |
| 528 |
EGL_GL_TEXTURE_3D_KHR = $30B2; |
| 529 |
{ eglCreateImageKHR attribute } |
| 530 |
EGL_GL_TEXTURE_ZOFFSET_KHR = $30BD; |
| 531 |
EGL_KHR_gl_renderbuffer_image = 1; |
| 532 |
{ eglCreateImageKHR target } |
| 533 |
EGL_GL_RENDERBUFFER_KHR = $30B9; |
| 534 |
EGL_KHR_image_base = 1; |
| 535 |
{ Most interfaces defined by EGL_KHR_image_pixmap above } |
| 536 |
{ eglCreateImageKHR attribute } |
| 537 |
EGL_IMAGE_PRESERVED_KHR = $30D2; |
| 538 |
EGL_KHR_image_pixmap = 1; |
| 539 |
{ Interfaces defined by EGL_KHR_image above } |
| 540 |
|
| 541 |
{ Try to load dynamic library with EGL functions. } |
| 542 |
procedure LoadEgl; |
| 543 |
|
| 544 |
{ Returns @true if LoadEgl was run and the EGL library was successfully loaded. |
| 545 |
This implies that all function pointers here are non-nil. } |
| 546 |
function EglAvailable: Boolean; |
| 547 |
|
| 548 |
implementation |
| 549 |
|
| 550 |
uses CastleDynLib; |
| 551 |
|
| 552 |
{ Load from given library or using eglGetProcAddress. } |
| 553 |
function glGetProcAddress(ahlib: TDynLib;ProcName: String): pointer; |
| 554 |
var |
| 555 |
ProcNameAnsi: AnsiString; |
| 556 |
begin |
| 557 |
result := ahlib.Symbol(PChar(ProcName)); |
| 558 |
if Assigned(eglGetProcAddress) and not Assigned(result) then |
| 559 |
begin |
| 560 |
ProcNameAnsi := ProcName; |
| 561 |
result := eglGetProcAddress(PAnsiChar(ProcNameAnsi)); |
| 562 |
end; |
| 563 |
end; |
| 564 |
|
| 565 |
{ was #define dname def_expr } |
| 566 |
function EGL_DEFAULT_DISPLAY : EGLNativeDisplayType; |
| 567 |
begin |
| 568 |
EGL_DEFAULT_DISPLAY := EGLNativeDisplayType(0); |
| 569 |
end; |
| 570 |
|
| 571 |
{ was #define dname def_expr } |
| 572 |
function EGL_NO_CONTEXT : EGLContext; |
| 573 |
begin |
| 574 |
EGL_NO_CONTEXT := EGLContext(0); |
| 575 |
end; |
| 576 |
|
| 577 |
{ was #define dname def_expr } |
| 578 |
function EGL_NO_DISPLAY : EGLDisplay; |
| 579 |
begin |
| 580 |
EGL_NO_DISPLAY := EGLDisplay(0); |
| 581 |
end; |
| 582 |
|
| 583 |
{ was #define dname def_expr } |
| 584 |
function EGL_NO_SURFACE : EGLSurface; |
| 585 |
begin |
| 586 |
EGL_NO_SURFACE := EGLSurface(0); |
| 587 |
end; |
| 588 |
|
| 589 |
{ was #define dname def_expr } |
| 590 |
function EGL_DONT_CARE : EGLint; |
| 591 |
begin |
| 592 |
EGL_DONT_CARE := EGLint(-(1)); |
| 593 |
end; |
| 594 |
|
| 595 |
{ was #define dname def_expr } |
| 596 |
function EGL_UNKNOWN : EGLint; |
| 597 |
begin |
| 598 |
EGL_UNKNOWN := EGLint(-(1)); |
| 599 |
end; |
| 600 |
|
| 601 |
{ was #define dname def_expr } |
| 602 |
function EGL_NO_IMAGE_KHR : EGLImageKHR; |
| 603 |
begin |
| 604 |
EGL_NO_IMAGE_KHR := EGLImageKHR(0); |
| 605 |
end; |
| 606 |
|
| 607 |
var |
| 608 |
EGLLib : TDynLib; |
| 609 |
|
| 610 |
procedure FreeEGL; |
| 611 |
begin |
| 612 |
FreeAndNil(EGLLib); |
| 613 |
|
| 614 |
eglGetError := nil; |
| 615 |
eglGetDisplay := nil; |
| 616 |
eglInitialize := nil; |
| 617 |
eglTerminate := nil; |
| 618 |
eglQueryString := nil; |
| 619 |
eglGetConfigs := nil; |
| 620 |
eglChooseConfig := nil; |
| 621 |
eglGetConfigAttrib := nil; |
| 622 |
eglCreateWindowSurface := nil; |
| 623 |
eglCreatePbufferSurface := nil; |
| 624 |
eglCreatePixmapSurface := nil; |
| 625 |
eglDestroySurface := nil; |
| 626 |
eglQuerySurface := nil; |
| 627 |
eglBindAPI := nil; |
| 628 |
eglQueryAPI := nil; |
| 629 |
eglWaitClient := nil; |
| 630 |
eglReleaseThread := nil; |
| 631 |
eglCreatePbufferFromClientBuffer := nil; |
| 632 |
eglSurfaceAttrib := nil; |
| 633 |
eglBindTexImage := nil; |
| 634 |
eglReleaseTexImage := nil; |
| 635 |
eglSwapInterval := nil; |
| 636 |
eglCreateContext := nil; |
| 637 |
eglDestroyContext := nil; |
| 638 |
eglMakeCurrent := nil; |
| 639 |
eglGetCurrentContext := nil; |
| 640 |
eglGetCurrentSurface := nil; |
| 641 |
eglGetCurrentDisplay := nil; |
| 642 |
eglQueryContext := nil; |
| 643 |
eglWaitGL := nil; |
| 644 |
eglWaitNative := nil; |
| 645 |
eglSwapBuffers := nil; |
| 646 |
eglCopyBuffers := nil; |
| 647 |
eglGetProcAddress := nil; |
| 648 |
end; |
| 649 |
|
| 650 |
function EglAvailable: Boolean; |
| 651 |
begin |
| 652 |
Result := EGLLib <> nil; |
| 653 |
end; |
| 654 |
|
| 655 |
procedure LoadEgl; |
| 656 |
const |
| 657 |
{$ifdef MSWINDOWS} |
| 658 |
LibName = 'libEGL.dll'; |
| 659 |
LibName2 = ''; |
| 660 |
{$else} |
| 661 |
{ First try to access libEGL.so.1 (from libegl1-mesa package on Debian). |
| 662 |
The name libEGL.so is only available in -dev package. } |
| 663 |
LibName = 'libEGL.so.1'; |
| 664 |
LibName2 = 'libEGL.so'; |
| 665 |
{$endif} |
| 666 |
begin |
| 667 |
FreeEGL; |
| 668 |
|
| 669 |
EGLLib := TDynLib.Load(LibName, false); |
| 670 |
{$warnings off} // ignore warning "unreachable code" on Windows, where LibName2 = '' |
| 671 |
if (EGLLib = nil) and (LibName2 <> '') then |
| 672 |
EGLLib := TDynLib.Load(LibName2, false); |
| 673 |
{$warnings on} |
| 674 |
|
| 675 |
if EGLLib <> nil then |
| 676 |
begin |
| 677 |
Pointer({$ifndef FPC}@{$endif} eglGetProcAddress) := EGLLib.Symbol('eglGetProcAddress'); |
| 678 |
|
| 679 |
Pointer({$ifndef FPC}@{$endif} eglGetError) := glGetProcAddress(EGLLib,'eglGetError'); |
| 680 |
Pointer({$ifndef FPC}@{$endif} eglGetDisplay) := glGetProcAddress(EGLLib,'eglGetDisplay'); |
| 681 |
Pointer({$ifndef FPC}@{$endif} eglInitialize) := glGetProcAddress(EGLLib,'eglInitialize'); |
| 682 |
Pointer({$ifndef FPC}@{$endif} eglTerminate) := glGetProcAddress(EGLLib,'eglTerminate'); |
| 683 |
Pointer({$ifndef FPC}@{$endif} eglQueryString) := glGetProcAddress(EGLLib,'eglQueryString'); |
| 684 |
Pointer({$ifndef FPC}@{$endif} eglGetConfigs) := glGetProcAddress(EGLLib,'eglGetConfigs'); |
| 685 |
Pointer({$ifndef FPC}@{$endif} eglChooseConfig) := glGetProcAddress(EGLLib,'eglChooseConfig'); |
| 686 |
Pointer({$ifndef FPC}@{$endif} eglGetConfigAttrib) := glGetProcAddress(EGLLib,'eglGetConfigAttrib'); |
| 687 |
Pointer({$ifndef FPC}@{$endif} eglCreateWindowSurface) := glGetProcAddress(EGLLib,'eglCreateWindowSurface'); |
| 688 |
Pointer({$ifndef FPC}@{$endif} eglCreatePbufferSurface) := glGetProcAddress(EGLLib,'eglCreatePbufferSurface'); |
| 689 |
Pointer({$ifndef FPC}@{$endif} eglCreatePixmapSurface) := glGetProcAddress(EGLLib,'eglCreatePixmapSurface'); |
| 690 |
Pointer({$ifndef FPC}@{$endif} eglDestroySurface) := glGetProcAddress(EGLLib,'eglDestroySurface'); |
| 691 |
Pointer({$ifndef FPC}@{$endif} eglQuerySurface) := glGetProcAddress(EGLLib,'eglQuerySurface'); |
| 692 |
Pointer({$ifndef FPC}@{$endif} eglBindAPI) := glGetProcAddress(EGLLib,'eglBindAPI'); |
| 693 |
Pointer({$ifndef FPC}@{$endif} eglQueryAPI) := glGetProcAddress(EGLLib,'eglQueryAPI'); |
| 694 |
Pointer({$ifndef FPC}@{$endif} eglWaitClient) := glGetProcAddress(EGLLib,'eglWaitClient'); |
| 695 |
Pointer({$ifndef FPC}@{$endif} eglReleaseThread) := glGetProcAddress(EGLLib,'eglReleaseThread'); |
| 696 |
Pointer({$ifndef FPC}@{$endif} eglCreatePbufferFromClientBuffer) := glGetProcAddress(EGLLib,'eglCreatePbufferFromClientBuffer'); |
| 697 |
Pointer({$ifndef FPC}@{$endif} eglSurfaceAttrib) := glGetProcAddress(EGLLib,'eglSurfaceAttrib'); |
| 698 |
Pointer({$ifndef FPC}@{$endif} eglBindTexImage) := glGetProcAddress(EGLLib,'eglBindTexImage'); |
| 699 |
Pointer({$ifndef FPC}@{$endif} eglReleaseTexImage) := glGetProcAddress(EGLLib,'eglReleaseTexImage'); |
| 700 |
Pointer({$ifndef FPC}@{$endif} eglSwapInterval) := glGetProcAddress(EGLLib,'eglSwapInterval'); |
| 701 |
Pointer({$ifndef FPC}@{$endif} eglCreateContext) := glGetProcAddress(EGLLib,'eglCreateContext'); |
| 702 |
Pointer({$ifndef FPC}@{$endif} eglDestroyContext) := glGetProcAddress(EGLLib,'eglDestroyContext'); |
| 703 |
Pointer({$ifndef FPC}@{$endif} eglMakeCurrent) := glGetProcAddress(EGLLib,'eglMakeCurrent'); |
| 704 |
Pointer({$ifndef FPC}@{$endif} eglGetCurrentContext) := glGetProcAddress(EGLLib,'eglGetCurrentContext'); |
| 705 |
Pointer({$ifndef FPC}@{$endif} eglGetCurrentSurface) := glGetProcAddress(EGLLib,'eglGetCurrentSurface'); |
| 706 |
Pointer({$ifndef FPC}@{$endif} eglGetCurrentDisplay) := glGetProcAddress(EGLLib,'eglGetCurrentDisplay'); |
| 707 |
Pointer({$ifndef FPC}@{$endif} eglQueryContext) := glGetProcAddress(EGLLib,'eglQueryContext'); |
| 708 |
Pointer({$ifndef FPC}@{$endif} eglWaitGL) := glGetProcAddress(EGLLib,'eglWaitGL'); |
| 709 |
Pointer({$ifndef FPC}@{$endif} eglWaitNative) := glGetProcAddress(EGLLib,'eglWaitNative'); |
| 710 |
Pointer({$ifndef FPC}@{$endif} eglSwapBuffers) := glGetProcAddress(EGLLib,'eglSwapBuffers'); |
| 711 |
Pointer({$ifndef FPC}@{$endif} eglCopyBuffers) := glGetProcAddress(EGLLib,'eglCopyBuffers'); |
| 712 |
end; |
| 713 |
end; |
| 714 |
|
| 715 |
initialization |
| 716 |
{$ifdef ALLOW_DLOPEN_FROM_UNIT_INITIALIZATION} |
| 717 |
LoadEgl; |
| 718 |
{$endif} |
| 719 |
finalization |
| 720 |
FreeEGL; |
| 721 |
end. |