|
@@ -37,7 +37,7 @@ interface
|
|
|
|
|
|
{$IFDEF Unix}
|
|
{$IFDEF Unix}
|
|
uses
|
|
uses
|
|
- X, XLib, XUtil;
|
|
|
|
|
|
+ ctypes, X, XLib, XUtil;
|
|
{$DEFINE HasGLX} // Activate GLX stuff
|
|
{$DEFINE HasGLX} // Activate GLX stuff
|
|
{$ELSE}
|
|
{$ELSE}
|
|
{$MESSAGE Unsupported platform.}
|
|
{$MESSAGE Unsupported platform.}
|
|
@@ -237,50 +237,50 @@ type
|
|
TGLXPbuffer = TXID;
|
|
TGLXPbuffer = TXID;
|
|
|
|
|
|
var
|
|
var
|
|
- glXChooseVisual: function(dpy: PDisplay; screen: Integer; attribList: PInteger): PXVisualInfo; cdecl;
|
|
|
|
- glXCreateContext: function(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: Boolean): GLXContext; cdecl;
|
|
|
|
|
|
+ glXChooseVisual: function(dpy: PDisplay; screen: cint; attribList: Pcint): PXVisualInfo; cdecl;
|
|
|
|
+ //glXCreateContext -> internal_glXCreateContext in implementation
|
|
glXDestroyContext: procedure(dpy: PDisplay; ctx: GLXContext); cdecl;
|
|
glXDestroyContext: procedure(dpy: PDisplay; ctx: GLXContext); cdecl;
|
|
- glXMakeCurrent: function(dpy: PDisplay; drawable: GLXDrawable; ctx: GLXContext): Boolean; cdecl;
|
|
|
|
- glXCopyContext: procedure(dpy: PDisplay; src, dst: GLXContext; mask: LongWord); cdecl;
|
|
|
|
|
|
+ glXMakeCurrent: function(dpy: PDisplay; drawable: GLXDrawable; ctx: GLXContext): TBoolResult; cdecl;
|
|
|
|
+ glXCopyContext: procedure(dpy: PDisplay; src, dst: GLXContext; mask: culong); cdecl;
|
|
glXSwapBuffers: procedure(dpy: PDisplay; drawable: GLXDrawable); cdecl;
|
|
glXSwapBuffers: procedure(dpy: PDisplay; drawable: GLXDrawable); cdecl;
|
|
glXCreateGLXPixmap: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap): GLXPixmap; cdecl;
|
|
glXCreateGLXPixmap: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap): GLXPixmap; cdecl;
|
|
glXDestroyGLXPixmap: procedure(dpy: PDisplay; pixmap: GLXPixmap); cdecl;
|
|
glXDestroyGLXPixmap: procedure(dpy: PDisplay; pixmap: GLXPixmap); cdecl;
|
|
- glXQueryExtension: function(dpy: PDisplay; var errorb, event: Integer): Boolean; cdecl;
|
|
|
|
- glXQueryVersion: function(dpy: PDisplay; var maj, min: Integer): Boolean; cdecl;
|
|
|
|
- glXIsDirect: function(dpy: PDisplay; ctx: GLXContext): Boolean; cdecl;
|
|
|
|
- glXGetConfig: function(dpy: PDisplay; visual: PXVisualInfo; attrib: Integer; var value: Integer): Integer; cdecl;
|
|
|
|
|
|
+ glXQueryExtension: function(dpy: PDisplay; var errorb, event: cint): TBoolResult; cdecl;
|
|
|
|
+ glXQueryVersion: function(dpy: PDisplay; var maj, min: cint): TBoolResult; cdecl;
|
|
|
|
+ glXIsDirect: function(dpy: PDisplay; ctx: GLXContext): TBoolResult; cdecl;
|
|
|
|
+ glXGetConfig: function(dpy: PDisplay; visual: PXVisualInfo; attrib: cint; var value: cint): cint; cdecl;
|
|
glXGetCurrentContext: function: GLXContext; cdecl;
|
|
glXGetCurrentContext: function: GLXContext; cdecl;
|
|
glXGetCurrentDrawable: function: GLXDrawable; cdecl;
|
|
glXGetCurrentDrawable: function: GLXDrawable; cdecl;
|
|
glXWaitGL: procedure; cdecl;
|
|
glXWaitGL: procedure; cdecl;
|
|
glXWaitX: procedure; cdecl;
|
|
glXWaitX: procedure; cdecl;
|
|
- glXUseXFont: procedure(font: XFont; first, count, list: Integer); cdecl;
|
|
|
|
|
|
+ glXUseXFont: procedure(font: XFont; first, count, list: cint); cdecl;
|
|
|
|
|
|
// GLX 1.1 and later
|
|
// GLX 1.1 and later
|
|
- glXQueryExtensionsString: function(dpy: PDisplay; screen: Integer): PChar; cdecl;
|
|
|
|
- glXQueryServerString: function(dpy: PDisplay; screen, name: Integer): PChar; cdecl;
|
|
|
|
- glXGetClientString: function(dpy: PDisplay; name: Integer): PChar; cdecl;
|
|
|
|
|
|
+ glXQueryExtensionsString: function(dpy: PDisplay; screen: cint): PChar; cdecl;
|
|
|
|
+ glXQueryServerString: function(dpy: PDisplay; screen, name: cint): PChar; cdecl;
|
|
|
|
+ glXGetClientString: function(dpy: PDisplay; name: cint): PChar; cdecl;
|
|
|
|
|
|
// GLX 1.2 and later
|
|
// GLX 1.2 and later
|
|
glXGetCurrentDisplay: function: PDisplay; cdecl;
|
|
glXGetCurrentDisplay: function: PDisplay; cdecl;
|
|
|
|
|
|
// GLX 1.3 and later
|
|
// GLX 1.3 and later
|
|
- glXChooseFBConfig: function(dpy: PDisplay; screen: Integer; attribList: PInteger; var nitems: Integer): PGLXFBConfig; cdecl;
|
|
|
|
- glXGetFBConfigAttrib: function(dpy: PDisplay; config: TGLXFBConfig; attribute: Integer; var value: Integer): Integer; cdecl;
|
|
|
|
- glXGetFBConfigs: function(dpy: PDisplay; screen: Integer; var nelements: Integer): PGLXFBConfig; cdecl;
|
|
|
|
|
|
+ glXChooseFBConfig: function(dpy: PDisplay; screen: cint; attribList: Pcint; var nitems: cint): PGLXFBConfig; cdecl;
|
|
|
|
+ glXGetFBConfigAttrib: function(dpy: PDisplay; config: TGLXFBConfig; attribute: cint; var value: cint): cint; cdecl;
|
|
|
|
+ glXGetFBConfigs: function(dpy: PDisplay; screen: cint; var nelements: cint): PGLXFBConfig; cdecl;
|
|
glXGetVisualFromFBConfig: function(dpy: PDisplay; config: TGLXFBConfig): PXVisualInfo; cdecl;
|
|
glXGetVisualFromFBConfig: function(dpy: PDisplay; config: TGLXFBConfig): PXVisualInfo; cdecl;
|
|
- glXCreateWindow: function(dpy: PDisplay; config: TGLXFBConfig; win: X.TWindow; attribList: PInteger): TGLXWindow; cdecl;
|
|
|
|
|
|
+ glXCreateWindow: function(dpy: PDisplay; config: TGLXFBConfig; win: X.TWindow; attribList: Pcint): TGLXWindow; cdecl;
|
|
glXDestroyWindow: procedure (dpy: PDisplay; window: TGLXWindow); cdecl;
|
|
glXDestroyWindow: procedure (dpy: PDisplay; window: TGLXWindow); cdecl;
|
|
- glXCreatePixmap: function(dpy: PDisplay; config: TGLXFBConfig; pixmap: TXPixmap; attribList: PInteger): TGLXPixmap; cdecl;
|
|
|
|
|
|
+ glXCreatePixmap: function(dpy: PDisplay; config: TGLXFBConfig; pixmap: TXPixmap; attribList: Pcint): TGLXPixmap; cdecl;
|
|
glXDestroyPixmap: procedure (dpy: PDisplay; pixmap: TGLXPixmap); cdecl;
|
|
glXDestroyPixmap: procedure (dpy: PDisplay; pixmap: TGLXPixmap); cdecl;
|
|
- glXCreatePbuffer: function(dpy: PDisplay; config: TGLXFBConfig; attribList: PInteger): TGLXPbuffer; cdecl;
|
|
|
|
|
|
+ glXCreatePbuffer: function(dpy: PDisplay; config: TGLXFBConfig; attribList: Pcint): TGLXPbuffer; cdecl;
|
|
glXDestroyPbuffer: procedure (dpy: PDisplay; pbuf: TGLXPbuffer); cdecl;
|
|
glXDestroyPbuffer: procedure (dpy: PDisplay; pbuf: TGLXPbuffer); cdecl;
|
|
- glXQueryDrawable: procedure (dpy: PDisplay; draw: TGLXDrawable; attribute: Integer; value: PLongWord); cdecl;
|
|
|
|
- glXCreateNewContext: function(dpy: PDisplay; config: TGLXFBConfig; renderType: Integer; shareList: TGLXContext; direct: boolean): TGLXContext; cdecl;
|
|
|
|
- glXMakeContextCurrent: function(dpy: PDisplay; draw: TGLXDrawable; read: GLXDrawable; ctx: TGLXContext): boolean; cdecl;
|
|
|
|
|
|
+ glXQueryDrawable: procedure (dpy: PDisplay; draw: TGLXDrawable; attribute: cint; value: Pcuint); cdecl;
|
|
|
|
+ //glXCreateNewContext -> internal_glXCreateNewContext in implementation
|
|
|
|
+ glXMakeContextCurrent: function(dpy: PDisplay; draw: TGLXDrawable; read: GLXDrawable; ctx: TGLXContext): TBoolResult; cdecl;
|
|
glXGetCurrentReadDrawable: function: TGLXDrawable; cdecl;
|
|
glXGetCurrentReadDrawable: function: TGLXDrawable; cdecl;
|
|
- glXQueryContext: function(dpy: PDisplay; ctx: TGLXContext; attribute: Integer; var value: Integer): Integer; cdecl;
|
|
|
|
- glXSelectEvent: procedure (dpy: PDisplay; drawable: TGLXDrawable; mask: LongWord); cdecl;
|
|
|
|
- glXGetSelectedEvent: procedure (dpy: PDisplay; drawable: TGLXDrawable; mask: PLongWord); cdecl;
|
|
|
|
|
|
+ glXQueryContext: function(dpy: PDisplay; ctx: TGLXContext; attribute: cint; var value: cint): cint; cdecl;
|
|
|
|
+ glXSelectEvent: procedure (dpy: PDisplay; drawable: TGLXDrawable; mask: culong); cdecl;
|
|
|
|
+ glXGetSelectedEvent: procedure (dpy: PDisplay; drawable: TGLXDrawable; mask: Pculong); cdecl;
|
|
|
|
|
|
// GLX 1.4 and later
|
|
// GLX 1.4 and later
|
|
glXGetProcAddress: function(procname: PChar): Pointer; cdecl;
|
|
glXGetProcAddress: function(procname: PChar): Pointer; cdecl;
|
|
@@ -291,23 +291,38 @@ var
|
|
glXGetProcAddressARB: function(procname: PChar): Pointer; cdecl;
|
|
glXGetProcAddressARB: function(procname: PChar): Pointer; cdecl;
|
|
|
|
|
|
// GLX_ARB_create_context
|
|
// GLX_ARB_create_context
|
|
- glXCreateContextAttribsARB: function (dpy: PDisplay; config: TGLXFBConfig; share_context: TGLXContext; direct: boolean; attrib_list: PInteger): TGLXContext; cdecl;
|
|
|
|
|
|
+ //glXCreateContextAttribsARB -> internal_glXCreateContextAttribsARB in implementation
|
|
|
|
+
|
|
|
|
+ // GLX_EXT_swap_control
|
|
|
|
+ glXSwapIntervalEXT: function(dpy: PDisplay; drawable: TGLXDrawable; interval: cint): cint; cdecl;
|
|
|
|
|
|
// GLX_MESA_pixmap_colormap
|
|
// GLX_MESA_pixmap_colormap
|
|
glXCreateGLXPixmapMESA: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap; cmap: XColormap): GLXPixmap; cdecl;
|
|
glXCreateGLXPixmapMESA: function(dpy: PDisplay; visual: PXVisualInfo; pixmap: XPixmap; cmap: XColormap): GLXPixmap; cdecl;
|
|
|
|
|
|
|
|
+ // GLX_MESA_swap_control
|
|
|
|
+ glXSwapIntervalMESA: function(interval: cuint): cint; cdecl;
|
|
|
|
+ glXGetSwapIntervalMESA: function: cint; cdecl;
|
|
|
|
+
|
|
// Unknown Mesa GLX extension (undocumented in current GLX C headers?)
|
|
// Unknown Mesa GLX extension (undocumented in current GLX C headers?)
|
|
- glXReleaseBufferMESA: function(dpy: PDisplay; d: GLXDrawable): Boolean; cdecl;
|
|
|
|
- glXCopySubBufferMESA: procedure(dpy: PDisplay; drawbale: GLXDrawable; x, y, width, height: Integer); cdecl;
|
|
|
|
|
|
+ glXReleaseBuffersMESA: function(dpy: PDisplay; d: GLXDrawable): TBoolResult; cdecl;
|
|
|
|
+ glXCopySubBufferMESA: procedure(dpy: PDisplay; drawable: GLXDrawable; x, y, width, height: cint); cdecl;
|
|
|
|
+
|
|
|
|
+ // GLX_SGI_swap_control
|
|
|
|
+ glXSwapIntervalSGI: function(interval: cint): cint; cdecl;
|
|
|
|
|
|
// GLX_SGI_video_sync
|
|
// GLX_SGI_video_sync
|
|
- glXGetVideoSyncSGI: function(var counter: LongWord): Integer; cdecl;
|
|
|
|
- glXWaitVideoSyncSGI: function(divisor, remainder: Integer; var count: LongWord): Integer; cdecl;
|
|
|
|
|
|
+ glXGetVideoSyncSGI: function(var count: cuint): cint; cdecl;
|
|
|
|
+ glXWaitVideoSyncSGI: function(divisor, remainder: cint; var count: cuint): cint; cdecl;
|
|
|
|
|
|
// =======================================================
|
|
// =======================================================
|
|
//
|
|
//
|
|
// =======================================================
|
|
// =======================================================
|
|
|
|
|
|
|
|
+// Overloaded functions to handle TBool parameters as actual booleans.
|
|
|
|
+function glXCreateContext(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: Boolean): GLXContext;
|
|
|
|
+function glXCreateNewContext(dpy: PDisplay; config: TGLXFBConfig; renderType: cint; shareList: TGLXContext; direct: Boolean): TGLXContext;
|
|
|
|
+function glXCreateContextAttribsARB(dpy: PDisplay; config: TGLXFBConfig; share_context: TGLXContext; direct: Boolean; attrib_list: Pcint): TGLXContext;
|
|
|
|
+
|
|
{
|
|
{
|
|
Safe checking of glX version and extension presence.
|
|
Safe checking of glX version and extension presence.
|
|
|
|
|
|
@@ -344,8 +359,11 @@ function GLX_ARB_create_context(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_ARB_create_context_profile(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_ARB_create_context_profile(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_ARB_create_context_robustness(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_ARB_create_context_robustness(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_ARB_multisample(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_ARB_multisample(Display: PDisplay; Screen: Integer): boolean;
|
|
|
|
+function GLX_EXT_swap_control(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_EXT_visual_info(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_EXT_visual_info(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_MESA_pixmap_colormap(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_MESA_pixmap_colormap(Display: PDisplay; Screen: Integer): boolean;
|
|
|
|
+function GLX_MESA_swap_control(Display: PDisplay; Screen: Integer): boolean;
|
|
|
|
+function GLX_SGI_swap_control(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_SGI_video_sync(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_SGI_video_sync(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_SGIS_multisample(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_SGIS_multisample(Display: PDisplay; Screen: Integer): boolean;
|
|
|
|
|
|
@@ -355,6 +373,26 @@ uses GL, dynlibs, GLExt { for glext_ExtensionSupported utility };
|
|
|
|
|
|
{$LINKLIB m}
|
|
{$LINKLIB m}
|
|
|
|
|
|
|
|
+var
|
|
|
|
+ internal_glXCreateContext: function(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: TBool): GLXContext; cdecl;
|
|
|
|
+ internal_glXCreateNewContext: function(dpy: PDisplay; config: TGLXFBConfig; renderType: cint; shareList: TGLXContext; direct: TBool): TGLXContext; cdecl;
|
|
|
|
+ internal_glXCreateContextAttribsARB: function (dpy: PDisplay; config: TGLXFBConfig; share_context: TGLXContext; direct: TBool; attrib_list: Pcint): TGLXContext; cdecl;
|
|
|
|
+
|
|
|
|
+function glXCreateContext(dpy: PDisplay; vis: PXVisualInfo; shareList: GLXContext; direct: Boolean): GLXContext;
|
|
|
|
+begin
|
|
|
|
+ Result := internal_glXCreateContext(dpy, vis, shareList, Ord(direct));
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function glXCreateNewContext(dpy: PDisplay; config: TGLXFBConfig; renderType: cint; shareList: TGLXContext; direct: Boolean): TGLXContext;
|
|
|
|
+begin
|
|
|
|
+ Result := internal_glXCreateNewContext(dpy, config, renderType, shareList, Ord(direct));
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function glXCreateContextAttribsARB(dpy: PDisplay; config: TGLXFBConfig; share_context: TGLXContext; direct: Boolean; attrib_list: Pcint): TGLXContext;
|
|
|
|
+begin
|
|
|
|
+ Result := internal_glXCreateContextAttribsARB(dpy, config, share_context, Ord(direct), attrib_list);
|
|
|
|
+end;
|
|
|
|
+
|
|
function GLX_version_1_0(Display: PDisplay): boolean;
|
|
function GLX_version_1_0(Display: PDisplay): boolean;
|
|
var
|
|
var
|
|
IgnoredErrorb, IgnoredEvent, Major, Minor: Integer;
|
|
IgnoredErrorb, IgnoredEvent, Major, Minor: Integer;
|
|
@@ -369,7 +407,7 @@ begin
|
|
(Major >= 1) and
|
|
(Major >= 1) and
|
|
{ check entry points assigned }
|
|
{ check entry points assigned }
|
|
Assigned(glXChooseVisual) and
|
|
Assigned(glXChooseVisual) and
|
|
- Assigned(glXCreateContext) and
|
|
|
|
|
|
+ Assigned(internal_glXCreateContext) and
|
|
Assigned(glXDestroyContext) and
|
|
Assigned(glXDestroyContext) and
|
|
Assigned(glXMakeCurrent) and
|
|
Assigned(glXMakeCurrent) and
|
|
Assigned(glXCopyContext) and
|
|
Assigned(glXCopyContext) and
|
|
@@ -439,7 +477,7 @@ begin
|
|
Assigned(glXCreatePbuffer) and
|
|
Assigned(glXCreatePbuffer) and
|
|
Assigned(glXDestroyPbuffer) and
|
|
Assigned(glXDestroyPbuffer) and
|
|
Assigned(glXQueryDrawable) and
|
|
Assigned(glXQueryDrawable) and
|
|
- Assigned(glXCreateNewContext) and
|
|
|
|
|
|
+ Assigned(internal_glXCreateNewContext) and
|
|
Assigned(glXMakeContextCurrent) and
|
|
Assigned(glXMakeContextCurrent) and
|
|
Assigned(glXGetCurrentReadDrawable) and
|
|
Assigned(glXGetCurrentReadDrawable) and
|
|
Assigned(glXQueryContext) and
|
|
Assigned(glXQueryContext) and
|
|
@@ -483,7 +521,7 @@ begin
|
|
begin
|
|
begin
|
|
GlxExtensions := glXQueryExtensionsString(Display, Screen);
|
|
GlxExtensions := glXQueryExtensionsString(Display, Screen);
|
|
Result := glext_ExtensionSupported('GLX_ARB_create_context', GlxExtensions) and
|
|
Result := glext_ExtensionSupported('GLX_ARB_create_context', GlxExtensions) and
|
|
- Assigned(glXCreateContextAttribsARB);
|
|
|
|
|
|
+ Assigned(internal_glXCreateContextAttribsARB);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -523,6 +561,19 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function GLX_EXT_swap_control(Display: PDisplay; Screen: Integer): boolean;
|
|
|
|
+var
|
|
|
|
+ GlxExtensions: PChar;
|
|
|
|
+begin
|
|
|
|
+ Result := GLX_version_1_1(Display);
|
|
|
|
+ if Result then
|
|
|
|
+ begin
|
|
|
|
+ GlxExtensions := glXQueryExtensionsString(Display, Screen);
|
|
|
|
+ Result := glext_ExtensionSupported('GLX_EXT_swap_control', GlxExtensions) and
|
|
|
|
+ Assigned(glXSwapIntervalEXT);
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
function GLX_EXT_visual_info(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_EXT_visual_info(Display: PDisplay; Screen: Integer): boolean;
|
|
var
|
|
var
|
|
GlxExtensions: PChar;
|
|
GlxExtensions: PChar;
|
|
@@ -548,6 +599,33 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+function GLX_MESA_swap_control(Display: PDisplay; Screen: Integer): boolean;
|
|
|
|
+var
|
|
|
|
+ GlxExtensions: PChar;
|
|
|
|
+begin
|
|
|
|
+ Result := GLX_version_1_1(Display);
|
|
|
|
+ if Result then
|
|
|
|
+ begin
|
|
|
|
+ GlxExtensions := glXQueryExtensionsString(Display, Screen);
|
|
|
|
+ Result := glext_ExtensionSupported('GLX_MESA_swap_control', GlxExtensions) and
|
|
|
|
+ Assigned(glXSwapIntervalMESA) and
|
|
|
|
+ Assigned(glXGetSwapIntervalMESA);
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
|
|
+function GLX_SGI_swap_control(Display: PDisplay; Screen: Integer): boolean;
|
|
|
|
+var
|
|
|
|
+ GlxExtensions: PChar;
|
|
|
|
+begin
|
|
|
|
+ Result := GLX_version_1_1(Display);
|
|
|
|
+ if Result then
|
|
|
|
+ begin
|
|
|
|
+ GlxExtensions := glXQueryExtensionsString(Display, Screen);
|
|
|
|
+ Result := glext_ExtensionSupported('GLX_SGI_swap_control', GlxExtensions) and
|
|
|
|
+ Assigned(glXSwapIntervalSGI);
|
|
|
|
+ end;
|
|
|
|
+end;
|
|
|
|
+
|
|
function GLX_SGI_video_sync(Display: PDisplay; Screen: Integer): boolean;
|
|
function GLX_SGI_video_sync(Display: PDisplay; Screen: Integer): boolean;
|
|
var
|
|
var
|
|
GlxExtensions: PChar;
|
|
GlxExtensions: PChar;
|
|
@@ -576,7 +654,13 @@ end;
|
|
|
|
|
|
function GetProc(handle: PtrInt; name: PChar): Pointer;
|
|
function GetProc(handle: PtrInt; name: PChar): Pointer;
|
|
begin
|
|
begin
|
|
- Result := GetProcAddress(handle, name);
|
|
|
|
|
|
+ if Assigned(glXGetProcAddress) then
|
|
|
|
+ Result := glXGetProcAddress(name)
|
|
|
|
+ else
|
|
|
|
+ if Assigned(glXGetProcAddressARB) then
|
|
|
|
+ Result := glXGetProcAddressARB(name)
|
|
|
|
+ else
|
|
|
|
+ Result := GetProcAddress(handle, name);
|
|
if (Result = nil) and GLXDumpUnresolvedFunctions then
|
|
if (Result = nil) and GLXDumpUnresolvedFunctions then
|
|
WriteLn('Unresolved: ', name);
|
|
WriteLn('Unresolved: ', name);
|
|
end;
|
|
end;
|
|
@@ -596,8 +680,18 @@ begin
|
|
if OurLibGL = 0 then
|
|
if OurLibGL = 0 then
|
|
exit;
|
|
exit;
|
|
|
|
|
|
|
|
+ // glXGetProcAddress and glXGetProcAddressARB are imported first,
|
|
|
|
+ // so we can use them (when they are available) to resolve all the
|
|
|
|
+ // other imports
|
|
|
|
+
|
|
|
|
+ // GLX 1.4 and later
|
|
|
|
+ glXGetProcAddress := GetProc(OurLibGL, 'glXGetProcAddress');
|
|
|
|
+ // GLX_ARB_get_proc_address
|
|
|
|
+ glXGetProcAddressARB := GetProc(OurLibGL, 'glXGetProcAddressARB');
|
|
|
|
+
|
|
|
|
+ // GLX 1.0
|
|
glXChooseVisual := GetProc(OurLibGL, 'glXChooseVisual');
|
|
glXChooseVisual := GetProc(OurLibGL, 'glXChooseVisual');
|
|
- glXCreateContext := GetProc(OurLibGL, 'glXCreateContext');
|
|
|
|
|
|
+ internal_glXCreateContext := GetProc(OurLibGL, 'glXCreateContext');
|
|
glXDestroyContext := GetProc(OurLibGL, 'glXDestroyContext');
|
|
glXDestroyContext := GetProc(OurLibGL, 'glXDestroyContext');
|
|
glXMakeCurrent := GetProc(OurLibGL, 'glXMakeCurrent');
|
|
glXMakeCurrent := GetProc(OurLibGL, 'glXMakeCurrent');
|
|
glXCopyContext := GetProc(OurLibGL, 'glXCopyContext');
|
|
glXCopyContext := GetProc(OurLibGL, 'glXCopyContext');
|
|
@@ -631,24 +725,27 @@ begin
|
|
glXCreatePbuffer := GetProc(OurLibGL, 'glXCreatePbuffer');
|
|
glXCreatePbuffer := GetProc(OurLibGL, 'glXCreatePbuffer');
|
|
glXDestroyPbuffer := GetProc(OurLibGL, 'glXDestroyPbuffer');
|
|
glXDestroyPbuffer := GetProc(OurLibGL, 'glXDestroyPbuffer');
|
|
glXQueryDrawable := GetProc(OurLibGL, 'glXQueryDrawable');
|
|
glXQueryDrawable := GetProc(OurLibGL, 'glXQueryDrawable');
|
|
- glXCreateNewContext := GetProc(OurLibGL, 'glXCreateNewContext');
|
|
|
|
|
|
+ internal_glXCreateNewContext := GetProc(OurLibGL, 'glXCreateNewContext');
|
|
glXMakeContextCurrent := GetProc(OurLibGL, 'glXMakeContextCurrent');
|
|
glXMakeContextCurrent := GetProc(OurLibGL, 'glXMakeContextCurrent');
|
|
glXGetCurrentReadDrawable := GetProc(OurLibGL, 'glXGetCurrentReadDrawable');
|
|
glXGetCurrentReadDrawable := GetProc(OurLibGL, 'glXGetCurrentReadDrawable');
|
|
glXQueryContext := GetProc(OurLibGL, 'glXQueryContext');
|
|
glXQueryContext := GetProc(OurLibGL, 'glXQueryContext');
|
|
glXSelectEvent := GetProc(OurLibGL, 'glXSelectEvent');
|
|
glXSelectEvent := GetProc(OurLibGL, 'glXSelectEvent');
|
|
glXGetSelectedEvent := GetProc(OurLibGL, 'glXGetSelectedEvent');
|
|
glXGetSelectedEvent := GetProc(OurLibGL, 'glXGetSelectedEvent');
|
|
- // GLX 1.4 and later
|
|
|
|
- glXGetProcAddress := GetProc(OurLibGL, 'glXGetProcAddress');
|
|
|
|
// Extensions
|
|
// Extensions
|
|
- // GLX_ARB_get_proc_address
|
|
|
|
- glXGetProcAddressARB := GetProc(OurLibGL, 'glXGetProcAddressARB');
|
|
|
|
// GLX_ARB_create_context
|
|
// GLX_ARB_create_context
|
|
- glXCreateContextAttribsARB := GetProc(OurLibGL, 'glXCreateContextAttribsARB');
|
|
|
|
|
|
+ internal_glXCreateContextAttribsARB := GetProc(OurLibGL, 'glXCreateContextAttribsARB');
|
|
|
|
+ // GLX_EXT_swap_control
|
|
|
|
+ glXSwapIntervalEXT := GetProc(OurLibGL, 'glXSwapIntervalEXT');
|
|
// GLX_MESA_pixmap_colormap
|
|
// GLX_MESA_pixmap_colormap
|
|
glXCreateGLXPixmapMESA := GetProc(OurLibGL, 'glXCreateGLXPixmapMESA');
|
|
glXCreateGLXPixmapMESA := GetProc(OurLibGL, 'glXCreateGLXPixmapMESA');
|
|
|
|
+ // GLX_MESA_swap_control
|
|
|
|
+ glXSwapIntervalMESA := GetProc(OurLibGL, 'glXSwapIntervalMESA');
|
|
|
|
+ glXGetSwapIntervalMESA := GetProc(OurLibGL, 'glXGetSwapIntervalMESA');
|
|
// Unknown Mesa GLX extension
|
|
// Unknown Mesa GLX extension
|
|
- glXReleaseBufferMESA := GetProc(OurLibGL, 'glXReleaseBufferMESA');
|
|
|
|
|
|
+ glXReleaseBuffersMESA := GetProc(OurLibGL, 'glXReleaseBuffersMESA');
|
|
glXCopySubBufferMESA := GetProc(OurLibGL, 'glXCopySubBufferMESA');
|
|
glXCopySubBufferMESA := GetProc(OurLibGL, 'glXCopySubBufferMESA');
|
|
|
|
+ // GLX_SGI_swap_control
|
|
|
|
+ glXSwapIntervalSGI := GetProc(OurLibGL, 'glXSwapIntervalSGI');
|
|
// GLX_SGI_video_sync
|
|
// GLX_SGI_video_sync
|
|
glXGetVideoSyncSGI := GetProc(OurLibGL, 'glXGetVideoSyncSGI');
|
|
glXGetVideoSyncSGI := GetProc(OurLibGL, 'glXGetVideoSyncSGI');
|
|
glXWaitVideoSyncSGI := GetProc(OurLibGL, 'glXWaitVideoSyncSGI');
|
|
glXWaitVideoSyncSGI := GetProc(OurLibGL, 'glXWaitVideoSyncSGI');
|