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
53 mImpl.reset( new Gles3Implementation() );
56 virtual ~GlImplementation() {}
60 /* Do nothing in main implementation */
65 /* Do nothing in main implementation */
68 void SetGlesVersion( const int32_t glesVersion )
70 if( mGlesVersion != glesVersion )
72 mGlesVersion = glesVersion;
73 if( mGlesVersion >= 30 )
75 mImpl.reset( new Gles3Implementation() );
79 mImpl.reset( new Gles2Implementation() );
84 bool IsSurfacelessContextSupported() const
86 return ( mGlesVersion >= 30 );
89 bool TextureRequiresConverting( const GLenum imageGlFormat, const GLenum textureGlFormat, const bool isSubImage ) const
91 bool convert = ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
92 if( mGlesVersion >= 30 )
94 // Don't convert manually from RGB to RGBA if GLES >= 3.0 and a sub-image is uploaded.
95 convert = ( convert && !isSubImage );
102 void ActiveTexture( GLenum texture )
104 glActiveTexture( texture );
107 void AttachShader( GLuint program, GLuint shader )
109 glAttachShader( program, shader );
112 void BindAttribLocation( GLuint program, GLuint index, const char* name )
114 glBindAttribLocation( program, index, name );
117 void BindBuffer( GLenum target, GLuint buffer )
119 glBindBuffer( target, buffer );
122 void BindFramebuffer( GLenum target, GLuint framebuffer )
124 glBindFramebuffer( target, framebuffer );
127 void BindRenderbuffer( GLenum target, GLuint renderbuffer )
129 glBindRenderbuffer( target, renderbuffer );
132 void BindTexture( GLenum target, GLuint texture )
134 glBindTexture( target, texture );
137 void BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
139 glBlendColor( red, green, blue, alpha );
142 void BlendEquation( GLenum mode )
144 glBlendEquation( mode );
147 void BlendEquationSeparate( GLenum modeRGB, GLenum modeAlpha )
149 glBlendEquationSeparate( modeRGB, modeAlpha );
152 void BlendFunc( GLenum sfactor, GLenum dfactor )
154 glBlendFunc( sfactor, dfactor );
157 void BlendFuncSeparate( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
159 glBlendFuncSeparate( srcRGB, dstRGB, srcAlpha, dstAlpha );
162 void BufferData( GLenum target, GLsizeiptr size, const void* data, GLenum usage )
164 glBufferData( target, size, data, usage );
167 void BufferSubData( GLenum target, GLintptr offset, GLsizeiptr size, const void* data )
169 glBufferSubData( target, offset, size, data );
172 GLenum CheckFramebufferStatus( GLenum target )
174 return glCheckFramebufferStatus( target );
177 void Clear( GLbitfield mask )
182 void ClearColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
184 glClearColor( red, green, blue, alpha );
187 void ClearDepthf( GLclampf depth )
189 glClearDepthf( depth );
192 void ClearStencil( GLint s )
197 void ColorMask( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha )
199 glColorMask( red, green, blue, alpha );
202 void CompileShader( GLuint shader )
204 glCompileShader( shader );
207 void CompressedTexImage2D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data )
209 glCompressedTexImage2D( target, level, internalformat, width, height, border, imageSize, data );
212 void CompressedTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data )
214 glCompressedTexSubImage2D( target, level, xoffset, yoffset, width, height, format, imageSize, data );
217 void CopyTexImage2D( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border )
219 glCopyTexImage2D( target, level, internalformat, x, y, width, height, border );
222 void CopyTexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height )
224 glCopyTexSubImage2D( target, level, xoffset, yoffset, x, y, width, height );
227 GLuint CreateProgram( void )
229 return glCreateProgram();
232 GLuint CreateShader( GLenum type )
234 return glCreateShader( type );
237 void CullFace( GLenum mode )
242 void DeleteBuffers( GLsizei n, const GLuint* buffers )
244 glDeleteBuffers( n, buffers );
247 void DeleteFramebuffers( GLsizei n, const GLuint* framebuffers )
249 glDeleteFramebuffers( n, framebuffers );
252 void DeleteProgram( GLuint program )
254 glDeleteProgram( program );
257 void DeleteRenderbuffers( GLsizei n, const GLuint* renderbuffers )
259 glDeleteRenderbuffers( n, renderbuffers );
262 void DeleteShader( GLuint shader )
264 glDeleteShader( shader );
267 void DeleteTextures( GLsizei n, const GLuint* textures )
269 glDeleteTextures( n, textures );
272 void DepthFunc( GLenum func )
277 void DepthMask( GLboolean flag )
282 void DepthRangef( GLclampf zNear, GLclampf zFar )
284 glDepthRangef( zNear, zFar );
287 void DetachShader( GLuint program, GLuint shader )
289 glDetachShader( program, shader );
292 void Disable( GLenum cap )
297 void DisableVertexAttribArray( GLuint index )
299 glDisableVertexAttribArray( index );
302 void DrawArrays( GLenum mode, GLint first, GLsizei count )
304 glDrawArrays( mode, first, count );
307 void DrawElements( GLenum mode, GLsizei count, GLenum type, const void* indices )
309 glDrawElements( mode, count, type, indices );
312 void Enable( GLenum cap )
317 void EnableVertexAttribArray( GLuint index )
319 glEnableVertexAttribArray( index );
332 void FramebufferRenderbuffer( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer )
334 glFramebufferRenderbuffer( target, attachment, renderbuffertarget, renderbuffer );
337 void FramebufferTexture2D( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level )
339 glFramebufferTexture2D( target, attachment, textarget, texture, level );
342 void FrontFace( GLenum mode )
347 void GenBuffers( GLsizei n, GLuint* buffers )
349 glGenBuffers( n, buffers );
352 void GenerateMipmap( GLenum target )
354 glGenerateMipmap( target );
357 void GenFramebuffers( GLsizei n, GLuint* framebuffers )
359 glGenFramebuffers( n, framebuffers );
362 void GenRenderbuffers( GLsizei n, GLuint* renderbuffers )
364 glGenRenderbuffers( n, renderbuffers );
367 void GenTextures( GLsizei n, GLuint* textures )
369 glGenTextures( n, textures );
372 void GetActiveAttrib( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name )
374 glGetActiveAttrib( program, index, bufsize, length, size, type, name );
377 void GetActiveUniform( GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name )
379 glGetActiveUniform( program, index, bufsize, length, size, type, name );
382 void GetAttachedShaders( GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders )
384 glGetAttachedShaders( program, maxcount, count, shaders );
387 int GetAttribLocation( GLuint program, const char* name )
389 return glGetAttribLocation( program, name );
392 void GetBooleanv( GLenum pname, GLboolean* params )
394 glGetBooleanv( pname, params );
397 void GetBufferParameteriv( GLenum target, GLenum pname, GLint* params )
399 glGetBufferParameteriv( target, pname, params );
402 GLenum GetError( void )
407 void GetFloatv( GLenum pname, GLfloat* params )
409 glGetFloatv( pname, params );
412 void GetFramebufferAttachmentParameteriv( GLenum target, GLenum attachment, GLenum pname, GLint* params )
414 glGetFramebufferAttachmentParameteriv( target, attachment, pname, params );
417 void GetIntegerv( GLenum pname, GLint* params )
419 glGetIntegerv( pname, params );
422 void GetProgramiv( GLuint program, GLenum pname, GLint* params )
424 glGetProgramiv( program, pname, params );
427 void GetProgramInfoLog( GLuint program, GLsizei bufsize, GLsizei* length, char* infolog )
429 glGetProgramInfoLog( program, bufsize, length, infolog );
432 void GetRenderbufferParameteriv( GLenum target, GLenum pname, GLint* params )
434 glGetRenderbufferParameteriv( target, pname, params );
437 void GetShaderiv( GLuint shader, GLenum pname, GLint* params )
439 glGetShaderiv( shader, pname, params );
442 void GetShaderInfoLog( GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog )
444 glGetShaderInfoLog( shader, bufsize, length, infolog );
447 void GetShaderPrecisionFormat( GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision )
449 glGetShaderPrecisionFormat( shadertype, precisiontype, range, precision );
452 void GetShaderSource( GLuint shader, GLsizei bufsize, GLsizei* length, char* source )
454 glGetShaderSource( shader, bufsize, length, source );
457 const GLubyte* GetString( GLenum name )
459 return glGetString( name );
462 void GetTexParameterfv( GLenum target, GLenum pname, GLfloat* params )
464 glGetTexParameterfv( target, pname, params );
467 void GetTexParameteriv( GLenum target, GLenum pname, GLint* params )
469 glGetTexParameteriv( target, pname, params );
472 void GetUniformfv( GLuint program, GLint location, GLfloat* params )
474 glGetUniformfv( program, location, params );
477 void GetUniformiv( GLuint program, GLint location, GLint* params )
479 glGetUniformiv( program, location, params );
482 int GetUniformLocation( GLuint program, const char* name )
484 return glGetUniformLocation( program, name );
487 void GetVertexAttribfv( GLuint index, GLenum pname, GLfloat* params )
489 glGetVertexAttribfv( index, pname, params );
492 void GetVertexAttribiv( GLuint index, GLenum pname, GLint* params )
494 glGetVertexAttribiv( index, pname, params );
497 void GetVertexAttribPointerv( GLuint index, GLenum pname, void** pointer )
499 glGetVertexAttribPointerv( index, pname, pointer );
502 void Hint( GLenum target, GLenum mode )
504 glHint( target, mode );
507 GLboolean IsBuffer( GLuint buffer )
509 return glIsBuffer( buffer );
512 GLboolean IsEnabled( GLenum cap )
514 return glIsEnabled( cap );
517 GLboolean IsFramebuffer( GLuint framebuffer )
519 return glIsFramebuffer( framebuffer );
522 GLboolean IsProgram( GLuint program )
524 return glIsProgram( program );
527 GLboolean IsRenderbuffer( GLuint renderbuffer )
529 return glIsRenderbuffer( renderbuffer );
532 GLboolean IsShader( GLuint shader )
534 return glIsShader( shader );
537 GLboolean IsTexture( GLuint texture )
539 return glIsTexture( texture );
542 void LineWidth( GLfloat width )
544 glLineWidth( width );
547 void LinkProgram( GLuint program )
549 glLinkProgram( program );
552 void PixelStorei( GLenum pname, GLint param )
554 glPixelStorei( pname, param );
557 void PolygonOffset( GLfloat factor, GLfloat units )
559 glPolygonOffset( factor, units );
562 void ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels )
564 glReadPixels( x, y, width, height, format, type, pixels );
567 void ReleaseShaderCompiler( void )
569 glReleaseShaderCompiler();
572 void RenderbufferStorage( GLenum target, GLenum internalformat, GLsizei width, GLsizei height )
574 glRenderbufferStorage( target, internalformat, width, height );
577 void SampleCoverage( GLclampf value, GLboolean invert )
579 glSampleCoverage( value, invert );
582 void Scissor( GLint x, GLint y, GLsizei width, GLsizei height )
584 glScissor( x, y, width, height );
587 void ShaderBinary( GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length )
589 glShaderBinary( n, shaders, binaryformat, binary, length );
592 void ShaderSource( GLuint shader, GLsizei count, const char** string, const GLint* length )
594 glShaderSource( shader, count, string, length );
597 void StencilFunc( GLenum func, GLint ref, GLuint mask )
599 glStencilFunc( func, ref, mask );
602 void StencilFuncSeparate( GLenum face, GLenum func, GLint ref, GLuint mask )
604 glStencilFuncSeparate( face, func, ref, mask );
607 void StencilMask( GLuint mask )
609 glStencilMask( mask );
612 void StencilMaskSeparate( GLenum face, GLuint mask )
614 glStencilMaskSeparate( face, mask );
617 void StencilOp( GLenum fail, GLenum zfail, GLenum zpass )
619 glStencilOp( fail, zfail, zpass );
622 void StencilOpSeparate( GLenum face, GLenum fail, GLenum zfail, GLenum zpass )
624 glStencilOpSeparate( face, fail, zfail, zpass );
627 void TexImage2D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels )
629 glTexImage2D( target, level, internalformat, width, height, border, format, type, pixels );
632 void TexParameterf( GLenum target, GLenum pname, GLfloat param )
634 glTexParameterf( target, pname, param );
637 void TexParameterfv( GLenum target, GLenum pname, const GLfloat* params )
639 glTexParameterfv( target, pname, params );
642 void TexParameteri( GLenum target, GLenum pname, GLint param )
644 glTexParameteri( target, pname, param );
647 void TexParameteriv( GLenum target, GLenum pname, const GLint* params )
649 glTexParameteriv( target, pname, params );
652 void TexSubImage2D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels )
654 glTexSubImage2D( target, level, xoffset, yoffset, width, height, format, type, pixels );
657 void Uniform1f( GLint location, GLfloat x )
659 glUniform1f( location, x );
662 void Uniform1fv( GLint location, GLsizei count, const GLfloat* v )
664 glUniform1fv( location, count, v );
667 void Uniform1i( GLint location, GLint x )
669 glUniform1i( location, x );
672 void Uniform1iv( GLint location, GLsizei count, const GLint* v )
674 glUniform1iv( location, count, v );
677 void Uniform2f( GLint location, GLfloat x, GLfloat y )
679 glUniform2f( location, x, y );
682 void Uniform2fv( GLint location, GLsizei count, const GLfloat* v )
684 glUniform2fv( location, count, v );
687 void Uniform2i( GLint location, GLint x, GLint y )
689 glUniform2i( location, x, y );
692 void Uniform2iv( GLint location, GLsizei count, const GLint* v )
694 glUniform2iv( location, count, v );
697 void Uniform3f( GLint location, GLfloat x, GLfloat y, GLfloat z )
699 glUniform3f( location, x, y, z );
702 void Uniform3fv( GLint location, GLsizei count, const GLfloat* v )
704 glUniform3fv( location, count, v );
707 void Uniform3i( GLint location, GLint x, GLint y, GLint z )
709 glUniform3i( location, x, y, z );
712 void Uniform3iv( GLint location, GLsizei count, const GLint* v )
714 glUniform3iv( location, count, v );
717 void Uniform4f( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
719 glUniform4f( location, x, y, z, w );
722 void Uniform4fv( GLint location, GLsizei count, const GLfloat* v )
724 glUniform4fv( location, count, v );
727 void Uniform4i( GLint location, GLint x, GLint y, GLint z, GLint w )
729 glUniform4i( location, x, y, z, w );
732 void Uniform4iv( GLint location, GLsizei count, const GLint* v )
734 glUniform4iv( location, count, v );
737 void UniformMatrix2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
739 glUniformMatrix2fv( location, count, transpose, value );
742 void UniformMatrix3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
744 glUniformMatrix3fv( location, count, transpose, value );
747 void UniformMatrix4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
749 glUniformMatrix4fv( location, count, transpose, value );
752 void UseProgram( GLuint program )
754 glUseProgram( program );
757 void ValidateProgram( GLuint program )
759 glValidateProgram( program );
762 void VertexAttrib1f( GLuint indx, GLfloat x )
764 glVertexAttrib1f( indx, x );
767 void VertexAttrib1fv( GLuint indx, const GLfloat* values )
769 glVertexAttrib1fv( indx, values );
772 void VertexAttrib2f( GLuint indx, GLfloat x, GLfloat y )
774 glVertexAttrib2f( indx, x, y );
777 void VertexAttrib2fv( GLuint indx, const GLfloat* values )
779 glVertexAttrib2fv( indx, values );
782 void VertexAttrib3f( GLuint indx, GLfloat x, GLfloat y, GLfloat z )
784 glVertexAttrib3f( indx, x, y, z );
787 void VertexAttrib3fv( GLuint indx, const GLfloat* values )
789 glVertexAttrib3fv( indx, values );
792 void VertexAttrib4f( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w )
794 glVertexAttrib4f( indx, x, y, z, w );
797 void VertexAttrib4fv( GLuint indx, const GLfloat* values )
799 glVertexAttrib4fv( indx, values );
802 void VertexAttribPointer( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr )
804 glVertexAttribPointer( indx, size, type, normalized, stride, ptr );
807 void Viewport( GLint x, GLint y, GLsizei width, GLsizei height )
809 glViewport( x, y, width, height );
814 void ReadBuffer( GLenum mode )
816 mImpl->ReadBuffer( mode );
819 void DrawRangeElements( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices )
821 mImpl->DrawRangeElements( mode, start, end, count, type, indices );
824 void TexImage3D( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels )
826 mImpl->TexImage3D( target, level, internalformat, width, height, depth, border, format, type, pixels );
829 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 )
831 mImpl->TexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, pixels );
834 void CopyTexSubImage3D( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height )
836 mImpl->CopyTexSubImage3D( target, level, xoffset, yoffset, zoffset, x, y, width, height );
839 void CompressedTexImage3D( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data )
841 mImpl->CompressedTexImage3D( target, level, internalformat, width, height, depth, border, imageSize, data );
844 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 )
846 mImpl->CompressedTexSubImage3D( target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data );
849 void GenQueries( GLsizei n, GLuint* ids )
851 mImpl->GenQueries( n, ids );
854 void DeleteQueries( GLsizei n, const GLuint* ids )
856 mImpl->DeleteQueries( n, ids );
859 GLboolean IsQuery( GLuint id )
861 return mImpl->IsQuery( id );
864 void BeginQuery( GLenum target, GLuint id )
866 mImpl->BeginQuery( target, id );
869 void EndQuery( GLenum target )
871 mImpl->EndQuery( target );
874 void GetQueryiv( GLenum target, GLenum pname, GLint* params )
876 mImpl->GetQueryiv( target, pname, params );
879 void GetQueryObjectuiv( GLuint id, GLenum pname, GLuint* params )
881 mImpl->GetQueryObjectuiv( id, pname, params );
884 GLboolean UnmapBuffer( GLenum target )
886 return mImpl->UnmapBuffer( target );
889 void GetBufferPointerv( GLenum target, GLenum pname, GLvoid** params )
891 mImpl->GetBufferPointerv( target, pname, params );
894 void DrawBuffers( GLsizei n, const GLenum* bufs )
896 mImpl->DrawBuffers( n, bufs );
899 void UniformMatrix2x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
901 mImpl->UniformMatrix2x3fv( location, count, transpose, value );
904 void UniformMatrix3x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
906 mImpl->UniformMatrix3x2fv( location, count, transpose, value );
909 void UniformMatrix2x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
911 mImpl->UniformMatrix2x4fv( location, count, transpose, value );
914 void UniformMatrix4x2fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
916 mImpl->UniformMatrix4x2fv( location, count, transpose, value );
919 void UniformMatrix3x4fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
921 mImpl->UniformMatrix3x4fv( location, count, transpose, value );
924 void UniformMatrix4x3fv( GLint location, GLsizei count, GLboolean transpose, const GLfloat* value )
926 mImpl->UniformMatrix4x3fv( location, count, transpose, value );
929 void BlitFramebuffer( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter )
931 mImpl->BlitFramebuffer( srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter );
934 void RenderbufferStorageMultisample( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height )
936 mImpl->RenderbufferStorageMultisample( target, samples, internalformat, width, height );
939 void FramebufferTextureLayer( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer )
941 mImpl->FramebufferTextureLayer( target, attachment, texture, level, layer );
944 GLvoid* MapBufferRange( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access )
946 return mImpl->MapBufferRange( target, offset, length, access );
949 void FlushMappedBufferRange( GLenum target, GLintptr offset, GLsizeiptr length )
951 mImpl->FlushMappedBufferRange( target, offset, length );
954 void BindVertexArray( GLuint array )
956 mImpl->BindVertexArray( array );
959 void DeleteVertexArrays( GLsizei n, const GLuint* arrays )
961 mImpl->DeleteVertexArrays( n, arrays );
964 void GenVertexArrays( GLsizei n, GLuint* arrays )
966 mImpl->GenVertexArrays( n, arrays );
969 GLboolean IsVertexArray( GLuint array )
971 return mImpl->IsVertexArray( array );
974 void GetIntegeri_v( GLenum target, GLuint index, GLint* data )
976 mImpl->GetIntegeri_v( target, index, data );
979 void BeginTransformFeedback( GLenum primitiveMode )
981 mImpl->BeginTransformFeedback( primitiveMode );
984 void EndTransformFeedback( void )
986 mImpl->EndTransformFeedback();
989 void BindBufferRange( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size )
991 mImpl->BindBufferRange( target, index, buffer, offset, size );
994 void BindBufferBase( GLenum target, GLuint index, GLuint buffer )
996 mImpl->BindBufferBase( target, index, buffer );
999 void TransformFeedbackVaryings( GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode )
1001 mImpl->TransformFeedbackVaryings( program, count, varyings, bufferMode );
1004 void GetTransformFeedbackVarying( GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name )
1006 mImpl->GetTransformFeedbackVarying( program, index, bufSize, length, size, type, name );
1009 void VertexAttribIPointer( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer )
1011 mImpl->VertexAttribIPointer( index, size, type, stride, pointer );
1014 void GetVertexAttribIiv( GLuint index, GLenum pname, GLint* params )
1016 mImpl->GetVertexAttribIiv( index, pname, params );
1019 void GetVertexAttribIuiv( GLuint index, GLenum pname, GLuint* params )
1021 mImpl->GetVertexAttribIuiv( index, pname, params );
1024 void VertexAttribI4i( GLuint index, GLint x, GLint y, GLint z, GLint w )
1026 mImpl->VertexAttribI4i( index, x, y, z, w );
1029 void VertexAttribI4ui( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w )
1031 mImpl->VertexAttribI4ui( index, x, y, z, w );
1034 void VertexAttribI4iv( GLuint index, const GLint* v )
1036 mImpl->VertexAttribI4iv( index, v );
1039 void VertexAttribI4uiv( GLuint index, const GLuint* v )
1041 mImpl->VertexAttribI4uiv( index, v );
1044 void GetUniformuiv( GLuint program, GLint location, GLuint* params )
1046 mImpl->GetUniformuiv( program, location, params );
1049 GLint GetFragDataLocation( GLuint program, const GLchar *name )
1051 return mImpl->GetFragDataLocation( program, name );
1054 void Uniform1ui( GLint location, GLuint v0 )
1056 mImpl->Uniform1ui( location, v0 );
1059 void Uniform2ui( GLint location, GLuint v0, GLuint v1 )
1061 mImpl->Uniform2ui( location, v0, v1 );
1064 void Uniform3ui( GLint location, GLuint v0, GLuint v1, GLuint v2 )
1066 mImpl->Uniform3ui( location, v0, v1, v2 );
1069 void Uniform4ui( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 )
1071 mImpl->Uniform4ui( location, v0, v1, v2, v3 );
1074 void Uniform1uiv( GLint location, GLsizei count, const GLuint* value )
1076 mImpl->Uniform1uiv( location, count, value );
1079 void Uniform2uiv( GLint location, GLsizei count, const GLuint* value )
1081 mImpl->Uniform2uiv( location, count, value );
1084 void Uniform3uiv( GLint location, GLsizei count, const GLuint* value )
1086 mImpl->Uniform3uiv( location, count, value );
1089 void Uniform4uiv( GLint location, GLsizei count, const GLuint* value )
1091 mImpl->Uniform4uiv( location, count, value );
1094 void ClearBufferiv( GLenum buffer, GLint drawbuffer, const GLint* value )
1096 mImpl->ClearBufferiv( buffer, drawbuffer, value );
1099 void ClearBufferuiv( GLenum buffer, GLint drawbuffer, const GLuint* value )
1101 mImpl->ClearBufferuiv( buffer, drawbuffer, value );
1104 void ClearBufferfv( GLenum buffer, GLint drawbuffer, const GLfloat* value )
1106 mImpl->ClearBufferfv( buffer, drawbuffer, value );
1109 void ClearBufferfi( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil )
1111 mImpl->ClearBufferfi( buffer, drawbuffer, depth, stencil );
1114 const GLubyte* GetStringi( GLenum name, GLuint index )
1116 return mImpl->GetStringi( name, index );
1119 void CopyBufferSubData( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size )
1121 mImpl->CopyBufferSubData( readTarget, writeTarget, readOffset, writeOffset, size );
1124 void GetUniformIndices( GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices )
1126 mImpl->GetUniformIndices( program, uniformCount, uniformNames, uniformIndices );
1129 void GetActiveUniformsiv( GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params )
1131 mImpl->GetActiveUniformsiv( program, uniformCount, uniformIndices, pname, params );
1134 GLuint GetUniformBlockIndex( GLuint program, const GLchar* uniformBlockName )
1136 return mImpl->GetUniformBlockIndex( program, uniformBlockName );
1139 void GetActiveUniformBlockiv( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params )
1141 mImpl->GetActiveUniformBlockiv( program, uniformBlockIndex, pname, params );
1144 void GetActiveUniformBlockName( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName )
1146 mImpl->GetActiveUniformBlockName( program, uniformBlockIndex, bufSize, length, uniformBlockName );
1149 void UniformBlockBinding( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding )
1151 mImpl->UniformBlockBinding( program, uniformBlockIndex, uniformBlockBinding );
1154 void DrawArraysInstanced( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount )
1156 mImpl->DrawArraysInstanced( mode, first, count, instanceCount );
1159 void DrawElementsInstanced( GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount )
1161 mImpl->DrawElementsInstanced( mode, count, type, indices, instanceCount );
1164 GLsync FenceSync( GLenum condition, GLbitfield flags )
1166 return mImpl->FenceSync( condition, flags );
1169 GLboolean IsSync( GLsync sync )
1171 return mImpl->IsSync( sync );
1174 void DeleteSync( GLsync sync )
1176 mImpl->DeleteSync( sync );
1179 GLenum ClientWaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout )
1181 return mImpl->ClientWaitSync( sync, flags, timeout );
1184 void WaitSync( GLsync sync, GLbitfield flags, GLuint64 timeout )
1186 mImpl->WaitSync( sync, flags, timeout );
1189 void GetInteger64v( GLenum pname, GLint64* params )
1191 mImpl->GetInteger64v( pname, params );
1194 void GetSynciv( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values )
1196 mImpl->GetSynciv( sync, pname, bufSize, length, values );
1199 void GetInteger64i_v( GLenum target, GLuint index, GLint64* data )
1201 mImpl->GetInteger64i_v( target, index, data );
1204 void GetBufferParameteri64v( GLenum target, GLenum pname, GLint64* params )
1206 mImpl->GetBufferParameteri64v( target, pname, params );
1209 void GenSamplers( GLsizei count, GLuint* samplers )
1211 mImpl->GenSamplers( count, samplers );
1214 void DeleteSamplers( GLsizei count, const GLuint* samplers )
1216 mImpl->DeleteSamplers( count, samplers );
1219 GLboolean IsSampler( GLuint sampler )
1221 return mImpl->IsSampler( sampler );
1224 void BindSampler( GLuint unit, GLuint sampler )
1226 mImpl->BindSampler( unit, sampler );
1229 void SamplerParameteri( GLuint sampler, GLenum pname, GLint param )
1231 mImpl->SamplerParameteri( sampler, pname, param );
1234 void SamplerParameteriv( GLuint sampler, GLenum pname, const GLint* param )
1236 mImpl->SamplerParameteriv( sampler, pname, param );
1239 void SamplerParameterf( GLuint sampler, GLenum pname, GLfloat param )
1241 mImpl->SamplerParameterf( sampler, pname, param );
1244 void SamplerParameterfv( GLuint sampler, GLenum pname, const GLfloat* param )
1246 mImpl->SamplerParameterfv( sampler, pname, param );
1249 void GetSamplerParameteriv( GLuint sampler, GLenum pname, GLint* params )
1251 mImpl->GetSamplerParameteriv( sampler, pname, params );
1254 void GetSamplerParameterfv( GLuint sampler, GLenum pname, GLfloat* params )
1256 mImpl->GetSamplerParameterfv( sampler, pname, params );
1259 void VertexAttribDivisor( GLuint index, GLuint divisor )
1261 mImpl->VertexAttribDivisor( index, divisor );
1264 void BindTransformFeedback( GLenum target, GLuint id )
1266 mImpl->BindTransformFeedback( target, id );
1269 void DeleteTransformFeedbacks( GLsizei n, const GLuint* ids )
1271 mImpl->DeleteTransformFeedbacks( n, ids );
1274 void GenTransformFeedbacks( GLsizei n, GLuint* ids )
1276 mImpl->GenTransformFeedbacks( n, ids );
1279 GLboolean IsTransformFeedback( GLuint id )
1281 return mImpl->IsTransformFeedback( id );
1284 void PauseTransformFeedback( void )
1286 mImpl->PauseTransformFeedback();
1289 void ResumeTransformFeedback( void )
1291 mImpl->ResumeTransformFeedback();
1294 void GetProgramBinary( GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary )
1296 mImpl->GetProgramBinary( program, bufSize, length, binaryFormat, binary );
1299 void ProgramBinary( GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length )
1301 mImpl->ProgramBinary( program, binaryFormat, binary, length );
1304 void ProgramParameteri( GLuint program, GLenum pname, GLint value )
1306 mImpl->ProgramParameteri( program, pname, value );
1309 void InvalidateFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments )
1311 mImpl->InvalidateFramebuffer( target, numAttachments, attachments );
1314 void InvalidateSubFramebuffer( GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height )
1316 mImpl->InvalidateSubFramebuffer( target, numAttachments, attachments, x, y, width, height );
1319 void TexStorage2D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height )
1321 mImpl->TexStorage2D( target, levels, internalformat, width, height );
1324 void TexStorage3D( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth )
1326 mImpl->TexStorage3D( target, levels, internalformat, width, height, depth );
1329 void GetInternalformativ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params )
1331 mImpl->GetInternalformativ( target, internalformat, pname, bufSize, params );
1335 int32_t mGlesVersion;
1336 std::unique_ptr<GlesAbstraction> mImpl;
1339 } // namespace Adaptor
1341 } // namespace Internal
1345 #endif // DALI_INTERNAL_GL_IMPLEMENTATION_H