{ ============================================================================
OpenGL 4.5 - Headertranslation
- Version 4.5
- Date : 2014/08/23
+ Version 4.5a
Supported environments and targets :
- - (Win32) Delphi 4 and up
+ - (Win32) Delphi 6 and up
- (Win32, Win64) Delphi XE2
- (Win32, Win64, Linux, MacOSX) FreePascal (1.9.3 and up)
{$A4}
{$ENDIF}
+// 64 BIT architecture
+// Free pascal
+{$IFDEF CPU64}
+ {$DEFINE DGL_64BIT}
+{$ENDIF}
+// Delphi
+{$IFDEF WIN64}
+ {$DEFINE DGL_64BIT}
+{$ENDIF}
+
+
// generell options
{$H+,O+,X+}
{$ENDIF}
{$ENDIF}
-
-// detecting 64 Bit CPU
-{$IFDEF CPU64} // fpc on 64 bit cpus
- {$DEFINE DGL_64BIT} // dgl define for 64 bit
-{$ENDIF}
-
-
-
uses
{$IFDEF FPC}{$IFDEF DARWIN}dynlibs,{$ENDIF}{$ENDIF} // LoadLibrary functions
SysUtils
{$IFDEF DGL_WIN}, Windows{$ENDIF}
+ {$IFDEF DGL_64BIT} ,math {$ENDIF}
{$IFDEF DGL_LINUX}, X, XLib, XUtil{$ENDIF}
;
type
- // Needed for Delphi 6 and less (defined in system.pas for Delphi 7)
- PPointer = ^Pointer;
- PCardinal = ^Cardinal;
+ {$IFDEF DELPHI6_AND_DOWN}
+ // Delphi 6 compatibility
+ PPointer = ^Pointer;
+ PCardinal = ^Cardinal;
+ {$ENDIF}
GLenum = Cardinal;
GLboolean = BYTEBOOL;
p_cl_context = ^_cl_context;
p_cl_event = ^_cl_event;
+ // GL_ARB_compute_variable_group_size
+ TglDispatchComputeGroupSizeARB = procedure (num_groups_x : GLuint; num_groups_y : GLuint; num_groups_z : GLuint; group_size_x : GLuint; group_size_y : GLuint; group_size_z : GLuint); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
+
// GL_ARB_debug_output
TglDebugProcARB = procedure (source: GLenum; type_: GLenum; id: GLuint; severity: GLenum; length: GLsizei; const message_: PGLchar; userParam: PGLvoid); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
// GL_AMD_debug_output
TglDebugProcAMD = procedure (id: GLuint; category: GLenum; severity: GLenum; length: GLsizei; const message_: PGLchar; userParam: PGLvoid); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- // (4.3) GL_KHR_debug
+ // GL_KHR_debug (4.3)
TglDebugProc = procedure(source : GLEnum; type_ : GLEnum; id : GLUInt; severity : GLUInt; length : GLsizei; const message_ : PGLCHar; userParam : PGLvoid); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
// GL_NV_vdpau_interop
TGLVector3f = TGLVectorf3;
// Datatypes corresponding to OpenGL12.pas for easy porting
+ TVector3f = TGLVectorf3;
TVector3d = TGLVectord3;
TVector4i = TGLVectori4;
GL_ARB_texture_barrier,
GL_ARB_cl_event,
+ GL_ARB_compute_variable_group_size,
GL_ARB_debug_output,
GL_ARB_robustness,
GL_ARB_shader_stencil_export,
GL_STENCIL_BUFFER_BIT = $00000400;
GL_COLOR_BUFFER_BIT = $00004000;
{ Boolean }
- GL_TRUE = 1;
- GL_FALSE = 0;
+ GL_TRUE: ByteBool = True;
+ GL_FALSE: ByteBool = False;
{ BeginMode }
GL_POINTS = $0000;
GL_LINES = $0001;
GLX_RGBA_FLOAT_TYPE = $20B9;
GLX_RGBA_FLOAT_BIT = $00000004;
+ // GL_ARB_compute_variable_group_size
+ GL_MAX_COMPUTE_VARIABLE_GROUP_INVOCATIONS_ARB = $9344;
+ GL_MAX_COMPUTE_FIXED_GROUP_INVOCATIONS_ARB = $90EB;
+ GL_MAX_COMPUTE_VARIABLE_GROUP_SIZE_ARB = $9345;
+ GL_MAX_COMPUTE_FIXED_GROUP_SIZE_ARB = $91BF;
+
// GL_ARB_half_float_pixel
GL_HALF_FLOAT_ARB = $140B;
GLU_INCOMPATIBLE_GL_VERSION = 100903;
GLU_VERSION = 100800;
GLU_EXTENSIONS = 100801;
- GLU_TRUE = GL_TRUE;
- GLU_FALSE = GL_FALSE;
+ GLU_TRUE: ByteBool = True;
+ GLU_FALSE: ByteBool = False;
GLU_SMOOTH = 100000;
GLU_FLAT = 100001;
GLU_NONE = 100002;
TglClearNamedBufferDataEXT = procedure(buffer : GLuint; internalformat : GLenum; format : GLEnum; type_ : GLEnum; const data : Pointer); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
TglClearNamedBufferSubDataEXT = procedure(buffer : GLuint; internalformat : GLenum; format : GLenum; type_ : GLenum; offset : GLsizeiptr; size : GLsizeiptr; const data : Pointer); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
- // GL_ARB_compute_shader 1
+ // GL_ARB_compute_shader
TglDispatchCompute = procedure(num_groups_x : GLuint; num_groups_y : GLuint; num_groups_z : GLuint); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
TglDispatchComputeIndirect = procedure(indirect : GLintptr); {$IFDEF DGL_WIN}stdcall; {$ELSE}cdecl; {$ENDIF}
// GLX_EXT_texture_from_pixmap
TglXBindTexImageEXT = procedure(dpy: PDisplay; drawable: GLXDrawable; buffer: GLint; const attrib_list: PGLint); cdecl;
TglXReleaseTexImageEXT = procedure(dpy: PDisplay; drawable: GLXDrawable; buffer: GLint); cdecl;
+
+ TglXSwapIntervalEXT = procedure (dpy : PDisplay; drawable : GLXDrawable; interval : GLint); cdecl;
{$ENDIF}
// GL utility functions and procedures
glDebugMessageCallbackARB: TglDebugMessageCallbackARB;
glGetDebugMessageLogARB: TglGetDebugMessageLogARB;
+ // GL_ARB_compute_variable_group_size
+ glDispatchComputeGroupSizeARB : TglDispatchComputeGroupSizeARB;
+
// GL_ARB_robustness
glGetGraphicsResetStatusARB: TglGetGraphicsResetStatusARB;
glGetnMapdvARB: TglGetnMapdvARB;
// GLX_EXT_texture_from_pixmap
glXBindTexImageEXT: TglXBindTexImageEXT;
glXReleaseTexImageEXT: TglXReleaseTexImageEXT;
+
+ glXSwapIntervalEXT : TglXSwapIntervalEXT;
{$ENDIF}
// GL utility functions and procedures
//
procedure Read_GL_ARB_cl_event;
+procedure Read_GL_ARB_compute_variable_group_size;
procedure Read_GL_ARB_debug_output;
procedure Read_GL_ARB_robustness;
procedure Read_GL_ATI_draw_buffers;
// GLX_EXT_texture_from_pixmap
glXBindTexImageEXT := dglGetProcAddress('glXBindTexImageEXT');
glXReleaseTexImageEXT := dglGetProcAddress('glXReleaseTexImageEXT');
+
+ glXSwapIntervalEXT := dglGetProcAddress('glXSwapIntervalEXT');
{$ENDIF}
Result := True;
glCreateSyncFromCLeventARB := dglGetProcAddress('glCreateSyncFromCLeventARB');
end;
+procedure Read_GL_ARB_compute_variable_group_size;
+begin
+ glDispatchComputeGroupSizeARB := dglGetProcAddress('glDispatchComputeGroupSizeARB');
+end;
+
procedure Read_GL_ARB_debug_output;
begin
glDebugMessageControlARB := dglGetProcAddress('glDebugMessageControlARB');
Read_GL_ARB_vertex_attrib_64bit;
Read_GL_ARB_viewport_array;
Read_GL_ARB_cl_event;
+ Read_GL_ARB_compute_variable_group_size;
Read_GL_ARB_debug_output;
Read_GL_ARB_robustness;
//
GL_VERSION_4_3 := True;
if MinorVersion >= 4 then
GL_VERSION_4_4 := True;
- if MinorVersion >= 4 then
+ if MinorVersion >= 5 then
GL_VERSION_4_5:= True;
end;
GL_ARB_shader_precision := Int_CheckExtension(Buffer, 'GL_ARB_shader_precision');
GL_ARB_vertex_attrib_64bit := Int_CheckExtension(Buffer, 'GL_ARB_vertex_attrib_64bit');
GL_ARB_viewport_array := Int_CheckExtension(Buffer, 'GL_ARB_viewport_array');
+ GL_ARB_compute_variable_group_size := Int_CheckExtension(Buffer, 'GL_ARB_compute_variable_group_size');
// GL 4.2
GL_ARB_base_instance := Int_CheckExtension(Buffer, 'GL_ARB_base_instance');
{$IFDEF CPU386}
Set8087CW($133F);
{$ENDIF}
+{$IFDEF DGL_64BIT}
+ SetExceptionMask([exInvalidOp, exDenormalized, exZeroDivide,exOverflow, exUnderflow, exPrecision]);
+{$ENDIF}
+
finalization