1 #ifndef __DALI_INTERNAL_GL_IMPLEMENTATION_H__
2 #define __DALI_INTERNAL_GL_IMPLEMENTATION_H__
5 * Copyright (c) 2016 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 <gl/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 */
72 void ActiveTexture (GLenum texture)
74 glActiveTexture(texture);
77 void AttachShader (GLuint program, GLuint shader)
79 glAttachShader(program,shader);
82 void BindAttribLocation (GLuint program, GLuint index, const char* name)
84 glBindAttribLocation(program,index,name);
87 void BindBuffer (GLenum target, GLuint buffer)
89 glBindBuffer(target,buffer);
92 void BindFramebuffer (GLenum target, GLuint framebuffer)
94 glBindFramebuffer(target,framebuffer);
97 void BindRenderbuffer (GLenum target, GLuint renderbuffer)
99 glBindRenderbuffer(target,renderbuffer);
102 void BindTexture (GLenum target, GLuint texture)
104 glBindTexture(target,texture);
107 void BlendColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
109 glBlendColor(red,green,blue,alpha);
112 void BlendEquation ( GLenum mode )
114 glBlendEquation(mode);
117 void BlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha)
119 glBlendEquationSeparate(modeRGB,modeAlpha);
122 void BlendFunc (GLenum sfactor, GLenum dfactor)
124 glBlendFunc(sfactor,dfactor);
127 void BlendFuncSeparate (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)
129 glBlendFuncSeparate(srcRGB,dstRGB,srcAlpha,dstAlpha);
132 void BufferData (GLenum target, GLsizeiptr size, const void* data, GLenum usage)
134 glBufferData(target,size,data,usage);
137 void BufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void* data)
139 glBufferSubData(target,offset,size,data);
142 GLenum CheckFramebufferStatus (GLenum target)
144 return glCheckFramebufferStatus(target);
147 void Clear (GLbitfield mask)
152 void ClearColor (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha)
154 glClearColor(red,green,blue,alpha);
157 void ClearDepthf (GLclampf depth)
159 glClearDepthf(depth);
162 void ClearStencil (GLint s)
167 void ColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha)
169 glColorMask(red,green,blue,alpha);
172 void CompileShader (GLuint shader)
174 glCompileShader(shader);
177 void CompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data)
179 glCompressedTexImage2D(target,level,internalformat,width,height,border,imageSize,data);
182 void CompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data)
184 glCompressedTexSubImage2D(target,level,xoffset,yoffset,width,height,format,imageSize,data);
187 void CopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border)
189 glCopyTexImage2D(target,level,internalformat,x,y,width,height,border);
192 void CopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height)
194 glCopyTexSubImage2D(target,level,xoffset,yoffset,x,y,width,height);
197 GLuint CreateProgram (void)
199 return glCreateProgram();
202 GLuint CreateShader (GLenum type)
204 return glCreateShader(type);
207 void CullFace (GLenum mode)
212 void DeleteBuffers (GLsizei n, const GLuint* buffers)
214 glDeleteBuffers(n,buffers);
217 void DeleteFramebuffers (GLsizei n, const GLuint* framebuffers)
219 glDeleteFramebuffers(n,framebuffers);
222 void DeleteProgram (GLuint program)
224 glDeleteProgram(program);
227 void DeleteRenderbuffers (GLsizei n, const GLuint* renderbuffers)
229 glDeleteRenderbuffers(n,renderbuffers);
232 void DeleteShader (GLuint shader)
234 glDeleteShader(shader);
237 void DeleteTextures (GLsizei n, const GLuint* textures)
239 glDeleteTextures(n,textures);
242 void DepthFunc (GLenum func)
247 void DepthMask (GLboolean flag)
252 void DepthRangef (GLclampf zNear, GLclampf zFar)
254 glDepthRangef(zNear,zFar);
257 void DetachShader (GLuint program, GLuint shader)
259 glDetachShader(program,shader);
262 void Disable (GLenum cap)
267 void DisableVertexAttribArray (GLuint index)
269 glDisableVertexAttribArray(index);
272 void DrawArrays (GLenum mode, GLint first, GLsizei count)
274 glDrawArrays(mode,first,count);
277 void DrawElements (GLenum mode, GLsizei count, GLenum type, const void* indices)
279 glDrawElements(mode,count,type,indices);
282 void Enable (GLenum cap)
287 void EnableVertexAttribArray (GLuint index)
289 glEnableVertexAttribArray(index);
302 void FramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
304 glFramebufferRenderbuffer(target,attachment,renderbuffertarget,renderbuffer);
307 void FramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
309 glFramebufferTexture2D(target,attachment,textarget,texture,level);
312 void FrontFace (GLenum mode)
317 void GenBuffers (GLsizei n, GLuint* buffers)
319 glGenBuffers(n,buffers);
322 void GenerateMipmap (GLenum target)
324 glGenerateMipmap(target);
327 void GenFramebuffers (GLsizei n, GLuint* framebuffers)
329 glGenFramebuffers(n,framebuffers);
332 void GenRenderbuffers (GLsizei n, GLuint* renderbuffers)
334 glGenRenderbuffers(n,renderbuffers);
337 void GenTextures (GLsizei n, GLuint* textures)
339 glGenTextures(n,textures);
342 void GetActiveAttrib (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
344 glGetActiveAttrib(program,index,bufsize,length,size,type,name);
347 void GetActiveUniform (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name)
349 glGetActiveUniform(program,index,bufsize,length,size,type,name);
352 void GetAttachedShaders (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders)
354 glGetAttachedShaders(program,maxcount,count,shaders);
357 int GetAttribLocation (GLuint program, const char* name)
359 return glGetAttribLocation(program,name);
362 void GetBooleanv (GLenum pname, GLboolean* params)
364 glGetBooleanv(pname,params);
367 void GetBufferParameteriv (GLenum target, GLenum pname, GLint* params)
369 glGetBufferParameteriv(target,pname,params);
372 GLenum GetError (void)
377 void GetFloatv (GLenum pname, GLfloat* params)
379 glGetFloatv(pname,params);
382 void GetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint* params)
384 glGetFramebufferAttachmentParameteriv(target,attachment,pname,params);
387 void GetIntegerv (GLenum pname, GLint* params)
389 glGetIntegerv(pname,params);
392 void GetProgramiv (GLuint program, GLenum pname, GLint* params)
394 glGetProgramiv(program,pname,params);
397 void GetProgramInfoLog (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog)
399 glGetProgramInfoLog(program,bufsize,length,infolog);
402 void GetRenderbufferParameteriv (GLenum target, GLenum pname, GLint* params)
404 glGetRenderbufferParameteriv(target,pname,params);
407 void GetShaderiv (GLuint shader, GLenum pname, GLint* params)
409 glGetShaderiv(shader,pname,params);
412 void GetShaderInfoLog (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog)
414 glGetShaderInfoLog(shader,bufsize,length,infolog);
417 void GetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision)
419 glGetShaderPrecisionFormat(shadertype,precisiontype,range,precision);
422 void GetShaderSource (GLuint shader, GLsizei bufsize, GLsizei* length, char* source)
424 glGetShaderSource(shader,bufsize,length,source);
427 const GLubyte* GetString (GLenum name)
429 return glGetString(name);
432 void GetTexParameterfv (GLenum target, GLenum pname, GLfloat* params)
434 glGetTexParameterfv(target,pname,params);
437 void GetTexParameteriv (GLenum target, GLenum pname, GLint* params)
439 glGetTexParameteriv(target,pname,params);
442 void GetUniformfv (GLuint program, GLint location, GLfloat* params)
444 glGetUniformfv(program,location,params);
447 void GetUniformiv (GLuint program, GLint location, GLint* params)
449 glGetUniformiv(program,location,params);
452 int GetUniformLocation (GLuint program, const char* name)
454 return glGetUniformLocation(program,name);
457 void GetVertexAttribfv (GLuint index, GLenum pname, GLfloat* params)
459 glGetVertexAttribfv(index,pname,params);
462 void GetVertexAttribiv (GLuint index, GLenum pname, GLint* params)
464 glGetVertexAttribiv(index,pname,params);
467 void GetVertexAttribPointerv (GLuint index, GLenum pname, void** pointer)
469 glGetVertexAttribPointerv(index,pname,pointer);
472 void Hint (GLenum target, GLenum mode)
477 GLboolean IsBuffer (GLuint buffer)
479 return glIsBuffer(buffer);
482 GLboolean IsEnabled (GLenum cap)
484 return glIsEnabled(cap);
487 GLboolean IsFramebuffer (GLuint framebuffer)
489 return glIsFramebuffer(framebuffer);
492 GLboolean IsProgram (GLuint program)
494 return glIsProgram(program);
497 GLboolean IsRenderbuffer (GLuint renderbuffer)
499 return glIsRenderbuffer(renderbuffer);
502 GLboolean IsShader (GLuint shader)
504 return glIsShader(shader);
507 GLboolean IsTexture (GLuint texture)
509 return glIsTexture(texture);
512 void LineWidth (GLfloat width)
517 void LinkProgram (GLuint program)
519 glLinkProgram(program);
522 void PixelStorei (GLenum pname, GLint param)
524 glPixelStorei(pname,param);
527 void PolygonOffset (GLfloat factor, GLfloat units)
529 glPolygonOffset(factor,units);
532 void ReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels)
534 glReadPixels(x,y,width,height,format,type,pixels);
537 void ReleaseShaderCompiler (void)
539 glReleaseShaderCompiler();
542 void RenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
544 glRenderbufferStorage(target,internalformat,width,height);
547 void SampleCoverage (GLclampf value, GLboolean invert)
549 glSampleCoverage(value,invert);
552 void Scissor (GLint x, GLint y, GLsizei width, GLsizei height)
554 glScissor(x,y,width,height);
557 void ShaderBinary (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length)
559 glShaderBinary(n,shaders,binaryformat,binary,length);
562 void ShaderSource (GLuint shader, GLsizei count, const char** string, const GLint* length)
564 glShaderSource(shader,count,string,length);
567 void StencilFunc (GLenum func, GLint ref, GLuint mask)
569 glStencilFunc(func,ref,mask);
572 void StencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask)
574 glStencilFuncSeparate(face,func,ref,mask);
577 void StencilMask (GLuint mask)
582 void StencilMaskSeparate (GLenum face, GLuint mask)
584 glStencilMaskSeparate(face,mask);
587 void StencilOp (GLenum fail, GLenum zfail, GLenum zpass)
589 glStencilOp(fail,zfail,zpass);
592 void StencilOpSeparate (GLenum face, GLenum fail, GLenum zfail, GLenum zpass)
594 glStencilOpSeparate(face,fail,zfail,zpass);
597 void TexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels)
599 glTexImage2D(target,level,internalformat,width,height,border,format,type,pixels);
602 void TexParameterf (GLenum target, GLenum pname, GLfloat param)
604 glTexParameterf(target,pname,param);
607 void TexParameterfv (GLenum target, GLenum pname, const GLfloat* params)
609 glTexParameterfv(target,pname,params);
612 void TexParameteri (GLenum target, GLenum pname, GLint param)
614 glTexParameteri(target,pname,param);
617 void TexParameteriv (GLenum target, GLenum pname, const GLint* params)
619 glTexParameteriv(target,pname,params);
622 void TexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels)
624 glTexSubImage2D(target,level,xoffset,yoffset,width,height,format,type,pixels);
627 void Uniform1f (GLint location, GLfloat x)
629 glUniform1f(location,x);
632 void Uniform1fv (GLint location, GLsizei count, const GLfloat* v)
634 glUniform1fv(location,count,v);
637 void Uniform1i (GLint location, GLint x)
639 glUniform1i(location,x);
642 void Uniform1iv (GLint location, GLsizei count, const GLint* v)
644 glUniform1iv(location,count,v);
647 void Uniform2f (GLint location, GLfloat x, GLfloat y)
649 glUniform2f(location,x,y);
652 void Uniform2fv (GLint location, GLsizei count, const GLfloat* v)
654 glUniform2fv(location,count,v);
657 void Uniform2i (GLint location, GLint x, GLint y)
659 glUniform2i(location,x,y);
662 void Uniform2iv (GLint location, GLsizei count, const GLint* v)
664 glUniform2iv(location,count,v);
667 void Uniform3f (GLint location, GLfloat x, GLfloat y, GLfloat z)
669 glUniform3f(location,x,y,z);
672 void Uniform3fv (GLint location, GLsizei count, const GLfloat* v)
674 glUniform3fv(location,count,v);
677 void Uniform3i (GLint location, GLint x, GLint y, GLint z)
679 glUniform3i(location,x,y,z);
682 void Uniform3iv (GLint location, GLsizei count, const GLint* v)
684 glUniform3iv(location,count,v);
687 void Uniform4f (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
689 glUniform4f(location,x,y,z,w);
692 void Uniform4fv (GLint location, GLsizei count, const GLfloat* v)
694 glUniform4fv(location,count,v);
697 void Uniform4i (GLint location, GLint x, GLint y, GLint z, GLint w)
699 glUniform4i(location,x,y,z,w);
702 void Uniform4iv (GLint location, GLsizei count, const GLint* v)
704 glUniform4iv(location,count,v);
707 void UniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
709 glUniformMatrix2fv(location,count,transpose,value);
712 void UniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
714 glUniformMatrix3fv(location,count,transpose,value);
717 void UniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
719 glUniformMatrix4fv(location,count,transpose,value);
722 void UseProgram (GLuint program)
724 glUseProgram(program);
727 void ValidateProgram (GLuint program)
729 glValidateProgram(program);
732 void VertexAttrib1f (GLuint indx, GLfloat x)
734 glVertexAttrib1f(indx,x);
737 void VertexAttrib1fv (GLuint indx, const GLfloat* values)
739 glVertexAttrib1fv(indx,values);
742 void VertexAttrib2f (GLuint indx, GLfloat x, GLfloat y)
744 glVertexAttrib2f(indx,x,y);
747 void VertexAttrib2fv (GLuint indx, const GLfloat* values)
749 glVertexAttrib2fv(indx,values);
752 void VertexAttrib3f (GLuint indx, GLfloat x, GLfloat y, GLfloat z)
754 glVertexAttrib3f(indx,x,y,z);
757 void VertexAttrib3fv (GLuint indx, const GLfloat* values)
759 glVertexAttrib3fv(indx,values);
762 void VertexAttrib4f (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w)
764 glVertexAttrib4f(indx,x,y,z,w);
767 void VertexAttrib4fv (GLuint indx, const GLfloat* values)
769 glVertexAttrib4fv(indx,values);
772 void VertexAttribPointer (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr)
774 glVertexAttribPointer(indx,size,type,normalized,stride,ptr);
777 void Viewport (GLint x, GLint y, GLsizei width, GLsizei height)
779 glViewport(x,y,width,height);
784 void ReadBuffer(GLenum mode)
786 #if DALI_GLES_VERSION >= 30
788 #endif // DALI_GLES_VERSION >= 30
791 void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
793 #if DALI_GLES_VERSION >= 30
794 glDrawRangeElements(mode,start,end,count,type,indices);
795 #endif // DALI_GLES_VERSION >= 30
798 void TexImage3D(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)
800 #if DALI_GLES_VERSION >= 30
801 glTexImage3D(target,level,internalformat,width,height,depth,border,format,type,pixels);
802 #endif // DALI_GLES_VERSION >= 30
805 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)
807 #if DALI_GLES_VERSION >= 30
808 glTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,type,pixels);
809 #endif // DALI_GLES_VERSION >= 30
812 void CopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
814 #if DALI_GLES_VERSION >= 30
815 glCopyTexSubImage3D(target,level,xoffset,yoffset,zoffset,x,y,width,height);
816 #endif // DALI_GLES_VERSION >= 30
819 void CompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
821 #if DALI_GLES_VERSION >= 30
822 glCompressedTexImage3D(target,level,internalformat,width,height,depth,border,imageSize,data);
823 #endif // DALI_GLES_VERSION >= 30
826 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)
828 #if DALI_GLES_VERSION >= 30
829 glCompressedTexSubImage3D(target,level,xoffset,yoffset,zoffset,width,height,depth,format,imageSize,data);
830 #endif // DALI_GLES_VERSION >= 30
833 void GenQueries(GLsizei n, GLuint* ids)
835 #if DALI_GLES_VERSION >= 30
837 #endif // DALI_GLES_VERSION >= 30
840 void DeleteQueries(GLsizei n, const GLuint* ids)
842 #if DALI_GLES_VERSION >= 30
843 glDeleteQueries(n,ids);
844 #endif // DALI_GLES_VERSION >= 30
847 GLboolean IsQuery(GLuint id)
849 #if DALI_GLES_VERSION >= 30
850 return glIsQuery(id);
853 #endif // DALI_GLES_VERSION >= 30
856 void BeginQuery(GLenum target, GLuint id)
858 #if DALI_GLES_VERSION >= 30
859 glBeginQuery(target,id);
860 #endif // DALI_GLES_VERSION >= 30
863 void EndQuery(GLenum target)
865 #if DALI_GLES_VERSION >= 30
867 #endif // DALI_GLES_VERSION >= 30
870 void GetQueryiv(GLenum target, GLenum pname, GLint* params)
872 #if DALI_GLES_VERSION >= 30
873 glGetQueryiv(target,pname,params);
874 #endif // DALI_GLES_VERSION >= 30
877 void GetQueryObjectuiv(GLuint id, GLenum pname, GLuint* params)
879 #if DALI_GLES_VERSION >= 30
880 glGetQueryObjectuiv(id,pname,params);
881 #endif // DALI_GLES_VERSION >= 30
884 GLboolean UnmapBuffer(GLenum target)
886 #if DALI_GLES_VERSION >= 30
887 return glUnmapBuffer(target);
890 #endif // DALI_GLES_VERSION >= 30
893 void GetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
895 #if DALI_GLES_VERSION >= 30
896 glGetBufferPointerv(target,pname,params);
897 #endif // DALI_GLES_VERSION >= 30
900 void DrawBuffers(GLsizei n, const GLenum* bufs)
902 #if DALI_GLES_VERSION >= 30
903 glDrawBuffers(n,bufs);
904 #endif // DALI_GLES_VERSION >= 30
907 void UniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
909 #if DALI_GLES_VERSION >= 30
910 glUniformMatrix2x3fv(location,count,transpose,value);
911 #endif // DALI_GLES_VERSION >= 30
914 void UniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
916 #if DALI_GLES_VERSION >= 30
917 glUniformMatrix3x2fv(location,count,transpose,value);
918 #endif // DALI_GLES_VERSION >= 30
921 void UniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
923 #if DALI_GLES_VERSION >= 30
924 glUniformMatrix2x4fv(location,count,transpose,value);
925 #endif // DALI_GLES_VERSION >= 30
928 void UniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
930 #if DALI_GLES_VERSION >= 30
931 glUniformMatrix4x2fv(location,count,transpose,value);
932 #endif // DALI_GLES_VERSION >= 30
935 void UniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
937 #if DALI_GLES_VERSION >= 30
938 glUniformMatrix3x4fv(location,count,transpose,value);
939 #endif // DALI_GLES_VERSION >= 30
942 void UniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
944 #if DALI_GLES_VERSION >= 30
945 glUniformMatrix4x3fv(location,count,transpose,value);
946 #endif // DALI_GLES_VERSION >= 30
949 void BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
951 #if DALI_GLES_VERSION >= 30
952 glBlitFramebuffer(srcX0,srcY0,srcX1,srcY1,dstX0,dstY0,dstX1,dstY1,mask,filter);
953 #endif // DALI_GLES_VERSION >= 30
956 void RenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
958 #if DALI_GLES_VERSION >= 30
959 glRenderbufferStorageMultisample(target,samples,internalformat,width,height);
960 #endif // DALI_GLES_VERSION >= 30
963 void FramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
965 #if DALI_GLES_VERSION >= 30
966 glFramebufferTextureLayer(target,attachment,texture,level,layer);
967 #endif // DALI_GLES_VERSION >= 30
970 GLvoid* MapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
972 #if DALI_GLES_VERSION >= 30
973 return glMapBufferRange(target,offset,length,access);
976 #endif // DALI_GLES_VERSION >= 30
979 void FlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
981 #if DALI_GLES_VERSION >= 30
982 glFlushMappedBufferRange(target,offset,length);
983 #endif // DALI_GLES_VERSION >= 30
986 void BindVertexArray(GLuint array)
988 #if DALI_GLES_VERSION >= 30
989 glBindVertexArray(array);
990 #endif // DALI_GLES_VERSION >= 30
993 void DeleteVertexArrays(GLsizei n, const GLuint* arrays)
995 #if DALI_GLES_VERSION >= 30
996 glDeleteVertexArrays(n,arrays);
997 #endif // DALI_GLES_VERSION >= 30
1000 void GenVertexArrays(GLsizei n, GLuint* arrays)
1002 #if DALI_GLES_VERSION >= 30
1003 glGenVertexArrays(n,arrays);
1004 #endif // DALI_GLES_VERSION >= 30
1007 GLboolean IsVertexArray(GLuint array)
1009 #if DALI_GLES_VERSION >= 30
1010 return glIsVertexArray(array);
1013 #endif // DALI_GLES_VERSION >= 30
1016 void GetIntegeri_v(GLenum target, GLuint index, GLint* data)
1018 #if DALI_GLES_VERSION >= 30
1019 glGetIntegeri_v(target,index,data);
1020 #endif // DALI_GLES_VERSION >= 30
1023 void BeginTransformFeedback(GLenum primitiveMode)
1025 #if DALI_GLES_VERSION >= 30
1026 glBeginTransformFeedback(primitiveMode);
1027 #endif // DALI_GLES_VERSION >= 30
1030 void EndTransformFeedback(void)
1032 #if DALI_GLES_VERSION >= 30
1033 glEndTransformFeedback();
1034 #endif // DALI_GLES_VERSION >= 30
1037 void BindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
1039 #if DALI_GLES_VERSION >= 30
1040 glBindBufferRange(target,index,buffer,offset,size);
1041 #endif // DALI_GLES_VERSION >= 30
1044 void BindBufferBase(GLenum target, GLuint index, GLuint buffer)
1046 #if DALI_GLES_VERSION >= 30
1047 glBindBufferBase(target,index,buffer);
1048 #endif // DALI_GLES_VERSION >= 30
1051 void TransformFeedbackVaryings(GLuint program, GLsizei count, const GLchar* const* varyings, GLenum bufferMode)
1053 #if DALI_GLES_VERSION >= 30
1054 glTransformFeedbackVaryings(program,count,varyings,bufferMode);
1055 #endif // DALI_GLES_VERSION >= 30
1058 void GetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, GLchar* name)
1060 #if DALI_GLES_VERSION >= 30
1061 glGetTransformFeedbackVarying(program,index,bufSize,length,size,type,name);
1062 #endif // DALI_GLES_VERSION >= 30
1065 void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
1067 #if DALI_GLES_VERSION >= 30
1068 glVertexAttribIPointer(index,size,type,stride,pointer);
1069 #endif // DALI_GLES_VERSION >= 30
1072 void GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
1074 #if DALI_GLES_VERSION >= 30
1075 glGetVertexAttribIiv(index,pname,params);
1076 #endif // DALI_GLES_VERSION >= 30
1079 void GetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
1081 #if DALI_GLES_VERSION >= 30
1082 glGetVertexAttribIuiv(index,pname,params);
1083 #endif // DALI_GLES_VERSION >= 30
1086 void VertexAttribI4i(GLuint index, GLint x, GLint y, GLint z, GLint w)
1088 #if DALI_GLES_VERSION >= 30
1089 glVertexAttribI4i(index,x,y,z,w);
1090 #endif // DALI_GLES_VERSION >= 30
1093 void VertexAttribI4ui(GLuint index, GLuint x, GLuint y, GLuint z, GLuint w)
1095 #if DALI_GLES_VERSION >= 30
1096 glVertexAttribI4ui(index,x,y,z,w);
1097 #endif // DALI_GLES_VERSION >= 30
1100 void VertexAttribI4iv(GLuint index, const GLint* v)
1102 #if DALI_GLES_VERSION >= 30
1103 glVertexAttribI4iv(index,v);
1104 #endif // DALI_GLES_VERSION >= 30
1107 void VertexAttribI4uiv(GLuint index, const GLuint* v)
1109 #if DALI_GLES_VERSION >= 30
1110 glVertexAttribI4uiv(index,v);
1111 #endif // DALI_GLES_VERSION >= 30
1114 void GetUniformuiv(GLuint program, GLint location, GLuint* params)
1116 #if DALI_GLES_VERSION >= 30
1117 glGetUniformuiv(program,location,params);
1118 #endif // DALI_GLES_VERSION >= 30
1121 GLint GetFragDataLocation(GLuint program, const GLchar *name)
1123 #if DALI_GLES_VERSION >= 30
1124 return glGetFragDataLocation(program,name);
1127 #endif // DALI_GLES_VERSION >= 30
1130 void Uniform1ui(GLint location, GLuint v0)
1132 #if DALI_GLES_VERSION >= 30
1133 glUniform1ui(location,v0);
1134 #endif // DALI_GLES_VERSION >= 30
1137 void Uniform2ui(GLint location, GLuint v0, GLuint v1)
1139 #if DALI_GLES_VERSION >= 30
1140 glUniform2ui(location,v0,v1);
1141 #endif // DALI_GLES_VERSION >= 30
1144 void Uniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
1146 #if DALI_GLES_VERSION >= 30
1147 glUniform3ui(location,v0,v1,v2);
1148 #endif // DALI_GLES_VERSION >= 30
1151 void Uniform4ui(GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
1153 #if DALI_GLES_VERSION >= 30
1154 glUniform4ui(location,v0,v1,v2,v3);
1155 #endif // DALI_GLES_VERSION >= 30
1158 void Uniform1uiv(GLint location, GLsizei count, const GLuint* value)
1160 #if DALI_GLES_VERSION >= 30
1161 glUniform1uiv(location,count,value);
1162 #endif // DALI_GLES_VERSION >= 30
1165 void Uniform2uiv(GLint location, GLsizei count, const GLuint* value)
1167 #if DALI_GLES_VERSION >= 30
1168 glUniform2uiv(location,count,value);
1169 #endif // DALI_GLES_VERSION >= 30
1172 void Uniform3uiv(GLint location, GLsizei count, const GLuint* value)
1174 #if DALI_GLES_VERSION >= 30
1175 glUniform3uiv(location,count,value);
1176 #endif // DALI_GLES_VERSION >= 30
1179 void Uniform4uiv(GLint location, GLsizei count, const GLuint* value)
1181 #if DALI_GLES_VERSION >= 30
1182 glUniform4uiv(location,count,value);
1183 #endif // DALI_GLES_VERSION >= 30
1186 void ClearBufferiv(GLenum buffer, GLint drawbuffer, const GLint* value)
1188 #if DALI_GLES_VERSION >= 30
1189 glClearBufferiv(buffer,drawbuffer,value);
1190 #endif // DALI_GLES_VERSION >= 30
1193 void ClearBufferuiv(GLenum buffer, GLint drawbuffer, const GLuint* value)
1195 #if DALI_GLES_VERSION >= 30
1196 glClearBufferuiv(buffer,drawbuffer,value);
1197 #endif // DALI_GLES_VERSION >= 30
1200 void ClearBufferfv(GLenum buffer, GLint drawbuffer, const GLfloat* value)
1202 #if DALI_GLES_VERSION >= 30
1203 glClearBufferfv(buffer,drawbuffer,value);
1204 #endif // DALI_GLES_VERSION >= 30
1207 void ClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil)
1209 #if DALI_GLES_VERSION >= 30
1210 glClearBufferfi(buffer,drawbuffer,depth,stencil);
1211 #endif // DALI_GLES_VERSION >= 30
1214 const GLubyte* GetStringi(GLenum name, GLuint index)
1216 #if DALI_GLES_VERSION >= 30
1217 return glGetStringi(name,index);
1220 #endif // DALI_GLES_VERSION >= 30
1223 void CopyBufferSubData(GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size)
1225 #if DALI_GLES_VERSION >= 30
1226 glCopyBufferSubData(readTarget,writeTarget,readOffset,writeOffset,size);
1227 #endif // DALI_GLES_VERSION >= 30
1230 void GetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar* const* uniformNames, GLuint* uniformIndices)
1232 #if DALI_GLES_VERSION >= 30
1233 glGetUniformIndices(program,uniformCount,uniformNames,uniformIndices);
1234 #endif // DALI_GLES_VERSION >= 30
1237 void GetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
1239 #if DALI_GLES_VERSION >= 30
1240 glGetActiveUniformsiv(program,uniformCount,uniformIndices,pname,params);
1241 #endif // DALI_GLES_VERSION >= 30
1244 GLuint GetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
1246 #if DALI_GLES_VERSION >= 30
1247 return glGetUniformBlockIndex(program,uniformBlockName);
1250 #endif // DALI_GLES_VERSION >= 30
1253 void GetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
1255 #if DALI_GLES_VERSION >= 30
1256 glGetActiveUniformBlockiv(program,uniformBlockIndex,pname,params);
1257 #endif // DALI_GLES_VERSION >= 30
1260 void GetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
1262 #if DALI_GLES_VERSION >= 30
1263 glGetActiveUniformBlockName(program,uniformBlockIndex,bufSize,length,uniformBlockName);
1264 #endif // DALI_GLES_VERSION >= 30
1267 void UniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
1269 #if DALI_GLES_VERSION >= 30
1270 glUniformBlockBinding(program,uniformBlockIndex,uniformBlockBinding);
1271 #endif // DALI_GLES_VERSION >= 30
1274 void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount)
1276 #if DALI_GLES_VERSION >= 30
1277 glDrawArraysInstanced(mode,first,count,instanceCount);
1278 #endif // DALI_GLES_VERSION >= 30
1281 void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const GLvoid* indices, GLsizei instanceCount)
1283 #if DALI_GLES_VERSION >= 30
1284 glDrawElementsInstanced(mode,count,type,indices,instanceCount);
1285 #endif // DALI_GLES_VERSION >= 30
1288 GLsync FenceSync(GLenum condition, GLbitfield flags)
1290 #if DALI_GLES_VERSION >= 30
1291 return glFenceSync(condition,flags);
1294 #endif // DALI_GLES_VERSION >= 30
1297 GLboolean IsSync(GLsync sync)
1299 #if DALI_GLES_VERSION >= 30
1300 return glIsSync(sync);
1303 #endif // DALI_GLES_VERSION >= 30
1306 void DeleteSync(GLsync sync)
1308 #if DALI_GLES_VERSION >= 30
1310 #endif // DALI_GLES_VERSION >= 30
1313 GLenum ClientWaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1315 #if DALI_GLES_VERSION >= 30
1316 return glClientWaitSync(sync,flags,timeout);
1319 #endif // DALI_GLES_VERSION >= 30
1322 void WaitSync(GLsync sync, GLbitfield flags, GLuint64 timeout)
1324 #if DALI_GLES_VERSION >= 30
1325 glWaitSync(sync,flags,timeout);
1326 #endif // DALI_GLES_VERSION >= 30
1329 void GetInteger64v(GLenum pname, GLint64* params)
1331 #if DALI_GLES_VERSION >= 30
1332 glGetInteger64v(pname,params);
1333 #endif // DALI_GLES_VERSION >= 30
1336 void GetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
1338 #if DALI_GLES_VERSION >= 30
1339 glGetSynciv(sync,pname,bufSize,length,values);
1340 #endif // DALI_GLES_VERSION >= 30
1343 void GetInteger64i_v(GLenum target, GLuint index, GLint64* data)
1345 #if DALI_GLES_VERSION >= 30
1346 glGetInteger64i_v(target,index,data);
1347 #endif // DALI_GLES_VERSION >= 30
1350 void GetBufferParameteri64v(GLenum target, GLenum pname, GLint64* params)
1352 #if DALI_GLES_VERSION >= 30
1353 glGetBufferParameteri64v(target,pname,params);
1354 #endif // DALI_GLES_VERSION >= 30
1357 void GenSamplers(GLsizei count, GLuint* samplers)
1359 #if DALI_GLES_VERSION >= 30
1360 glGenSamplers(count,samplers);
1361 #endif // DALI_GLES_VERSION >= 30
1364 void DeleteSamplers(GLsizei count, const GLuint* samplers)
1366 #if DALI_GLES_VERSION >= 30
1367 glDeleteSamplers(count,samplers);
1368 #endif // DALI_GLES_VERSION >= 30
1371 GLboolean IsSampler(GLuint sampler)
1373 #if DALI_GLES_VERSION >= 30
1374 return glIsSampler(sampler);
1377 #endif // DALI_GLES_VERSION >= 30
1380 void BindSampler(GLuint unit, GLuint sampler)
1382 #if DALI_GLES_VERSION >= 30
1383 glBindSampler(unit,sampler);
1384 #endif // DALI_GLES_VERSION >= 30
1387 void SamplerParameteri(GLuint sampler, GLenum pname, GLint param)
1389 #if DALI_GLES_VERSION >= 30
1390 glSamplerParameteri(sampler,pname,param);
1391 #endif // DALI_GLES_VERSION >= 30
1394 void SamplerParameteriv(GLuint sampler, GLenum pname, const GLint* param)
1396 #if DALI_GLES_VERSION >= 30
1397 glSamplerParameteriv(sampler,pname,param);
1398 #endif // DALI_GLES_VERSION >= 30
1401 void SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
1403 #if DALI_GLES_VERSION >= 30
1404 glSamplerParameterf(sampler,pname,param);
1405 #endif // DALI_GLES_VERSION >= 30
1408 void SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* param)
1410 #if DALI_GLES_VERSION >= 30
1411 glSamplerParameterfv(sampler,pname,param);
1412 #endif // DALI_GLES_VERSION >= 30
1415 void GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
1417 #if DALI_GLES_VERSION >= 30
1418 glGetSamplerParameteriv(sampler,pname,params);
1419 #endif // DALI_GLES_VERSION >= 30
1422 void GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
1424 #if DALI_GLES_VERSION >= 30
1425 glGetSamplerParameterfv(sampler,pname,params);
1426 #endif // DALI_GLES_VERSION >= 30
1429 void VertexAttribDivisor(GLuint index, GLuint divisor)
1431 #if DALI_GLES_VERSION >= 30
1432 glVertexAttribDivisor(index,divisor);
1433 #endif // DALI_GLES_VERSION >= 30
1436 void BindTransformFeedback(GLenum target, GLuint id)
1438 #if DALI_GLES_VERSION >= 30
1439 glBindTransformFeedback(target,id);
1440 #endif // DALI_GLES_VERSION >= 30
1443 void DeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
1445 #if DALI_GLES_VERSION >= 30
1446 glDeleteTransformFeedbacks(n,ids);
1447 #endif // DALI_GLES_VERSION >= 30
1450 void GenTransformFeedbacks(GLsizei n, GLuint* ids)
1452 #if DALI_GLES_VERSION >= 30
1453 glGenTransformFeedbacks(n,ids);
1454 #endif // DALI_GLES_VERSION >= 30
1457 GLboolean IsTransformFeedback(GLuint id)
1459 #if DALI_GLES_VERSION >= 30
1460 return glIsTransformFeedback(id);
1463 #endif // DALI_GLES_VERSION >= 30
1466 void PauseTransformFeedback(void)
1468 #if DALI_GLES_VERSION >= 30
1469 glPauseTransformFeedback();
1470 #endif // DALI_GLES_VERSION >= 30
1473 void ResumeTransformFeedback(void)
1475 #if DALI_GLES_VERSION >= 30
1476 glResumeTransformFeedback();
1477 #endif // DALI_GLES_VERSION >= 30
1480 void GetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)
1482 #if DALI_GLES_VERSION >= 30
1483 // if OpenGL ES 2.0 compatibility is need this can be implemented with
1484 // glGetProgramBinaryOES
1485 glGetProgramBinary(program,bufSize,length,binaryFormat,binary);
1487 mGlExtensions.GetProgramBinaryOES(program, bufSize, length, binaryFormat, binary);
1488 #endif // DALI_GLES_VERSION >= 30
1491 void ProgramBinary(GLuint program, GLenum binaryFormat, const GLvoid* binary, GLsizei length)
1493 #if DALI_GLES_VERSION >= 30
1494 // if OpenGL ES 2.0 compatibility is need this can be implemented with
1495 // glProgramBinaryOES
1496 glProgramBinary(program,binaryFormat,binary,length);
1498 mGlExtensions.ProgramBinaryOES(program, binaryFormat, binary, length);
1499 #endif // DALI_GLES_VERSION >= 30
1502 void ProgramParameteri(GLuint program, GLenum pname, GLint value)
1504 #if DALI_GLES_VERSION >= 30
1505 glProgramParameteri(program,pname,value);
1506 #endif // DALI_GLES_VERSION >= 30
1509 void InvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
1511 #if DALI_GLES_VERSION >= 30
1512 // if OpenGL ES 2.0 compatibility is need this can be implemented with
1513 // glDiscardFramebufferEXT
1514 glInvalidateFramebuffer(target,numAttachments,attachments);
1515 #endif // DALI_GLES_VERSION >= 30
1518 void InvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
1520 #if DALI_GLES_VERSION >= 30
1521 glInvalidateSubFramebuffer(target,numAttachments,attachments,x,y,width,height);
1522 #endif // DALI_GLES_VERSION >= 30
1525 void TexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
1527 #if DALI_GLES_VERSION >= 30
1528 glTexStorage2D(target,levels,internalformat,width,height);
1529 #endif // DALI_GLES_VERSION >= 30
1532 void TexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
1534 #if DALI_GLES_VERSION >= 30
1535 glTexStorage3D(target,levels,internalformat,width,height,depth);
1536 #endif // DALI_GLES_VERSION >= 30
1539 void GetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
1541 #if DALI_GLES_VERSION >= 30
1542 glGetInternalformativ(target,internalformat,pname,bufSize,params);
1543 #endif // DALI_GLES_VERSION >= 30
1547 ECoreX::GlExtensions mGlExtensions;
1551 } // namespace Adaptor
1553 } // namespace Internal
1557 #endif // __DALI_INTERNAL_GL_IMPLEMENTATION_H__