| @@ -35,6 +35,21 @@ | |||||
| ============================================================================== } | ============================================================================== } | ||||
| { enable OpenGL ES 1.1 Core functions } | |||||
| {$DEFINE OPENGLES_CORE_1_1} | |||||
| { enable OpenGL ES 2.0 Core functions } | |||||
| {$DEFINE OPENGLES_CORE_2_0} | |||||
| { enable OpenGL ES 3.0 Core functions } | |||||
| {$DEFINE OPENGLES_CORE_3_0} | |||||
| { enable OpenGL ES 3.1 Core functions } | |||||
| {$DEFINE OPENGLES_CORE_3_1} | |||||
| { enable all OpenGL ES extensions } | |||||
| {$DEFINE OPENGLES_EXTENSIONS} | |||||
| unit dglOpenGLES; | unit dglOpenGLES; | ||||
| interface | interface | ||||
| @@ -141,8 +156,9 @@ type | |||||
| TGLvectorp3 = array[0..2] of PGLvoid; | TGLvectorp3 = array[0..2] of PGLvoid; | ||||
| TGLvectorp4 = array[0..3] of PGLvoid; | TGLvectorp4 = array[0..3] of PGLvoid; | ||||
| {$IFDEF OPENGLES_CORE_1_1} | |||||
| const | const | ||||
| { ============================================== OpenGL ES 1.0 ======================================================= } | |||||
| { ============================================== OpenGL ES 1.1 ======================================================= } | |||||
| { ClearBufferMask } | { ClearBufferMask } | ||||
| GL_DEPTH_BUFFER_BIT = $00000100; | GL_DEPTH_BUFFER_BIT = $00000100; | ||||
| GL_STENCIL_BUFFER_BIT = $00000400; | GL_STENCIL_BUFFER_BIT = $00000400; | ||||
| @@ -641,7 +657,10 @@ const | |||||
| GL_DOT3_RGB = $86AE; | GL_DOT3_RGB = $86AE; | ||||
| GL_DOT3_RGBA = $86AF; | GL_DOT3_RGBA = $86AF; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_2_0} | |||||
| const | |||||
| { ============================================== OpenGL ES 2.0 ======================================================= } | { ============================================== OpenGL ES 2.0 ======================================================= } | ||||
| { BlendEquationSeparate } | { BlendEquationSeparate } | ||||
| GL_FUNC_ADD = $8006; | GL_FUNC_ADD = $8006; | ||||
| @@ -815,7 +834,10 @@ const | |||||
| GL_MAX_RENDERBUFFER_SIZE = $84E8; | GL_MAX_RENDERBUFFER_SIZE = $84E8; | ||||
| GL_INVALID_FRAMEBUFFER_OPERATION = $0506; | GL_INVALID_FRAMEBUFFER_OPERATION = $0506; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_0} | |||||
| const | |||||
| { ============================================== OpenGL ES 3.0 ======================================================= } | { ============================================== OpenGL ES 3.0 ======================================================= } | ||||
| GL_READ_BUFFER = $0C02; | GL_READ_BUFFER = $0C02; | ||||
| GL_UNPACK_ROW_LENGTH = $0CF2; | GL_UNPACK_ROW_LENGTH = $0CF2; | ||||
| @@ -1122,7 +1144,10 @@ const | |||||
| GL_MAX_ELEMENT_INDEX = $8D6B; | GL_MAX_ELEMENT_INDEX = $8D6B; | ||||
| GL_NUM_SAMPLE_COUNTS = $9380; | GL_NUM_SAMPLE_COUNTS = $9380; | ||||
| GL_TEXTURE_IMMUTABLE_LEVELS = $82DF; | GL_TEXTURE_IMMUTABLE_LEVELS = $82DF; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_1} | |||||
| const | |||||
| { ============================================== OpenGL ES 3.1 ======================================================= } | { ============================================== OpenGL ES 3.1 ======================================================= } | ||||
| GL_COMPUTE_SHADER = $91B9; | GL_COMPUTE_SHADER = $91B9; | ||||
| GL_MAX_COMPUTE_UNIFORM_BLOCKS = $91BB; | GL_MAX_COMPUTE_UNIFORM_BLOCKS = $91BB; | ||||
| @@ -1296,9 +1321,11 @@ const | |||||
| GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = $82D9; | GL_MAX_VERTEX_ATTRIB_RELATIVE_OFFSET = $82D9; | ||||
| GL_MAX_VERTEX_ATTRIB_BINDINGS = $82DA; | GL_MAX_VERTEX_ATTRIB_BINDINGS = $82DA; | ||||
| GL_MAX_VERTEX_ATTRIB_STRIDE = $82E5; | GL_MAX_VERTEX_ATTRIB_STRIDE = $82E5; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_1_1} | |||||
| type | type | ||||
| { ============================================== OpenGL ES 1.0 ======================================================= } | |||||
| { ============================================== OpenGL ES 1.1 ======================================================= } | |||||
| { Available only in Common profile } | { Available only in Common profile } | ||||
| TglAlphaFunc = procedure(aFunc: GLenum; aRef: GLclampf); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglAlphaFunc = procedure(aFunc: GLenum; aRef: GLclampf); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglClearColor = procedure(aRed: GLclampf; aGreen: GLclampf; aBlue: GLclampf; aAlpha: GLclampf); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglClearColor = procedure(aRed: GLclampf; aGreen: GLclampf; aBlue: GLclampf; aAlpha: GLclampf); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| @@ -1446,7 +1473,10 @@ type | |||||
| TglTranslatex = procedure(x: GLfixed; y: GLfixed; z: GLfixed); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglTranslatex = procedure(x: GLfixed; y: GLfixed; z: GLfixed); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglVertexPointer = procedure(aSize: GLint; aType: GLenum; aStride: GLsizei; const aPointer: PGLvoid); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglVertexPointer = procedure(aSize: GLint; aType: GLenum; aStride: GLsizei; const aPointer: PGLvoid); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglViewport = procedure(x: GLint; y: GLint; aWidth: GLsizei; aHeight: GLsizei); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglViewport = procedure(x: GLint; y: GLint; aWidth: GLsizei; aHeight: GLsizei); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_2_0} | |||||
| type | |||||
| { ============================================== OpenGL ES 2.0 ======================================================= } | { ============================================== OpenGL ES 2.0 ======================================================= } | ||||
| TglAttachShader = procedure(aProgram: GLuint; aShader: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglAttachShader = procedure(aProgram: GLuint; aShader: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglBindAttribLocation = procedure(aProgram: GLuint; aIndex: GLuint; const aName: PGLchar); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglBindAttribLocation = procedure(aProgram: GLuint; aIndex: GLuint; const aName: PGLchar); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| @@ -1532,7 +1562,10 @@ type | |||||
| TglVertexAttrib4f = procedure(aIndex: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglVertexAttrib4f = procedure(aIndex: GLuint; x: GLfloat; y: GLfloat; z: GLfloat; w: GLfloat); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglVertexAttrib4fv = procedure(aIndex: GLuint; const aValues: PGLfloat); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglVertexAttrib4fv = procedure(aIndex: GLuint; const aValues: PGLfloat); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglVertexAttribPointer = procedure(aIndex: GLuint; aSize: GLint; aType: GLenum; aNormalized: GLboolean; aStride: GLsizei; const aPtr: PGLvoid); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglVertexAttribPointer = procedure(aIndex: GLuint; aSize: GLint; aType: GLenum; aNormalized: GLboolean; aStride: GLsizei; const aPtr: PGLvoid); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_0} | |||||
| type | |||||
| { ============================================== OpenGL ES 3.0 ======================================================= } | { ============================================== OpenGL ES 3.0 ======================================================= } | ||||
| TglReadBuffer = procedure(aSrc: GLenum); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglReadBuffer = procedure(aSrc: GLenum); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglDrawRangeElements = procedure(aMode: GLenum; aStart: GLuint; aEnd: GLuint; aCount: GLsizei; aType: GLenum; const aIndices: PGLvoid); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglDrawRangeElements = procedure(aMode: GLenum; aStart: GLuint; aEnd: GLuint; aCount: GLsizei; aType: GLenum; const aIndices: PGLvoid); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| @@ -1638,7 +1671,10 @@ type | |||||
| TglTexStorage2D = procedure(aTarget: GLenum; aLevels: GLsizei; aInternalformat: GLenum; aWidth: GLsizei; aHeight: GLsizei); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglTexStorage2D = procedure(aTarget: GLenum; aLevels: GLsizei; aInternalformat: GLenum; aWidth: GLsizei; aHeight: GLsizei); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglTexStorage3D = procedure(aTarget: GLenum; aLevels: GLsizei; aInternalformat: GLenum; aWidth: GLsizei; aHeight: GLsizei; aDepth: GLsizei); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglTexStorage3D = procedure(aTarget: GLenum; aLevels: GLsizei; aInternalformat: GLenum; aWidth: GLsizei; aHeight: GLsizei; aDepth: GLsizei); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglGetInternalformativ = procedure(aTarget: GLenum; aInternalformat: GLenum; aPname: GLenum; aBufSize: GLsizei; aParams: PGLint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglGetInternalformativ = procedure(aTarget: GLenum; aInternalformat: GLenum; aPname: GLenum; aBufSize: GLsizei; aParams: PGLint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_1} | |||||
| type | |||||
| { ============================================== OpenGL ES 3.1 ======================================================= } | { ============================================== OpenGL ES 3.1 ======================================================= } | ||||
| TglDispatchCompute = procedure(aNumGroupsX: GLuint; aNumGroupsY: GLuint; aNumGroupsZ: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglDispatchCompute = procedure(aNumGroupsX: GLuint; aNumGroupsY: GLuint; aNumGroupsZ: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglDispatchComputeIndirect = procedure(aIndirect: GLintptr); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglDispatchComputeIndirect = procedure(aIndirect: GLintptr); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| @@ -1708,9 +1744,11 @@ type | |||||
| TglVertexAttribIFormat = procedure(aAttribindex: GLuint; aSize: GLint; aType: GLenum; aRelativeoffset: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglVertexAttribIFormat = procedure(aAttribindex: GLuint; aSize: GLint; aType: GLenum; aRelativeoffset: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglVertexAttribBinding = procedure(aAttribindex: GLuint; aBindingindex: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglVertexAttribBinding = procedure(aAttribindex: GLuint; aBindingindex: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| TglVertexBindingDivisor = procedure(aBindingindex: GLuint; aDivisor: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | TglVertexBindingDivisor = procedure(aBindingindex: GLuint; aDivisor: GLuint); {$IFDEF DGL_WIN}stdcall;{$ELSE}cdecl;{$ENDIF} | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_1_1} | |||||
| var | var | ||||
| { ============================================== OpenGL ES 1.0 ======================================================= } | |||||
| { ============================================== OpenGL ES 1.1 ======================================================= } | |||||
| { Available only in Common profile } | { Available only in Common profile } | ||||
| glAlphaFunc: TglAlphaFunc; | glAlphaFunc: TglAlphaFunc; | ||||
| glClearColor: TglClearColor; | glClearColor: TglClearColor; | ||||
| @@ -1858,7 +1896,10 @@ var | |||||
| glTranslatex: TglTranslatex; | glTranslatex: TglTranslatex; | ||||
| glVertexPointer: TglVertexPointer; | glVertexPointer: TglVertexPointer; | ||||
| glViewport: TglViewport; | glViewport: TglViewport; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_2_0} | |||||
| var | |||||
| { ============================================== OpenGL ES 2.0 ======================================================= } | { ============================================== OpenGL ES 2.0 ======================================================= } | ||||
| glAttachShader: TglAttachShader; | glAttachShader: TglAttachShader; | ||||
| glBindAttribLocation: TglBindAttribLocation; | glBindAttribLocation: TglBindAttribLocation; | ||||
| @@ -1944,8 +1985,11 @@ var | |||||
| glVertexAttrib4f: TglVertexAttrib4f; | glVertexAttrib4f: TglVertexAttrib4f; | ||||
| glVertexAttrib4fv: TglVertexAttrib4fv; | glVertexAttrib4fv: TglVertexAttrib4fv; | ||||
| glVertexAttribPointer: TglVertexAttribPointer; | glVertexAttribPointer: TglVertexAttribPointer; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_0} | |||||
| { ============================================== OpenGL ES 3.0 ======================================================= } | { ============================================== OpenGL ES 3.0 ======================================================= } | ||||
| var | |||||
| glReadBuffer: TglReadBuffer; | glReadBuffer: TglReadBuffer; | ||||
| glDrawRangeElements: TglDrawRangeElements; | glDrawRangeElements: TglDrawRangeElements; | ||||
| glTexImage3D: TglTexImage3D; | glTexImage3D: TglTexImage3D; | ||||
| @@ -2050,8 +2094,11 @@ var | |||||
| glTexStorage2D: TglTexStorage2D; | glTexStorage2D: TglTexStorage2D; | ||||
| glTexStorage3D: TglTexStorage3D; | glTexStorage3D: TglTexStorage3D; | ||||
| glGetInternalformativ: TglGetInternalformativ; | glGetInternalformativ: TglGetInternalformativ; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_1} | |||||
| { ============================================== OpenGL ES 3.1 ======================================================= } | { ============================================== OpenGL ES 3.1 ======================================================= } | ||||
| var | |||||
| glDispatchCompute: TglDispatchCompute; | glDispatchCompute: TglDispatchCompute; | ||||
| glDispatchComputeIndirect: TglDispatchComputeIndirect; | glDispatchComputeIndirect: TglDispatchComputeIndirect; | ||||
| glDrawArraysIndirect: TglDrawArraysIndirect; | glDrawArraysIndirect: TglDrawArraysIndirect; | ||||
| @@ -2120,7 +2167,9 @@ var | |||||
| glVertexAttribIFormat: TglVertexAttribIFormat; | glVertexAttribIFormat: TglVertexAttribIFormat; | ||||
| glVertexAttribBinding: TglVertexAttribBinding; | glVertexAttribBinding: TglVertexAttribBinding; | ||||
| glVertexBindingDivisor: TglVertexBindingDivisor; | glVertexBindingDivisor: TglVertexBindingDivisor; | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_EXTENSIONS} | |||||
| { =============================================== Extensions ========================================================= } | { =============================================== Extensions ========================================================= } | ||||
| { GL_KHR_blend_equation_advanced } | { GL_KHR_blend_equation_advanced } | ||||
| const | const | ||||
| @@ -2520,7 +2569,7 @@ var | |||||
| glIsVertexArrayOES: TglIsVertexArrayOES; | glIsVertexArrayOES: TglIsVertexArrayOES; | ||||
| { GL_OES_vertex_half_float } | { GL_OES_vertex_half_float } | ||||
| // none | |||||
| // none {$IFDEF OPENGLES_EXTENSIONS} | |||||
| { GL_OES_vertex_type_10_10_10_2 } | { GL_OES_vertex_type_10_10_10_2 } | ||||
| const | const | ||||
| @@ -4315,6 +4364,7 @@ const | |||||
| { GL_VIV_shader_binary } | { GL_VIV_shader_binary } | ||||
| const | const | ||||
| GL_SHADER_BINARY_VIV = $8FC4; | GL_SHADER_BINARY_VIV = $8FC4; | ||||
| {$ENDIF} | |||||
| { ================================================== EGL ============================================================= } | { ================================================== EGL ============================================================= } | ||||
| type | type | ||||
| @@ -4603,7 +4653,8 @@ var | |||||
| GL_VERSION_1_1, | GL_VERSION_1_1, | ||||
| GL_VERSION_2_0, | GL_VERSION_2_0, | ||||
| GL_VERSION_3_0, | GL_VERSION_3_0, | ||||
| GL_VERSION_3_1, | |||||
| GL_VERSION_3_1 | |||||
| {$IFDEF OPENGLES_EXTENSIONS}, | |||||
| GL_KHR_blend_equation_advanced, | GL_KHR_blend_equation_advanced, | ||||
| GL_KHR_blend_equation_advanced_coherent, | GL_KHR_blend_equation_advanced_coherent, | ||||
| GL_KHR_context_flush_control, | GL_KHR_context_flush_control, | ||||
| @@ -4781,7 +4832,9 @@ var | |||||
| GL_QCOM_perfmon_global_mode, | GL_QCOM_perfmon_global_mode, | ||||
| GL_QCOM_tiled_rendering, | GL_QCOM_tiled_rendering, | ||||
| GL_QCOM_writeonly_rendering, | GL_QCOM_writeonly_rendering, | ||||
| GL_VIV_shader_binary: Boolean; | |||||
| GL_VIV_shader_binary | |||||
| {$ENDIF} | |||||
| : Boolean; | |||||
| type | type | ||||
| EdglOpenGLES = class(Exception); | EdglOpenGLES = class(Exception); | ||||
| @@ -4821,6 +4874,7 @@ procedure ReadExtensions; | |||||
| procedure ReadCoreVersion; | procedure ReadCoreVersion; | ||||
| procedure ReadImplementationProperties; | procedure ReadImplementationProperties; | ||||
| {$IFDEF OPENGLES_EXTENSIONS} | |||||
| procedure Read_GL_KHR_blend_equation_advanced; | procedure Read_GL_KHR_blend_equation_advanced; | ||||
| procedure Read_GL_KHR_debug; | procedure Read_GL_KHR_debug; | ||||
| procedure Read_GL_KHR_robustness; | procedure Read_GL_KHR_robustness; | ||||
| @@ -4887,6 +4941,7 @@ procedure Read_GL_QCOM_driver_control; | |||||
| procedure Read_GL_QCOM_extended_get; | procedure Read_GL_QCOM_extended_get; | ||||
| procedure Read_GL_QCOM_extended_get2; | procedure Read_GL_QCOM_extended_get2; | ||||
| procedure Read_GL_QCOM_tiled_rendering; | procedure Read_GL_QCOM_tiled_rendering; | ||||
| {$ENDIF} | |||||
| implementation | implementation | ||||
| @@ -5061,7 +5116,8 @@ end; | |||||
| procedure ReadOpenGLCore; | procedure ReadOpenGLCore; | ||||
| begin | begin | ||||
| { ============================================= OpenGL ES 1.0 ====================================================== } | |||||
| {$IFDEF OPENGLES_CORE_1_1} | |||||
| { ============================================= OpenGL ES 1.1 ====================================================== } | |||||
| { Available only in Common profile } | { Available only in Common profile } | ||||
| glAlphaFunc := dglGetProcAddress('glAlphaFunc'); | glAlphaFunc := dglGetProcAddress('glAlphaFunc'); | ||||
| glClearColor := dglGetProcAddress('glClearColor'); | glClearColor := dglGetProcAddress('glClearColor'); | ||||
| @@ -5209,7 +5265,9 @@ begin | |||||
| glTranslatex := dglGetProcAddress('glTranslatex'); | glTranslatex := dglGetProcAddress('glTranslatex'); | ||||
| glVertexPointer := dglGetProcAddress('glVertexPointer'); | glVertexPointer := dglGetProcAddress('glVertexPointer'); | ||||
| glViewport := dglGetProcAddress('glViewport'); | glViewport := dglGetProcAddress('glViewport'); | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_2_0} | |||||
| { ============================================= OpenGL ES 2.0 ====================================================== } | { ============================================= OpenGL ES 2.0 ====================================================== } | ||||
| glAttachShader := dglGetProcAddress('glAttachShader'); | glAttachShader := dglGetProcAddress('glAttachShader'); | ||||
| glBindAttribLocation := dglGetProcAddress('glBindAttribLocation'); | glBindAttribLocation := dglGetProcAddress('glBindAttribLocation'); | ||||
| @@ -5295,7 +5353,9 @@ begin | |||||
| glVertexAttrib4f := dglGetProcAddress('glVertexAttrib4f'); | glVertexAttrib4f := dglGetProcAddress('glVertexAttrib4f'); | ||||
| glVertexAttrib4fv := dglGetProcAddress('glVertexAttrib4fv'); | glVertexAttrib4fv := dglGetProcAddress('glVertexAttrib4fv'); | ||||
| glVertexAttribPointer := dglGetProcAddress('glVertexAttribPointer'); | glVertexAttribPointer := dglGetProcAddress('glVertexAttribPointer'); | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_0} | |||||
| { ============================================= OpenGL ES 3.0 ====================================================== } | { ============================================= OpenGL ES 3.0 ====================================================== } | ||||
| glReadBuffer := dglGetProcAddress('glReadBuffer'); | glReadBuffer := dglGetProcAddress('glReadBuffer'); | ||||
| glDrawRangeElements := dglGetProcAddress('glDrawRangeElements'); | glDrawRangeElements := dglGetProcAddress('glDrawRangeElements'); | ||||
| @@ -5401,7 +5461,9 @@ begin | |||||
| glTexStorage2D := dglGetProcAddress('glTexStorage2D'); | glTexStorage2D := dglGetProcAddress('glTexStorage2D'); | ||||
| glTexStorage3D := dglGetProcAddress('glTexStorage3D'); | glTexStorage3D := dglGetProcAddress('glTexStorage3D'); | ||||
| glGetInternalformativ := dglGetProcAddress('glGetInternalformativ'); | glGetInternalformativ := dglGetProcAddress('glGetInternalformativ'); | ||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_CORE_3_1} | |||||
| { ============================================= OpenGL ES 3.1 ====================================================== } | { ============================================= OpenGL ES 3.1 ====================================================== } | ||||
| glDispatchCompute := dglGetProcAddress('glDispatchCompute'); | glDispatchCompute := dglGetProcAddress('glDispatchCompute'); | ||||
| glDispatchComputeIndirect := dglGetProcAddress('glDispatchComputeIndirect'); | glDispatchComputeIndirect := dglGetProcAddress('glDispatchComputeIndirect'); | ||||
| @@ -5471,10 +5533,12 @@ begin | |||||
| glVertexAttribIFormat := dglGetProcAddress('glVertexAttribIFormat'); | glVertexAttribIFormat := dglGetProcAddress('glVertexAttribIFormat'); | ||||
| glVertexAttribBinding := dglGetProcAddress('glVertexAttribBinding'); | glVertexAttribBinding := dglGetProcAddress('glVertexAttribBinding'); | ||||
| glVertexBindingDivisor := dglGetProcAddress('glVertexBindingDivisor'); | glVertexBindingDivisor := dglGetProcAddress('glVertexBindingDivisor'); | ||||
| {$ENDIF} | |||||
| end; | end; | ||||
| procedure ReadExtensions; | procedure ReadExtensions; | ||||
| begin | begin | ||||
| {$IFDEF OPENGLES_EXTENSIONS} | |||||
| Read_GL_KHR_blend_equation_advanced; | Read_GL_KHR_blend_equation_advanced; | ||||
| Read_GL_KHR_debug; | Read_GL_KHR_debug; | ||||
| Read_GL_KHR_robustness; | Read_GL_KHR_robustness; | ||||
| @@ -5541,6 +5605,7 @@ begin | |||||
| Read_GL_QCOM_extended_get; | Read_GL_QCOM_extended_get; | ||||
| Read_GL_QCOM_extended_get2; | Read_GL_QCOM_extended_get2; | ||||
| Read_GL_QCOM_tiled_rendering; | Read_GL_QCOM_tiled_rendering; | ||||
| {$ENDIF} | |||||
| end; | end; | ||||
| procedure ReadCoreVersion; | procedure ReadCoreVersion; | ||||
| @@ -5595,6 +5660,7 @@ begin | |||||
| GL_VERSION_3_1 := (GLmajor >= 3) and (GLminor >= 1); | GL_VERSION_3_1 := (GLmajor >= 3) and (GLminor >= 1); | ||||
| end; | end; | ||||
| {$IFDEF OPENGLES_EXTENSIONS} | |||||
| procedure ReadImplementationProperties; | procedure ReadImplementationProperties; | ||||
| function GetExtensions: String; | function GetExtensions: String; | ||||
| @@ -5608,6 +5674,7 @@ procedure ReadImplementationProperties; | |||||
| if Assigned(glGetString) then | if Assigned(glGetString) then | ||||
| result := String(PAnsiChar(glGetString(GL_EXTENSIONS))); | result := String(PAnsiChar(glGetString(GL_EXTENSIONS))); | ||||
| {$IFDEF OPENGLES_CORE_3_0} | |||||
| if (result = '') then begin | if (result = '') then begin | ||||
| if not Assigned(glGetIntegerv) then | if not Assigned(glGetIntegerv) then | ||||
| glGetIntegerv := dglGetProcAddress('glGetIntegerv'); | glGetIntegerv := dglGetProcAddress('glGetIntegerv'); | ||||
| @@ -5622,6 +5689,7 @@ procedure ReadImplementationProperties; | |||||
| end; | end; | ||||
| end; | end; | ||||
| end; | end; | ||||
| {$ENDIF} | |||||
| result := #$20 + result + #$20; | result := #$20 + result + #$20; | ||||
| end; | end; | ||||
| @@ -5846,7 +5914,14 @@ begin | |||||
| // VIV | // VIV | ||||
| GL_VIV_shader_binary := CheckEx(Buffer, 'GL_VIV_shader_binary'); | GL_VIV_shader_binary := CheckEx(Buffer, 'GL_VIV_shader_binary'); | ||||
| end; | end; | ||||
| {$ELSE} | |||||
| procedure ReadImplementationProperties; | |||||
| begin | |||||
| // nothing to do here | |||||
| end; | |||||
| {$ENDIF} | |||||
| {$IFDEF OPENGLES_EXTENSIONS} | |||||
| procedure Read_GL_KHR_blend_equation_advanced; | procedure Read_GL_KHR_blend_equation_advanced; | ||||
| begin | begin | ||||
| glBlendBarrierKHR := dglGetProcAddress('glBlendBarrierKHR'); | glBlendBarrierKHR := dglGetProcAddress('glBlendBarrierKHR'); | ||||
| @@ -6430,6 +6505,7 @@ begin | |||||
| glStartTilingQCOM := dglGetProcAddress('glStartTilingQCOM'); | glStartTilingQCOM := dglGetProcAddress('glStartTilingQCOM'); | ||||
| glEndTilingQCOM := dglGetProcAddress('glEndTilingQCOM'); | glEndTilingQCOM := dglGetProcAddress('glEndTilingQCOM'); | ||||
| end; | end; | ||||
| {$ENDIF} | |||||
| constructor EeglError.Create(const msg: string; const aErrorCode: EGLint); | constructor EeglError.Create(const msg: string; const aErrorCode: EGLint); | ||||
| begin | begin | ||||