1 #ifndef __DALI_INTERNAL_GL_EXTENSION_H__
2 #define __DALI_INTERNAL_GL_EXTENSION_H__
5 * Copyright (c) 2014 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.
23 #if DALI_GLES_VERSION >= 30
24 #include <GLES3/gl3.h>
25 #include <GLES3/gl3ext.h>
27 #include <GLES2/gl2.h>
28 #include <GLES2/gl2ext.h>
45 * GlExtensions class provides GL extensions support
64 #if DALI_GLES_VERSION < 30
67 * If the GL extension is available this function discards specified data in attachments
68 * from being copied from the target to improve performance.
70 * Usage: GLenum attachments[] = { GL_DEPTH_ATTACHMENT, GL_STENCIL_ATTACHMENT };
71 * DiscardFrameBufferEXT(GL_FRAMEBUFFER, 2, attachments);
73 * @param target is usually GL_FRAMEBUFFER
74 * @param numAttachments is the count of attachments
75 * @param attachments is a pointer to the attachments
77 void DiscardFrameBuffer (GLenum target, GLsizei numAttachments, const GLenum *attachments);
81 * Returns the program object's executable bytecode.
82 * @param[in] program The program object's name/id
83 * @param[in] bufSize The maximum number of bytes that may be written into binary
84 * @param[out] length The actual number of bytes written into binary
85 * @param[out] binaryFormat The format of the program binary
86 * @param[out] binary The actual program bytecode
88 void GetProgramBinaryOES (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary);
92 * Loads a program object with a program binary previously returned from GetProgramBinaryOES
93 * @param[in] program The program object's name/id
94 * @param[in] binaryFormat The format of the program binary
95 * @param[in] binary The program bytecode
96 * @param[in] length The number of bytes in binary
98 void ProgramBinaryOES (GLuint program, GLenum binaryFormat, const GLvoid *binary, GLint length);
100 #endif // DALI_GLES_VERSION < 30
105 * Lazy Initialize extensions on first use
109 #if DALI_GLES_VERSION < 30
111 #ifdef GL_EXT_discard_framebuffer
112 PFNGLDISCARDFRAMEBUFFEREXTPROC mGlDiscardFramebuffer;
115 #ifdef GL_OES_get_program_binary
116 PFNGLGETPROGRAMBINARYOESPROC mGlGetProgramBinaryOES;
117 PFNGLPROGRAMBINARYOESPROC mGlProgramBinaryOES;
120 #endif // DALI_GLES_VERSION < 30
126 } // namespace ECoreX
128 } // namespace Adaptor
130 } // namespace Internal
134 #endif /* __DALI_INTERNAL_GL_EXTENSION_H__ */