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.
22 #ifndef DALI_GLES_VERSION
23 #error "OpenGL ES version not specified"
26 #if DALI_GLES_VERSION >= 31
27 #include <GLES3/gl31.h>
28 #elif DALI_GLES_VERSION >= 30
29 #include <GLES3/gl3.h>
32 #include <GLES2/gl2.h>
35 #include <dali/integration-api/gl-abstraction.h>
38 #include <dali/internal/graphics/gles/gl-extensions.h>
50 * GlImplementation is a concrete implementation for GlAbstraction.
51 * The class provides an OpenGL-ES 2.0 implementation.
52 * The class is provided when creating the Integration::Core object.
54 class GlImplementation: public Dali::Integration::GlAbstraction
58 virtual ~GlImplementation() {}
62 /* Do nothing in main implementation */
67 /* Do nothing in main implementation */
70 void ConvertTexture( uint8_t* buffer, GLenum& imageGlFormat, const uint32_t dataSize, const GLenum textureGlFormat, const bool isSubImage )
72 bool convert = ( ( imageGlFormat == GL_RGB ) && ( textureGlFormat == GL_RGBA ) );
73 #if DALI_GLES_VERSION >= 30
74 // Don't convert manually from RGB to RGBA if GLES >= 3.0 and a sub-image is uploaded.
75 convert = convert && !isSubImage;
76 #endif // DALI_GLES_VERSION >= 30
80 //This buffer is only used if manually converting from RGB to RGBA
81 uint8_t* tempBuffer(0);
83 tempBuffer = new uint8_t[dataSize*4u];
84 for( uint32_t i = 0u; i < dataSize; ++i )
86 tempBuffer[i*4u] = buffer[i*3u];
87 tempBuffer[i*4u+1] = buffer[i*3u+1];
88 tempBuffer[i*4u+2] = buffer[i*3u+2];
89 tempBuffer[i*4u+3] = 0xFF;
92 imageGlFormat = textureGlFormat; // Set the glFormat to GL_RGBA
94 //Destroy temp buffer used for conversion RGB->RGBA
101 void ActiveTexture (GLenum texture)
103 glActiveTexture(texture);
106 void AttachShader (GLuint program, GLuint shader)
108 glAttachShader(program,shader);
111 void BindAttribLocation (GLuint program, GLuint index, const char* name)
113 glBindAttribLocation(program,index,name);
116 void BindBuffer (GLenum target, GLuint buffer)
118 glBindBuffer(target,buffer);
121 void BindFramebuffer (GLenum target, GLuint framebuffer)
123 glBindFramebuffer(target,framebuffer);
126 void BindRenderbuffer (GLenum target, GLuint renderbuffer)
128 glBindRenderbuffer(target,renderbuffer);
131 void BindTexture (GLenum target, GLuint texture)
133 glBindTexture(target,texture);
136 void BlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
138 glBlendColor(red,green,blue,alpha);
141 void BlendEquation ( GLenum mode )
143 glBlendEquation(mode);
146 void BlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha)
148 glBlendEquationSeparate(modeRGB,modeAlpha);
151 void BlendFunc (GLenum sfactor, GLenum dfactor)
153 glBlendFunc(sfactor,dfactor);
156 void BlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
158 glBlendFuncSeparate(srcRGB,dstRGB,srcAlpha,dstAlpha);
161 void BufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage)
163 glBufferData(target,size,data,usage);
166 void BufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
168 glBufferSubData(target,offset,size,data);
171 GLenum CheckFramebufferStatus (GLenum target)
173 return glCheckFramebufferStatus(target);
176 void Clear (GLbitfield mask)
181 void ClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
183 glClearColor(red,green,blue,alpha);
186 void ClearDepthf (GLclampf depth)
188 glClearDepthf(depth);
191 void ClearStencil (GLint s)
196 void ColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
198 glColorMask(red,green,blue,alpha);
201 void CompileShader (GLuint shader)
203 glCompileShader(shader);
206 void CompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
208 glCompressedTexImage2D(target,level,internalformat,width,height,border,imageSize,data);
211 void CompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
213 glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imageSize,data);
216 void CopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
218 glCopyTexImage2D(target,level,internalformat,x,y,width,height,border);
221 void CopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
223 glCopyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height);
226 GLuint CreateProgram (void)
228 return glCreateProgram();
231 GLuint CreateShader (GLenum type)
233 return glCreateShader(type);
236 void CullFace (GLenum mode)
241 void DeleteBuffers (GLsizei n, const GLuint* buffers)
243 glDeleteBuffers(n,buffers);
246 void DeleteFramebuffers (GLsizei n, const GLuint* framebuffers)
248 glDeleteFramebuffers(n,framebuffers);
251 void DeleteProgram (GLuint program)
253 glDeleteProgram(program);
256 void DeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers)
258 glDeleteRenderbuffers(n,renderbuffers);
261 void DeleteShader (GLuint shader)
263 glDeleteShader(shader);
266 void DeleteTextures (GLsizei n, const GLuint* textures)
268 glDeleteTextures(n,textures);
271 void DepthFunc (GLenum func)
276 void DepthMask (GLboolean flag)
281 void DepthRangef (GLclampf zNear, GLclampf zFar)
283 glDepthRangef(zNear,zFar);
286 void DetachShader (GLuint program, GLuint shader)
288 glDetachShader(program,shader);
291 void Disable (GLenum cap)
296 void DisableVertexAttribArray (GLuint index)
298 glDisableVertexAttribArray(index);
301 void DrawArrays (GLenum mode, GLint first, GLsizei count)
303 glDrawArrays(mode,first,count);
306 void DrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices)
308 glDrawElements(mode,count,type,indices);
311 void Enable (GLenum cap)
316 void EnableVertexAttribArray (GLuint index)
318 glEnableVertexAttribArray(index);
331 void FramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
333 glFramebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer);
336 void FramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
338 glFramebufferTexture2D(target,attachment,textarget,texture,level);
341 void FrontFace (GLenum mode)
346 void GenBuffers (GLsizei n, GLuint* buffers)
348 glGenBuffers(n,buffers);
351 void GenerateMipmap (GLenum target)
353 glGenerateMipmap(target);
356 void GenFramebuffers (GLsizei n, GLuint* framebuffers)
358 glGenFramebuffers(n,framebuffers);
361 void GenRenderbuffers (GLsizei n, GLuint* renderbuffers)
363 glGenRenderbuffers(n,renderbuffers);
366 void GenTextures (GLsizei n, GLuint* textures)
368 glGenTextures(n,textures);
371 void GetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
373 glGetActiveAttrib(program,index,bufsize,length,size,type,name);
376 void GetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
378 glGetActiveUniform(program,index,bufsize,length,size,type,name);
381 void GetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
383 glGetAttachedShaders(program,maxcount,count,shaders);
386 int GetAttribLocation (GLuint program, const char* name)
388 return glGetAttribLocation(program,name);
391 void GetBooleanv (GLenum pname, GLboolean* params)
393 glGetBooleanv(pname,params);
396 void GetBufferParameteriv (GLenum target, GLenum pname, GLint* params)
398 glGetBufferParameteriv(target,pname,params);
401 GLenum GetError (void)
406 void GetFloatv (GLenum pname, GLfloat* params)
408 glGetFloatv(pname,params);
411 void GetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params)
413 glGetFramebufferAttachmentParameteriv(target,attachment,pname,params);
416 void GetIntegerv (GLenum pname, GLint* params)
418 glGetIntegerv(pname,params);
421 void GetProgramiv (GLuint program, GLenum pname, GLint* params)
423 glGetProgramiv(program,pname,params);
426 void GetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
428 glGetProgramInfoLog(program,bufsize,length,infolog);
431 void GetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params)
433 glGetRenderbufferParameteriv(target,pname,params);
436 void GetShaderiv (GLuint shader, GLenum pname, GLint* params)
438 glGetShaderiv(shader,pname,params);
441 void GetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
443 glGetShaderInfoLog(shader,bufsize,length,infolog);
446 void GetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
448 glGetShaderPrecisionFormat(shadertype,precisiontype,range,precision);
451 void GetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
453 glGetShaderSource(shader,bufsize,length,source);
456 const GLubyte* GetString (GLenum name)
458 return glGetString(name);
461 void GetTexParameterfv (GLenum target, GLenum pname, GLfloat* params)
463 glGetTexParameterfv(target,pname,params);
466 void GetTexParameteriv (GLenum target, GLenum pname, GLint* params)
468 glGetTexParameteriv(target,pname,params);
471 void GetUniformfv (GLuint program, GLint location, GLfloat* params)
473 glGetUniformfv(program,location,params);
476 void GetUniformiv (GLuint program, GLint location, GLint* params)
478 glGetUniformiv(program,location,params);
481 int GetUniformLocation (GLuint program, const char* name)
483 return glGetUniformLocation(program,name);
486 void GetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params)
488 glGetVertexAttribfv(index,pname,params);
491 void GetVertexAttribiv (GLuint index, GLenum pname, GLint* params)
493 glGetVertexAttribiv(index,pname,params);
496 void GetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer)
498 glGetVertexAttribPointerv(index,pname,pointer);
501 void Hint (GLenum target, GLenum mode)
506 GLboolean IsBuffer (GLuint buffer)
508 return glIsBuffer(buffer);
511 GLboolean IsEnabled (GLenum cap)
513 return glIsEnabled(cap);
516 GLboolean IsFramebuffer (GLuint framebuffer)
518 return glIsFramebuffer(framebuffer);
521 GLboolean IsProgram (GLuint program)
523 return glIsProgram(program);
526 GLboolean IsRenderbuffer (GLuint renderbuffer)
528 return glIsRenderbuffer(renderbuffer);
531 GLboolean IsShader (GLuint shader)
533 return glIsShader(shader);
536 GLboolean IsTexture (GLuint texture)
538 return glIsTexture(texture);
541 void LineWidth (GLfloat width)
546 void LinkProgram (GLuint program)
548 glLinkProgram(program);
551 void PixelStorei (GLenum pname, GLint param)
553 glPixelStorei(pname,param);
556 void PolygonOffset (GLfloat factor, GLfloat units)
558 glPolygonOffset(factor,units);
561 void ReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
563 glReadPixels(x,y,width,height,format,type,pixels);
566 void ReleaseShaderCompiler (void)
568 glReleaseShaderCompiler();
571 void RenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
573 glRenderbufferStorage(target,internalformat,width,height);
576 void SampleCoverage (GLclampf value, GLboolean invert)
578 glSampleCoverage(value,invert);
581 void Scissor (GLint x, GLint y, GLsizei width, GLsizei height)
583 glScissor(x,y,width,height);
586 void ShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
588 glShaderBinary(n,shaders,binaryformat,binary,length);
591 void ShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length)
593 glShaderSource(shader,count,string,length);
596 void StencilFunc (GLenum func, GLint ref, GLuint mask)
598 glStencilFunc(func,ref,mask);
601 void StencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask)
603 glStencilFuncSeparate(face,func,ref,mask);
606 void StencilMask (GLuint mask)
611 void StencilMaskSeparate (GLenum face, GLuint mask)
613 glStencilMaskSeparate(face,mask);
616 void StencilOp (GLenum fail, GLenum zfail, GLenum zpass)
618 glStencilOp(fail,zfail,zpass);
621 void StencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
623 glStencilOpSeparate(face,fail,zfail,zpass);
626 void TexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
628 glTexImage2D(target,level,internalformat,width,height,border,format,type,pixels);
631 void TexParameterf (GLenum target, GLenum pname, GLfloat param)
633 glTexParameterf(target,pname,param);
636 void TexParameterfv (GLenum target, GLenum pname, const GLfloat* params)
638 glTexParameterfv(target,pname,params);
641 void TexParameteri (GLenum target, GLenum pname, GLint param)
643 glTexParameteri(target,pname,param);
646 void TexParameteriv (GLenum target, GLenum pname, const GLint* params)
648 glTexParameteriv(target,pname,params);
651 void TexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
653 glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels);
656 void Uniform1f (GLint location, GLfloat x)
658 glUniform1f(location,x);
661 void Uniform1fv (GLint location, GLsizei count, const GLfloat* v)
663 glUniform1fv(location,count,v);
666 void Uniform1i (GLint location, GLint x)
668 glUniform1i(location,x);
671 void Uniform1iv (GLint location, GLsizei count, const GLint* v)
673 glUniform1iv(location,count,v);
676 void Uniform2f (GLint location, GLfloat x, GLfloat y)
678 glUniform2f(location,x,y);
681 void Uniform2fv (GLint location, GLsizei count, const GLfloat* v)
683 glUniform2fv(location,count,v);
686 void Uniform2i (GLint location, GLint x, GLint y)
688 glUniform2i(location,x,y);
691 void Uniform2iv (GLint location, GLsizei count, const GLint* v)
693 glUniform2iv(location,count,v);
696 void Uniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z)
698 glUniform3f(location,x,y,z);
701 void Uniform3fv (GLint location, GLsizei count, const GLfloat* v)
703 glUniform3fv(location,count,v);
706 void Uniform3i (GLint location, GLint x, GLint y, GLint z)
708 glUniform3i(location,x,y,z);
711 void Uniform3iv (GLint location, GLsizei count, const GLint* v)
713 glUniform3iv(location,count,v);
716 void Uniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
718 glUniform4f(location,x,y,z,w);
721 void Uniform4fv (GLint location, GLsizei count, const GLfloat* v)
723 glUniform4fv(location,count,v);
726 void Uniform4i (GLint location, GLint x, GLint y, GLint z, GLint w)
728 glUniform4i(location,x,y,z,w);
731 void Uniform4iv (GLint location, GLsizei count, const GLint* v)
733 glUniform4iv(location,count,v);
736 void UniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
738 glUniformMatrix2fv(location,count,transpose,value);
741 void UniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
743 glUniformMatrix3fv(location,count,transpose,value);
746 void UniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
748 glUniformMatrix4fv(location,count,transpose,value);
751 void UseProgram (GLuint program)
753 glUseProgram(program);
756 void ValidateProgram (GLuint program)
758 glValidateProgram(program);
761 void VertexAttrib1f (GLuint indx, GLfloat x)
763 glVertexAttrib1f(indx,x);
766 void VertexAttrib1fv (GLuint indx, const GLfloat* values)
768 glVertexAttrib1fv(indx,values);
771 void VertexAttrib2f (GLuint indx, GLfloat x, GLfloat y)
773 glVertexAttrib2f(indx,x,y);
776 void VertexAttrib2fv (GLuint indx, const GLfloat* values)
778 glVertexAttrib2fv(indx,values);
781 void VertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z)
783 glVertexAttrib3f(indx,x,y,z);
786 void VertexAttrib3fv (GLuint indx, const GLfloat* values)
788 glVertexAttrib3fv(indx,values);
791 void VertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
793 glVertexAttrib4f(indx,x,y,z,w);
796 void VertexAttrib4fv (GLuint indx, const GLfloat* values)
798 glVertexAttrib4fv(indx,values);
801 void VertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
803 glVertexAttribPointer(indx,size,type,normalized,stride,ptr);
806 void Viewport (GLint x, GLint y, GLsizei width, GLsizei height)
808 glViewport(x,y,width,height);
813 void ReadBuffer(GLenum mode)
815 #if DALI_GLES_VERSION >= 30
817 #endif // DALI_GLES_VERSION >= 30
820 void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
822 #if DALI_GLES_VERSION >= 30
823 glDrawRangeElements(mode,start,end,count,type,indices);
824 #endif // DALI_GLES_VERSION >= 30
827 void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
829 #if DALI_GLES_VERSION >= 30
830 glTexImage3D(target,level,internalformat,width,height,depth,border,format,type,pixels);
831 #endif // DALI_GLES_VERSION >= 30
834 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)
836 #if DALI_GLES_VERSION >= 30
837 glTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels);
838 #endif // DALI_GLES_VERSION >= 30
841 void CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
843 #if DALI_GLES_VERSION >= 30
844 glCopyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height);
845 #endif // DALI_GLES_VERSION >= 30
848 void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
850 #if DALI_GLES_VERSION >= 30
851 glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imageSize,data);
852 #endif // DALI_GLES_VERSION >= 30
855 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)
857 #if DALI_GLES_VERSION >= 30
858 glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imageSize,data);
859 #endif // DALI_GLES_VERSION >= 30
862 void GenQueries(GLsizei n, GLuint* ids)
864 #if DALI_GLES_VERSION >= 30
866 #endif // DALI_GLES_VERSION >= 30
869 void DeleteQueries(GLsizei n, const GLuint* ids)
871 #if DALI_GLES_VERSION >= 30
872 glDeleteQueries(n,ids);
873 #endif // DALI_GLES_VERSION >= 30
876 GLboolean IsQuery(GLuint id)
878 #if DALI_GLES_VERSION >= 30
879 return glIsQuery(id);
882 #endif // DALI_GLES_VERSION >= 30
885 void BeginQuery(GLenum target, GLuint id)
887 #if DALI_GLES_VERSION >= 30
888 glBeginQuery(target,id);
889 #endif // DALI_GLES_VERSION >= 30
892 void EndQuery(GLenum target)
894 #if DALI_GLES_VERSION >= 30
896 #endif // DALI_GLES_VERSION >= 30
899 void GetQueryiv(GLenum target, GLenum pname, GLint* params)
901 #if DALI_GLES_VERSION >= 30
902 glGetQueryiv(target,pname,params);
903 #endif // DALI_GLES_VERSION >= 30
906 void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
908 #if DALI_GLES_VERSION >= 30
909 glGetQueryObjectuiv(id,pname,params);
910 #endif // DALI_GLES_VERSION >= 30
913 GLboolean UnmapBuffer(GLenum target)
915 #if DALI_GLES_VERSION >= 30
916 return glUnmapBuffer(target);
919 #endif // DALI_GLES_VERSION >= 30
922 void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
924 #if DALI_GLES_VERSION >= 30
925 glGetBufferPointerv(target,pname,params);
926 #endif // DALI_GLES_VERSION >= 30
929 void DrawBuffers(GLsizei n, const GLenum* bufs)
931 #if DALI_GLES_VERSION >= 30
932 glDrawBuffers(n,bufs);
933 #endif // DALI_GLES_VERSION >= 30
936 void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
938 #if DALI_GLES_VERSION >= 30
939 glUniformMatrix2x3fv(location,count,transpose,value);
940 #endif // DALI_GLES_VERSION >= 30
943 void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
945 #if DALI_GLES_VERSION >= 30
946 glUniformMatrix3x2fv(location,count,transpose,value);
947 #endif // DALI_GLES_VERSION >= 30
950 void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
952 #if DALI_GLES_VERSION >= 30
953 glUniformMatrix2x4fv(location,count,transpose,value);
954 #endif // DALI_GLES_VERSION >= 30
957 void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
959 #if DALI_GLES_VERSION >= 30
960 glUniformMatrix4x2fv(location,count,transpose,value);
961 #endif // DALI_GLES_VERSION >= 30
964 void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
966 #if DALI_GLES_VERSION >= 30
967 glUniformMatrix3x4fv(location,count,transpose,value);
968 #endif // DALI_GLES_VERSION >= 30
971 void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
973 #if DALI_GLES_VERSION >= 30
974 glUniformMatrix4x3fv(location,count,transpose,value);
975 #endif // DALI_GLES_VERSION >= 30
978 void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
980 #if DALI_GLES_VERSION >= 30
981 glBlitFramebuffer(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter);
982 #endif // DALI_GLES_VERSION >= 30
985 void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
987 #if DALI_GLES_VERSION >= 30
988 glRenderbufferStorageMultisample(target,samples,internalformat,width,height);
989 #endif // DALI_GLES_VERSION >= 30
992 void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
994 #if DALI_GLES_VERSION >= 30
995 glFramebufferTextureLayer(target,attachment,texture,level,layer);
996 #endif // DALI_GLES_VERSION >= 30
999 GLvoid* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
1001 #if DALI_GLES_VERSION >= 30
1002 return glMapBufferRange(target,offset,length,access);
1005 #endif // DALI_GLES_VERSION >= 30
1008 void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
1010 #if DALI_GLES_VERSION >= 30
1011 glFlushMappedBufferRange(target,offset,length);
1012 #endif // DALI_GLES_VERSION >= 30
1015 void BindVertexArray(GLuint array)
1017 #if DALI_GLES_VERSION >= 30
1018 glBindVertexArray(array);
1019 #endif // DALI_GLES_VERSION >= 30
1022 void DeleteVertexArrays(GLsizei n, const GLuint* arrays)
1024 #if DALI_GLES_VERSION >= 30
1025 glDeleteVertexArrays(n,arrays);
1026 #endif // DALI_GLES_VERSION >= 30
1029 void GenVertexArrays(GLsizei n, GLuint* arrays)
1031 #if DALI_GLES_VERSION >= 30
1032 glGenVertexArrays(n,arrays);
1033 #endif // DALI_GLES_VERSION >= 30
1036 GLboolean IsVertexArray(GLuint array)
1038 #if DALI_GLES_VERSION >= 30
1039 return glIsVertexArray(array);
1042 #endif // DALI_GLES_VERSION >= 30
1045 void GetIntegeri_v(GLenum target, GLuint index, GLint* data)
1047 #if DALI_GLES_VERSION >= 30
1048 glGetIntegeri_v(target,index,data);
1049 #endif // DALI_GLES_VERSION >= 30
1052 void BeginTransformFeedback(GLenum primitiveMode)
1054 #if DALI_GLES_VERSION >= 30
1055 glBeginTransformFeedback(primitiveMode);
1056 #endif // DALI_GLES_VERSION >= 30
1059 void EndTransformFeedback(void)
1061 #if DALI_GLES_VERSION >= 30
1062 glEndTransformFeedback();
1063 #endif // DALI_GLES_VERSION >= 30
1066 void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
1068 #if DALI_GLES_VERSION >= 30
1069 glBindBufferRange(target,index,buffer,offset,size);
1070 #endif // DALI_GLES_VERSION >= 30
1073 void BindBufferBase(GLenum target, GLuint index, GLuint buffer)
1075 #if DALI_GLES_VERSION >= 30
1076 glBindBufferBase(target,index,buffer);
1077 #endif // DALI_GLES_VERSION >= 30
1080 void TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
1082 #if DALI_GLES_VERSION >= 30
1083 glTransformFeedbackVaryings(program,count,varyings,bufferMode);
1084 #endif // DALI_GLES_VERSION >= 30
1087 void GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
1089 #if DALI_GLES_VERSION >= 30
1090 glGetTransformFeedbackVarying(program,index,bufSize,length,size,type,name);
1091 #endif // DALI_GLES_VERSION >= 30
1094 void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
1096 #if DALI_GLES_VERSION >= 30
1097 glVertexAttribIPointer(index,size,type,stride,pointer);
1098 #endif // DALI_GLES_VERSION >= 30
1101 void GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
1103 #if DALI_GLES_VERSION >= 30
1104 glGetVertexAttribIiv(index,pname,params);
1105 #endif // DALI_GLES_VERSION >= 30
1108 void GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
1110 #if DALI_GLES_VERSION >= 30
1111 glGetVertexAttribIuiv(index,pname,params);
1112 #endif // DALI_GLES_VERSION >= 30
1115 void VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
1117 #if DALI_GLES_VERSION >= 30
1118 glVertexAttribI4i(index,x,y,z,w);
1119 #endif // DALI_GLES_VERSION >= 30
1122 void VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
1124 #if DALI_GLES_VERSION >= 30
1125 glVertexAttribI4ui(index,x,y,z,w);
1126 #endif // DALI_GLES_VERSION >= 30
1129 void VertexAttribI4iv(GLuint index, const GLint* v)
1131 #if DALI_GLES_VERSION >= 30
1132 glVertexAttribI4iv(index,v);
1133 #endif // DALI_GLES_VERSION >= 30
1136 void VertexAttribI4uiv(GLuint index, const GLuint* v)
1138 #if DALI_GLES_VERSION >= 30
1139 glVertexAttribI4uiv(index,v);
1140 #endif // DALI_GLES_VERSION >= 30
1143 void GetUniformuiv(GLuint program, GLint location, GLuint* params)
1145 #if DALI_GLES_VERSION >= 30
1146 glGetUniformuiv(program,location,params);
1147 #endif // DALI_GLES_VERSION >= 30
1150 GLint GetFragDataLocation(GLuint program, const GLchar *name)
1152 #if DALI_GLES_VERSION >= 30
1153 return glGetFragDataLocation(program,name);
1156 #endif // DALI_GLES_VERSION >= 30
1159 void Uniform1ui(GLint location, GLuint v0)
1161 #if DALI_GLES_VERSION >= 30
1162 glUniform1ui(location,v0);
1163 #endif // DALI_GLES_VERSION >= 30
1166 void Uniform2ui(GLint location, GLuint v0, GLuint v1)
1168 #if DALI_GLES_VERSION >= 30
1169 glUniform2ui(location,v0,v1);
1170 #endif // DALI_GLES_VERSION >= 30
1173 void Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
1175 #if DALI_GLES_VERSION >= 30
1176 glUniform3ui(location,v0,v1,v2);
1177 #endif // DALI_GLES_VERSION >= 30
1180 void Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
1182 #if DALI_GLES_VERSION >= 30
1183 glUniform4ui(location,v0,v1,v2,v3);
1184 #endif // DALI_GLES_VERSION >= 30
1187 void Uniform1uiv(GLint location, GLsizei count, const GLuint* value)
1189 #if DALI_GLES_VERSION >= 30
1190 glUniform1uiv(location,count,value);
1191 #endif // DALI_GLES_VERSION >= 30
1194 void Uniform2uiv(GLint location, GLsizei count, const GLuint* value)
1196 #if DALI_GLES_VERSION >= 30
1197 glUniform2uiv(location,count,value);
1198 #endif // DALI_GLES_VERSION >= 30
1201 void Uniform3uiv(GLint location, GLsizei count, const GLuint* value)
1203 #if DALI_GLES_VERSION >= 30
1204 glUniform3uiv(location,count,value);
1205 #endif // DALI_GLES_VERSION >= 30
1208 void Uniform4uiv(GLint location, GLsizei count, const GLuint* value)
1210 #if DALI_GLES_VERSION >= 30
1211 glUniform4uiv(location,count,value);
1212 #endif // DALI_GLES_VERSION >= 30
1215 void ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value)
1217 #if DALI_GLES_VERSION >= 30
1218 glClearBufferiv(buffer,drawbuffer,value);
1219 #endif // DALI_GLES_VERSION >= 30
1222 void ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value)
1224 #if DALI_GLES_VERSION >= 30
1225 glClearBufferuiv(buffer,drawbuffer,value);
1226 #endif // DALI_GLES_VERSION >= 30
1229 void ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value)
1231 #if DALI_GLES_VERSION >= 30
1232 glClearBufferfv(buffer,drawbuffer,value);
1233 #endif // DALI_GLES_VERSION >= 30
1236 void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
1238 #if DALI_GLES_VERSION >= 30
1239 glClearBufferfi(buffer,drawbuffer,depth,stencil);
1240 #endif // DALI_GLES_VERSION >= 30
1243 const GLubyte* GetStringi(GLenum name, GLuint index)
1245 #if DALI_GLES_VERSION >= 30
1246 return glGetStringi(name,index);
1249 #endif // DALI_GLES_VERSION >= 30
1252 void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
1254 #if DALI_GLES_VERSION >= 30
1255 glCopyBufferSubData(readTarget,writeTarget,readOffset,writeOffset,size);
1256 #endif // DALI_GLES_VERSION >= 30
1259 void GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices)
1261 #if DALI_GLES_VERSION >= 30
1262 glGetUniformIndices(program,uniformCount,uniformNames,uniformIndices);
1263 #endif // DALI_GLES_VERSION >= 30
1266 void GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
1268 #if DALI_GLES_VERSION >= 30
1269 glGetActiveUniformsiv(program,uniformCount,uniformIndices,pname,params);
1270 #endif // DALI_GLES_VERSION >= 30
1273 GLuint GetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
1275 #if DALI_GLES_VERSION >= 30
1276 return glGetUniformBlockIndex(program,uniformBlockName);
1279 #endif // DALI_GLES_VERSION >= 30
1282 void GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
1284 #if DALI_GLES_VERSION >= 30
1285 glGetActiveUniformBlockiv(program,uniformBlockIndex,pname,params);
1286 #endif // DALI_GLES_VERSION >= 30
1289 void GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
1291 #if DALI_GLES_VERSION >= 30
1292 glGetActiveUniformBlockName(program,uniformBlockIndex,bufSize,length,uniformBlockName);
1293 #endif // DALI_GLES_VERSION >= 30
1296 void UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
1298 #if DALI_GLES_VERSION >= 30
1299 glUniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding);
1300 #endif // DALI_GLES_VERSION >= 30
1303 void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
1305 #if DALI_GLES_VERSION >= 30
1306 glDrawArraysInstanced(mode,first,count,instanceCount);
1307 #endif // DALI_GLES_VERSION >= 30
1310 void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount)
1312 #if DALI_GLES_VERSION >= 30
1313 glDrawElementsInstanced(mode,count,type,indices,instanceCount);
1314 #endif // DALI_GLES_VERSION >= 30
1317 GLsync FenceSync(GLenum condition, GLbitfield flags)
1319 #if DALI_GLES_VERSION >= 30
1320 return glFenceSync(condition,flags);
1323 #endif // DALI_GLES_VERSION >= 30
1326 GLboolean IsSync(GLsync sync)
1328 #if DALI_GLES_VERSION >= 30
1329 return glIsSync(sync);
1332 #endif // DALI_GLES_VERSION >= 30
1335 void DeleteSync(GLsync sync)
1337 #if DALI_GLES_VERSION >= 30
1339 #endif // DALI_GLES_VERSION >= 30
1342 GLenum ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1344 #if DALI_GLES_VERSION >= 30
1345 return glClientWaitSync(sync,flags,timeout);
1348 #endif // DALI_GLES_VERSION >= 30
1351 void WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1353 #if DALI_GLES_VERSION >= 30
1354 glWaitSync(sync,flags,timeout);
1355 #endif // DALI_GLES_VERSION >= 30
1358 void GetInteger64v(GLenum pname, GLint64* params)
1360 #if DALI_GLES_VERSION >= 30
1361 glGetInteger64v(pname,params);
1362 #endif // DALI_GLES_VERSION >= 30
1365 void GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
1367 #if DALI_GLES_VERSION >= 30
1368 glGetSynciv(sync,pname,bufSize,length,values);
1369 #endif // DALI_GLES_VERSION >= 30
1372 void GetInteger64i_v(GLenum target, GLuint index, GLint64* data)
1374 #if DALI_GLES_VERSION >= 30
1375 glGetInteger64i_v(target,index,data);
1376 #endif // DALI_GLES_VERSION >= 30
1379 void GetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
1381 #if DALI_GLES_VERSION >= 30
1382 glGetBufferParameteri64v(target,pname,params);
1383 #endif // DALI_GLES_VERSION >= 30
1386 void GenSamplers(GLsizei count, GLuint* samplers)
1388 #if DALI_GLES_VERSION >= 30
1389 glGenSamplers(count,samplers);
1390 #endif // DALI_GLES_VERSION >= 30
1393 void DeleteSamplers(GLsizei count, const GLuint* samplers)
1395 #if DALI_GLES_VERSION >= 30
1396 glDeleteSamplers(count,samplers);
1397 #endif // DALI_GLES_VERSION >= 30
1400 GLboolean IsSampler(GLuint sampler)
1402 #if DALI_GLES_VERSION >= 30
1403 return glIsSampler(sampler);
1406 #endif // DALI_GLES_VERSION >= 30
1409 void BindSampler(GLuint unit, GLuint sampler)
1411 #if DALI_GLES_VERSION >= 30
1412 glBindSampler(unit,sampler);
1413 #endif // DALI_GLES_VERSION >= 30
1416 void SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
1418 #if DALI_GLES_VERSION >= 30
1419 glSamplerParameteri(sampler,pname,param);
1420 #endif // DALI_GLES_VERSION >= 30
1423 void SamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
1425 #if DALI_GLES_VERSION >= 30
1426 glSamplerParameteriv(sampler,pname,param);
1427 #endif // DALI_GLES_VERSION >= 30
1430 void SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
1432 #if DALI_GLES_VERSION >= 30
1433 glSamplerParameterf(sampler,pname,param);
1434 #endif // DALI_GLES_VERSION >= 30
1437 void SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
1439 #if DALI_GLES_VERSION >= 30
1440 glSamplerParameterfv(sampler,pname,param);
1441 #endif // DALI_GLES_VERSION >= 30
1444 void GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
1446 #if DALI_GLES_VERSION >= 30
1447 glGetSamplerParameteriv(sampler,pname,params);
1448 #endif // DALI_GLES_VERSION >= 30
1451 void GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
1453 #if DALI_GLES_VERSION >= 30
1454 glGetSamplerParameterfv(sampler,pname,params);
1455 #endif // DALI_GLES_VERSION >= 30
1458 void VertexAttribDivisor(GLuint index, GLuint divisor)
1460 #if DALI_GLES_VERSION >= 30
1461 glVertexAttribDivisor(index,divisor);
1462 #endif // DALI_GLES_VERSION >= 30
1465 void BindTransformFeedback(GLenum target, GLuint id)
1467 #if DALI_GLES_VERSION >= 30
1468 glBindTransformFeedback(target,id);
1469 #endif // DALI_GLES_VERSION >= 30
1472 void DeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
1474 #if DALI_GLES_VERSION >= 30
1475 glDeleteTransformFeedbacks(n,ids);
1476 #endif // DALI_GLES_VERSION >= 30
1479 void GenTransformFeedbacks(GLsizei n, GLuint* ids)
1481 #if DALI_GLES_VERSION >= 30
1482 glGenTransformFeedbacks(n,ids);
1483 #endif // DALI_GLES_VERSION >= 30
1486 GLboolean IsTransformFeedback(GLuint id)
1488 #if DALI_GLES_VERSION >= 30
1489 return glIsTransformFeedback(id);
1492 #endif // DALI_GLES_VERSION >= 30
1495 void PauseTransformFeedback(void)
1497 #if DALI_GLES_VERSION >= 30
1498 glPauseTransformFeedback();
1499 #endif // DALI_GLES_VERSION >= 30
1502 void ResumeTransformFeedback(void)
1504 #if DALI_GLES_VERSION >= 30
1505 glResumeTransformFeedback();
1506 #endif // DALI_GLES_VERSION >= 30
1509 void GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
1511 #if DALI_GLES_VERSION >= 30
1512 // if OpenGL ES 2.0 compatibility is need this can be implemented with
1513 // glGetProgramBinaryOES
1514 glGetProgramBinary(program,bufSize,length,binaryFormat,binary);
1516 mGlExtensions.GetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
1517 #endif // DALI_GLES_VERSION >= 30
1520 void ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
1522 #if DALI_GLES_VERSION >= 30
1523 // if OpenGL ES 2.0 compatibility is need this can be implemented with
1524 // glProgramBinaryOES
1525 glProgramBinary(program,binaryFormat,binary,length);
1527 mGlExtensions.ProgramBinaryOES(program, binaryFormat, binary, length);
1528 #endif // DALI_GLES_VERSION >= 30
1531 void ProgramParameteri(GLuint program, GLenum pname, GLint value)
1533 #if DALI_GLES_VERSION >= 30
1534 glProgramParameteri(program,pname,value);
1535 #endif // DALI_GLES_VERSION >= 30
1538 void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
1540 #if DALI_GLES_VERSION >= 30
1541 glInvalidateFramebuffer(target,numAttachments,attachments);
1543 mGlExtensions.DiscardFrameBuffer(target, numAttachments, attachments);
1544 #endif // DALI_GLES_VERSION >= 30
1547 void InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
1549 #if DALI_GLES_VERSION >= 30
1550 glInvalidateSubFramebuffer(target,numAttachments,attachments,x,y,width,height);
1551 #endif // DALI_GLES_VERSION >= 30
1554 void TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
1556 #if DALI_GLES_VERSION >= 30
1557 glTexStorage2D(target,levels,internalformat,width,height);
1558 #endif // DALI_GLES_VERSION >= 30
1561 void TexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
1563 #if DALI_GLES_VERSION >= 30
1564 glTexStorage3D(target,levels,internalformat,width,height,depth);
1565 #endif // DALI_GLES_VERSION >= 30
1568 void GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
1570 #if DALI_GLES_VERSION >= 30
1571 glGetInternalformativ(target,internalformat,pname,bufSize,params);
1572 #endif // DALI_GLES_VERSION >= 30
1576 ECoreX::GlExtensions mGlExtensions;
1580 } // namespace Adaptor
1582 } // namespace Internal
1586 #endif // __DALI_INTERNAL_GL_IMPLEMENTATION_H__