1 #ifndef DALI_INTERNAL_GL_IMPLEMENTATION_H
2 #define DALI_INTERNAL_GL_IMPLEMENTATION_H
5 * Copyright (c) 2019 Samsung Electronics Co., Ltd.
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
11 * http://www.apache.org/licenses/LICENSE-2.0
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
24 #include <GLES2/gl2.h>
25 #include <dali/integration-api/gl-abstraction.h>
28 #include <dali/internal/graphics/gles/gles-abstraction.h>
29 #include <dali/internal/graphics/gles/gles2-implementation.h>
30 #include <dali/internal/graphics/gles/gles3-implementation.h>
42 * GlImplementation is a concrete implementation for GlAbstraction.
43 * The class provides an OpenGL-ES 2.0 or 3.0 implementation.
44 * The class is provided when creating the Integration::Core object.
46 class GlImplementation : public Dali::Integration::GlAbstraction
52 mIsSurfacelessContextSupported( false )
54 mImpl.reset( new Gles3Implementation() );
57 virtual ~GlImplementation() {}
61 /* Do nothing in main implementation */
66 /* Do nothing in main implementation */
69 void SetGlesVersion( const int32_t glesVersion )
71 if( mGlesVersion != glesVersion )
73 mGlesVersion = glesVersion;
74 if( mGlesVersion >= 30 )
76 mImpl.reset( new Gles3Implementation() );
80 mImpl.reset( new Gles2Implementation() );
85 void SetIsSurfacelessContextSupported( const bool isSupported )
87 mIsSurfacelessContextSupported = isSupported;
90 bool IsSurfacelessContextSupported() const
92 return mIsSurfacelessContextSupported;
95 bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
97 bool convert = ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
98 if( mGlesVersion >= 30 )
100 // Don't convert manually from RGB to RGBA if GLES >= 3.0 and a sub-image is uploaded.
101 convert = ( convert && !isSubImage );
108 void ActiveTexture( GLenum texture )
110 glActiveTexture( texture );
113 void AttachShader( GLuint program, GLuint shader )
115 glAttachShader( program, shader );
118 void BindAttribLocation( GLuint program, GLuint index, const char* name )
120 glBindAttribLocation( program, index, name );
123 void BindBuffer( GLenum target, GLuint buffer )
125 glBindBuffer( target, buffer );
128 void BindFramebuffer( GLenum target, GLuint framebuffer )
130 glBindFramebuffer( target, framebuffer );
133 void BindRenderbuffer( GLenum target, GLuint renderbuffer )
135 glBindRenderbuffer( target, renderbuffer );
138 void BindTexture( GLenum target, GLuint texture )
140 glBindTexture( target, texture );
143 void BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
145 glBlendColor( red, green, blue, alpha );
148 void BlendEquation( GLenum mode )
150 glBlendEquation( mode );
153 void BlendEquationSeparate( GLenum modeRGB, GLenum modeAlpha )
155 glBlendEquationSeparate( modeRGB, modeAlpha );
158 void BlendFunc( GLenum sfactor, GLenum dfactor )
160 glBlendFunc( sfactor, dfactor );
163 void BlendFuncSeparate( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
165 glBlendFuncSeparate( srcRGB, dstRGB, srcAlpha, dstAlpha );
168 void BufferData( GLenum target, GLsizeiptr size, const void* data, GLenum usage )
170 glBufferData( target, size, data, usage );
173 void BufferSubData( GLenum target, GLintptr offset, GLsizeiptr size, const void* data )
175 glBufferSubData( target, offset, size, data );
178 GLenum CheckFramebufferStatus( GLenum target )
180 return glCheckFramebufferStatus( target );
183 void Clear( GLbitfield mask )
188 void ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
190 glClearColor( red, green, blue, alpha );
193 void ClearDepthf( GLclampf depth )
195 glClearDepthf( depth );
198 void ClearStencil( GLint s )
203 void ColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
205 glColorMask( red, green, blue, alpha );
208 void CompileShader( GLuint shader )
210 glCompileShader( shader );
213 void CompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data )
215 glCompressedTexImage2D( target, level, internalformat, width, height, border, imageSize, data );
218 void CompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data )
220 glCompressedTexSubImage2D( target, level, xoffset, yoffset, width, height, format, imageSize, data );
223 void CopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
225 glCopyTexImage2D( target, level, internalformat, x, y, width, height, border );
228 void CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
230 glCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height );
233 GLuint CreateProgram( void )
235 return glCreateProgram();
238 GLuint CreateShader( GLenum type )
240 return glCreateShader( type );
243 void CullFace( GLenum mode )
248 void DeleteBuffers( GLsizei n, const GLuint* buffers )
250 glDeleteBuffers( n, buffers );
253 void DeleteFramebuffers( GLsizei n, const GLuint* framebuffers )
255 glDeleteFramebuffers( n, framebuffers );
258 void DeleteProgram( GLuint program )
260 glDeleteProgram( program );
263 void DeleteRenderbuffers( GLsizei n, const GLuint* renderbuffers )
265 glDeleteRenderbuffers( n, renderbuffers );
268 void DeleteShader( GLuint shader )
270 glDeleteShader( shader );
273 void DeleteTextures( GLsizei n, const GLuint* textures )
275 glDeleteTextures( n, textures );
278 void DepthFunc( GLenum func )
283 void DepthMask( GLboolean flag )
288 void DepthRangef( GLclampf zNear, GLclampf zFar )
290 glDepthRangef( zNear, zFar );
293 void DetachShader( GLuint program, GLuint shader )
295 glDetachShader( program, shader );
298 void Disable( GLenum cap )
303 void DisableVertexAttribArray( GLuint index )
305 glDisableVertexAttribArray( index );
308 void DrawArrays( GLenum mode, GLint first, GLsizei count )
310 glDrawArrays( mode, first, count );
313 void DrawElements( GLenum mode, GLsizei count, GLenum type, const void* indices )
315 glDrawElements( mode, count, type, indices );
318 void Enable( GLenum cap )
323 void EnableVertexAttribArray( GLuint index )
325 glEnableVertexAttribArray( index );
338 void FramebufferRenderbuffer( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
340 glFramebufferRenderbuffer( target, attachment, renderbuffertarget, renderbuffer );
343 void FramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
345 glFramebufferTexture2D( target, attachment, textarget, texture, level );
348 void FrontFace( GLenum mode )
353 void GenBuffers( GLsizei n, GLuint* buffers )
355 glGenBuffers( n, buffers );
358 void GenerateMipmap( GLenum target )
360 glGenerateMipmap( target );
363 void GenFramebuffers( GLsizei n, GLuint* framebuffers )
365 glGenFramebuffers( n, framebuffers );
368 void GenRenderbuffers( GLsizei n, GLuint* renderbuffers )
370 glGenRenderbuffers( n, renderbuffers );
373 void GenTextures( GLsizei n, GLuint* textures )
375 glGenTextures( n, textures );
378 void GetActiveAttrib( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name )
380 glGetActiveAttrib( program, index, bufsize, length, size, type, name );
383 void GetActiveUniform( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name )
385 glGetActiveUniform( program, index, bufsize, length, size, type, name );
388 void GetAttachedShaders( GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders )
390 glGetAttachedShaders( program, maxcount, count, shaders );
393 int GetAttribLocation( GLuint program, const char* name )
395 return glGetAttribLocation( program, name );
398 void GetBooleanv( GLenum pname, GLboolean* params )
400 glGetBooleanv( pname, params );
403 void GetBufferParameteriv( GLenum target, GLenum pname, GLint* params )
405 glGetBufferParameteriv( target, pname, params );
408 GLenum GetError( void )
413 void GetFloatv( GLenum pname, GLfloat* params )
415 glGetFloatv( pname, params );
418 void GetFramebufferAttachmentParameteriv( GLenum target, GLenum attachment, GLenum pname, GLint* params )
420 glGetFramebufferAttachmentParameteriv( target, attachment, pname, params );
423 void GetIntegerv( GLenum pname, GLint* params )
425 glGetIntegerv( pname, params );
428 void GetProgramiv( GLuint program, GLenum pname, GLint* params )
430 glGetProgramiv( program, pname, params );
433 void GetProgramInfoLog( GLuint program, GLsizei bufsize, GLsizei* length, char* infolog )
435 glGetProgramInfoLog( program, bufsize, length, infolog );
438 void GetRenderbufferParameteriv( GLenum target, GLenum pname, GLint* params )
440 glGetRenderbufferParameteriv( target, pname, params );
443 void GetShaderiv( GLuint shader, GLenum pname, GLint* params )
445 glGetShaderiv( shader, pname, params );
448 void GetShaderInfoLog( GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog )
450 glGetShaderInfoLog( shader, bufsize, length, infolog );
453 void GetShaderPrecisionFormat( GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision )
455 glGetShaderPrecisionFormat( shadertype, precisiontype, range, precision );
458 void GetShaderSource( GLuint shader, GLsizei bufsize, GLsizei* length, char* source )
460 glGetShaderSource( shader, bufsize, length, source );
463 const GLubyte* GetString( GLenum name )
465 return glGetString( name );
468 void GetTexParameterfv( GLenum target, GLenum pname, GLfloat* params )
470 glGetTexParameterfv( target, pname, params );
473 void GetTexParameteriv( GLenum target, GLenum pname, GLint* params )
475 glGetTexParameteriv( target, pname, params );
478 void GetUniformfv( GLuint program, GLint location, GLfloat* params )
480 glGetUniformfv( program, location, params );
483 void GetUniformiv( GLuint program, GLint location, GLint* params )
485 glGetUniformiv( program, location, params );
488 int GetUniformLocation( GLuint program, const char* name )
490 return glGetUniformLocation( program, name );
493 void GetVertexAttribfv( GLuint index, GLenum pname, GLfloat* params )
495 glGetVertexAttribfv( index, pname, params );
498 void GetVertexAttribiv( GLuint index, GLenum pname, GLint* params )
500 glGetVertexAttribiv( index, pname, params );
503 void GetVertexAttribPointerv( GLuint index, GLenum pname, void** pointer )
505 glGetVertexAttribPointerv( index, pname, pointer );
508 void Hint( GLenum target, GLenum mode )
510 glHint( target, mode );
513 GLboolean IsBuffer( GLuint buffer )
515 return glIsBuffer( buffer );
518 GLboolean IsEnabled( GLenum cap )
520 return glIsEnabled( cap );
523 GLboolean IsFramebuffer( GLuint framebuffer )
525 return glIsFramebuffer( framebuffer );
528 GLboolean IsProgram( GLuint program )
530 return glIsProgram( program );
533 GLboolean IsRenderbuffer( GLuint renderbuffer )
535 return glIsRenderbuffer( renderbuffer );
538 GLboolean IsShader( GLuint shader )
540 return glIsShader( shader );
543 GLboolean IsTexture( GLuint texture )
545 return glIsTexture( texture );
548 void LineWidth( GLfloat width )
550 glLineWidth( width );
553 void LinkProgram( GLuint program )
555 glLinkProgram( program );
558 void PixelStorei( GLenum pname, GLint param )
560 glPixelStorei( pname, param );
563 void PolygonOffset( GLfloat factor, GLfloat units )
565 glPolygonOffset( factor, units );
568 void ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels )
570 glReadPixels( x, y, width, height, format, type, pixels );
573 void ReleaseShaderCompiler( void )
575 glReleaseShaderCompiler();
578 void RenderbufferStorage( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
580 glRenderbufferStorage( target, internalformat, width, height );
583 void SampleCoverage( GLclampf value, GLboolean invert )
585 glSampleCoverage( value, invert );
588 void Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
590 glScissor( x, y, width, height );
593 void ShaderBinary( GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length )
595 glShaderBinary( n, shaders, binaryformat, binary, length );
598 void ShaderSource( GLuint shader, GLsizei count, const char** string, const GLint* length )
600 glShaderSource( shader, count, string, length );
603 void StencilFunc( GLenum func, GLint ref, GLuint mask )
605 glStencilFunc( func, ref, mask );
608 void StencilFuncSeparate( GLenum face, GLenum func, GLint ref, GLuint mask )
610 glStencilFuncSeparate( face, func, ref, mask );
613 void StencilMask( GLuint mask )
615 glStencilMask( mask );
618 void StencilMaskSeparate( GLenum face, GLuint mask )
620 glStencilMaskSeparate( face, mask );
623 void StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
625 glStencilOp( fail, zfail, zpass );
628 void StencilOpSeparate( GLenum face, GLenum fail, GLenum zfail, GLenum zpass )
630 glStencilOpSeparate( face, fail, zfail, zpass );
633 void TexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels )
635 glTexImage2D( target, level, internalformat, width, height, border, format, type, pixels );
638 void TexParameterf( GLenum target, GLenum pname, GLfloat param )
640 glTexParameterf( target, pname, param );
643 void TexParameterfv( GLenum target, GLenum pname, const GLfloat* params )
645 glTexParameterfv( target, pname, params );
648 void TexParameteri( GLenum target, GLenum pname, GLint param )
650 glTexParameteri( target, pname, param );
653 void TexParameteriv( GLenum target, GLenum pname, const GLint* params )
655 glTexParameteriv( target, pname, params );
658 void TexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels )
660 glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels );
663 void Uniform1f( GLint location, GLfloat x )
665 glUniform1f( location, x );
668 void Uniform1fv( GLint location, GLsizei count, const GLfloat* v )
670 glUniform1fv( location, count, v );
673 void Uniform1i( GLint location, GLint x )
675 glUniform1i( location, x );
678 void Uniform1iv( GLint location, GLsizei count, const GLint* v )
680 glUniform1iv( location, count, v );
683 void Uniform2f( GLint location, GLfloat x, GLfloat y )
685 glUniform2f( location, x, y );
688 void Uniform2fv( GLint location, GLsizei count, const GLfloat* v )
690 glUniform2fv( location, count, v );
693 void Uniform2i( GLint location, GLint x, GLint y )
695 glUniform2i( location, x, y );
698 void Uniform2iv( GLint location, GLsizei count, const GLint* v )
700 glUniform2iv( location, count, v );
703 void Uniform3f( GLint location, GLfloat x, GLfloat y, GLfloat z )
705 glUniform3f( location, x, y, z );
708 void Uniform3fv( GLint location, GLsizei count, const GLfloat* v )
710 glUniform3fv( location, count, v );
713 void Uniform3i( GLint location, GLint x, GLint y, GLint z )
715 glUniform3i( location, x, y, z );
718 void Uniform3iv( GLint location, GLsizei count, const GLint* v )
720 glUniform3iv( location, count, v );
723 void Uniform4f( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
725 glUniform4f( location, x, y, z, w );
728 void Uniform4fv( GLint location, GLsizei count, const GLfloat* v )
730 glUniform4fv( location, count, v );
733 void Uniform4i( GLint location, GLint x, GLint y, GLint z, GLint w )
735 glUniform4i( location, x, y, z, w );
738 void Uniform4iv( GLint location, GLsizei count, const GLint* v )
740 glUniform4iv( location, count, v );
743 void UniformMatrix2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
745 glUniformMatrix2fv( location, count, transpose, value );
748 void UniformMatrix3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
750 glUniformMatrix3fv( location, count, transpose, value );
753 void UniformMatrix4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
755 glUniformMatrix4fv( location, count, transpose, value );
758 void UseProgram( GLuint program )
760 glUseProgram( program );
763 void ValidateProgram( GLuint program )
765 glValidateProgram( program );
768 void VertexAttrib1f( GLuint indx, GLfloat x )
770 glVertexAttrib1f( indx, x );
773 void VertexAttrib1fv( GLuint indx, const GLfloat* values )
775 glVertexAttrib1fv( indx, values );
778 void VertexAttrib2f( GLuint indx, GLfloat x, GLfloat y )
780 glVertexAttrib2f( indx, x, y );
783 void VertexAttrib2fv( GLuint indx, const GLfloat* values )
785 glVertexAttrib2fv( indx, values );
788 void VertexAttrib3f( GLuint indx, GLfloat x, GLfloat y, GLfloat z )
790 glVertexAttrib3f( indx, x, y, z );
793 void VertexAttrib3fv( GLuint indx, const GLfloat* values )
795 glVertexAttrib3fv( indx, values );
798 void VertexAttrib4f( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
800 glVertexAttrib4f( indx, x, y, z, w );
803 void VertexAttrib4fv( GLuint indx, const GLfloat* values )
805 glVertexAttrib4fv( indx, values );
808 void VertexAttribPointer( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr )
810 glVertexAttribPointer( indx, size, type, normalized, stride, ptr );
813 void Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
815 glViewport( x, y, width, height );
820 void ReadBuffer( GLenum mode )
822 mImpl->ReadBuffer( mode );
825 void DrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices )
827 mImpl->DrawRangeElements( mode, start, end, count, type, indices );
830 void TexImage3D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels )
832 mImpl->TexImage3D( target, level, internalformat, width, height, depth, border, format, type, pixels );
835 void TexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels )
837 mImpl->TexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels );
840 void CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height )
842 mImpl->CopyTexSubImage3D( target, level, xoffset, yoffset, zoffset, x, y, width, height );
845 void CompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data )
847 mImpl->CompressedTexImage3D( target, level, internalformat, width, height, depth, border, imageSize, data );
850 void CompressedTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data )
852 mImpl->CompressedTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data );
855 void GenQueries( GLsizei n, GLuint* ids )
857 mImpl->GenQueries( n, ids );
860 void DeleteQueries( GLsizei n, const GLuint* ids )
862 mImpl->DeleteQueries( n, ids );
865 GLboolean IsQuery( GLuint id )
867 return mImpl->IsQuery( id );
870 void BeginQuery( GLenum target, GLuint id )
872 mImpl->BeginQuery( target, id );
875 void EndQuery( GLenum target )
877 mImpl->EndQuery( target );
880 void GetQueryiv( GLenum target, GLenum pname, GLint* params )
882 mImpl->GetQueryiv( target, pname, params );
885 void GetQueryObjectuiv( GLuint id, GLenum pname, GLuint* params )
887 mImpl->GetQueryObjectuiv( id, pname, params );
890 GLboolean UnmapBuffer( GLenum target )
892 return mImpl->UnmapBuffer( target );
895 void GetBufferPointerv( GLenum target, GLenum pname, GLvoid** params )
897 mImpl->GetBufferPointerv( target, pname, params );
900 void DrawBuffers( GLsizei n, const GLenum* bufs )
902 mImpl->DrawBuffers( n, bufs );
905 void UniformMatrix2x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
907 mImpl->UniformMatrix2x3fv( location, count, transpose, value );
910 void UniformMatrix3x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
912 mImpl->UniformMatrix3x2fv( location, count, transpose, value );
915 void UniformMatrix2x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
917 mImpl->UniformMatrix2x4fv( location, count, transpose, value );
920 void UniformMatrix4x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
922 mImpl->UniformMatrix4x2fv( location, count, transpose, value );
925 void UniformMatrix3x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
927 mImpl->UniformMatrix3x4fv( location, count, transpose, value );
930 void UniformMatrix4x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
932 mImpl->UniformMatrix4x3fv( location, count, transpose, value );
935 void BlitFramebuffer( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter )
937 mImpl->BlitFramebuffer( srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter );
940 void RenderbufferStorageMultisample( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height )
942 mImpl->RenderbufferStorageMultisample( target, samples, internalformat, width, height );
945 void FramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer )
947 mImpl->FramebufferTextureLayer( target, attachment, texture, level, layer );
950 GLvoid* MapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access )
952 return mImpl->MapBufferRange( target, offset, length, access );
955 void FlushMappedBufferRange( GLenum target, GLintptr offset, GLsizeiptr length )
957 mImpl->FlushMappedBufferRange( target, offset, length );
960 void BindVertexArray( GLuint array )
962 mImpl->BindVertexArray( array );
965 void DeleteVertexArrays( GLsizei n, const GLuint* arrays )
967 mImpl->DeleteVertexArrays( n, arrays );
970 void GenVertexArrays( GLsizei n, GLuint* arrays )
972 mImpl->GenVertexArrays( n, arrays );
975 GLboolean IsVertexArray( GLuint array )
977 return mImpl->IsVertexArray( array );
980 void GetIntegeri_v( GLenum target, GLuint index, GLint* data )
982 mImpl->GetIntegeri_v( target, index, data );
985 void BeginTransformFeedback( GLenum primitiveMode )
987 mImpl->BeginTransformFeedback( primitiveMode );
990 void EndTransformFeedback( void )
992 mImpl->EndTransformFeedback();
995 void BindBufferRange( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size )
997 mImpl->BindBufferRange( target, index, buffer, offset, size );
1000 void BindBufferBase( GLenum target, GLuint index, GLuint buffer )
1002 mImpl->BindBufferBase( target, index, buffer );
1005 void TransformFeedbackVaryings( GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode )
1007 mImpl->TransformFeedbackVaryings( program, count, varyings, bufferMode );
1010 void GetTransformFeedbackVarying( GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name )
1012 mImpl->GetTransformFeedbackVarying( program, index, bufSize, length, size, type, name );
1015 void VertexAttribIPointer( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer )
1017 mImpl->VertexAttribIPointer( index, size, type, stride, pointer );
1020 void GetVertexAttribIiv( GLuint index, GLenum pname, GLint* params )
1022 mImpl->GetVertexAttribIiv( index, pname, params );
1025 void GetVertexAttribIuiv( GLuint index, GLenum pname, GLuint* params )
1027 mImpl->GetVertexAttribIuiv( index, pname, params );
1030 void VertexAttribI4i( GLuint index, GLint x, GLint y, GLint z, GLint w )
1032 mImpl->VertexAttribI4i( index, x, y, z, w );
1035 void VertexAttribI4ui( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w )
1037 mImpl->VertexAttribI4ui( index, x, y, z, w );
1040 void VertexAttribI4iv( GLuint index, const GLint* v )
1042 mImpl->VertexAttribI4iv( index, v );
1045 void VertexAttribI4uiv( GLuint index, const GLuint* v )
1047 mImpl->VertexAttribI4uiv( index, v );
1050 void GetUniformuiv( GLuint program, GLint location, GLuint* params )
1052 mImpl->GetUniformuiv( program, location, params );
1055 GLint GetFragDataLocation( GLuint program, const GLchar *name )
1057 return mImpl->GetFragDataLocation( program, name );
1060 void Uniform1ui( GLint location, GLuint v0 )
1062 mImpl->Uniform1ui( location, v0 );
1065 void Uniform2ui( GLint location, GLuint v0, GLuint v1 )
1067 mImpl->Uniform2ui( location, v0, v1 );
1070 void Uniform3ui( GLint location, GLuint v0, GLuint v1, GLuint v2 )
1072 mImpl->Uniform3ui( location, v0, v1, v2 );
1075 void Uniform4ui( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 )
1077 mImpl->Uniform4ui( location, v0, v1, v2, v3 );
1080 void Uniform1uiv( GLint location, GLsizei count, const GLuint* value )
1082 mImpl->Uniform1uiv( location, count, value );
1085 void Uniform2uiv( GLint location, GLsizei count, const GLuint* value )
1087 mImpl->Uniform2uiv( location, count, value );
1090 void Uniform3uiv( GLint location, GLsizei count, const GLuint* value )
1092 mImpl->Uniform3uiv( location, count, value );
1095 void Uniform4uiv( GLint location, GLsizei count, const GLuint* value )
1097 mImpl->Uniform4uiv( location, count, value );
1100 void ClearBufferiv( GLenum buffer, GLint drawbuffer, const GLint* value )
1102 mImpl->ClearBufferiv( buffer, drawbuffer, value );
1105 void ClearBufferuiv( GLenum buffer, GLint drawbuffer, const GLuint* value )
1107 mImpl->ClearBufferuiv( buffer, drawbuffer, value );
1110 void ClearBufferfv( GLenum buffer, GLint drawbuffer, const GLfloat* value )
1112 mImpl->ClearBufferfv( buffer, drawbuffer, value );
1115 void ClearBufferfi( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil )
1117 mImpl->ClearBufferfi( buffer, drawbuffer, depth, stencil );
1120 const GLubyte* GetStringi( GLenum name, GLuint index )
1122 return mImpl->GetStringi( name, index );
1125 void CopyBufferSubData( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size )
1127 mImpl->CopyBufferSubData( readTarget, writeTarget, readOffset, writeOffset, size );
1130 void GetUniformIndices( GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices )
1132 mImpl->GetUniformIndices( program, uniformCount, uniformNames, uniformIndices );
1135 void GetActiveUniformsiv( GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params )
1137 mImpl->GetActiveUniformsiv( program, uniformCount, uniformIndices, pname, params );
1140 GLuint GetUniformBlockIndex( GLuint program, const GLchar* uniformBlockName )
1142 return mImpl->GetUniformBlockIndex( program, uniformBlockName );
1145 void GetActiveUniformBlockiv( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params )
1147 mImpl->GetActiveUniformBlockiv( program, uniformBlockIndex, pname, params );
1150 void GetActiveUniformBlockName( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName )
1152 mImpl->GetActiveUniformBlockName( program, uniformBlockIndex, bufSize, length, uniformBlockName );
1155 void UniformBlockBinding( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding )
1157 mImpl->UniformBlockBinding( program, uniformBlockIndex, uniformBlockBinding );
1160 void DrawArraysInstanced( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount )
1162 mImpl->DrawArraysInstanced( mode, first, count, instanceCount );
1165 void DrawElementsInstanced( GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount )
1167 mImpl->DrawElementsInstanced( mode, count, type, indices, instanceCount );
1170 GLsync FenceSync( GLenum condition, GLbitfield flags )
1172 return mImpl->FenceSync( condition, flags );
1175 GLboolean IsSync( GLsync sync )
1177 return mImpl->IsSync( sync );
1180 void DeleteSync( GLsync sync )
1182 mImpl->DeleteSync( sync );
1185 GLenum ClientWaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout )
1187 return mImpl->ClientWaitSync( sync, flags, timeout );
1190 void WaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout )
1192 mImpl->WaitSync( sync, flags, timeout );
1195 void GetInteger64v( GLenum pname, GLint64* params )
1197 mImpl->GetInteger64v( pname, params );
1200 void GetSynciv( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values )
1202 mImpl->GetSynciv( sync, pname, bufSize, length, values );
1205 void GetInteger64i_v( GLenum target, GLuint index, GLint64* data )
1207 mImpl->GetInteger64i_v( target, index, data );
1210 void GetBufferParameteri64v( GLenum target, GLenum pname, GLint64* params )
1212 mImpl->GetBufferParameteri64v( target, pname, params );
1215 void GenSamplers( GLsizei count, GLuint* samplers )
1217 mImpl->GenSamplers( count, samplers );
1220 void DeleteSamplers( GLsizei count, const GLuint* samplers )
1222 mImpl->DeleteSamplers( count, samplers );
1225 GLboolean IsSampler( GLuint sampler )
1227 return mImpl->IsSampler( sampler );
1230 void BindSampler( GLuint unit, GLuint sampler )
1232 mImpl->BindSampler( unit, sampler );
1235 void SamplerParameteri( GLuint sampler, GLenum pname, GLint param )
1237 mImpl->SamplerParameteri( sampler, pname, param );
1240 void SamplerParameteriv( GLuint sampler, GLenum pname, const GLint* param )
1242 mImpl->SamplerParameteriv( sampler, pname, param );
1245 void SamplerParameterf( GLuint sampler, GLenum pname, GLfloat param )
1247 mImpl->SamplerParameterf( sampler, pname, param );
1250 void SamplerParameterfv( GLuint sampler, GLenum pname, const GLfloat* param )
1252 mImpl->SamplerParameterfv( sampler, pname, param );
1255 void GetSamplerParameteriv( GLuint sampler, GLenum pname, GLint* params )
1257 mImpl->GetSamplerParameteriv( sampler, pname, params );
1260 void GetSamplerParameterfv( GLuint sampler, GLenum pname, GLfloat* params )
1262 mImpl->GetSamplerParameterfv( sampler, pname, params );
1265 void VertexAttribDivisor( GLuint index, GLuint divisor )
1267 mImpl->VertexAttribDivisor( index, divisor );
1270 void BindTransformFeedback( GLenum target, GLuint id )
1272 mImpl->BindTransformFeedback( target, id );
1275 void DeleteTransformFeedbacks( GLsizei n, const GLuint* ids )
1277 mImpl->DeleteTransformFeedbacks( n, ids );
1280 void GenTransformFeedbacks( GLsizei n, GLuint* ids )
1282 mImpl->GenTransformFeedbacks( n, ids );
1285 GLboolean IsTransformFeedback( GLuint id )
1287 return mImpl->IsTransformFeedback( id );
1290 void PauseTransformFeedback( void )
1292 mImpl->PauseTransformFeedback();
1295 void ResumeTransformFeedback( void )
1297 mImpl->ResumeTransformFeedback();
1300 void GetProgramBinary( GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary )
1302 mImpl->GetProgramBinary( program, bufSize, length, binaryFormat, binary );
1305 void ProgramBinary( GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length )
1307 mImpl->ProgramBinary( program, binaryFormat, binary, length );
1310 void ProgramParameteri( GLuint program, GLenum pname, GLint value )
1312 mImpl->ProgramParameteri( program, pname, value );
1315 void InvalidateFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments )
1317 mImpl->InvalidateFramebuffer( target, numAttachments, attachments );
1320 void InvalidateSubFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height )
1322 mImpl->InvalidateSubFramebuffer( target, numAttachments, attachments, x, y, width, height );
1325 void TexStorage2D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height )
1327 mImpl->TexStorage2D( target, levels, internalformat, width, height );
1330 void TexStorage3D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth )
1332 mImpl->TexStorage3D( target, levels, internalformat, width, height, depth );
1335 void GetInternalformativ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params )
1337 mImpl->GetInternalformativ( target, internalformat, pname, bufSize, params );
1341 int32_t mGlesVersion;
1342 bool mIsSurfacelessContextSupported;
1343 std::unique_ptr<GlesAbstraction> mImpl;
1346 } // namespace Adaptor
1348 } // namespace Internal
1352 #endif // DALI_INTERNAL_GL_IMPLEMENTATION_H