summaryrefslogtreecommitdiff
path: root/src/lib/evas/Evas_GL.h
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
committerVincent Torri <vincent.torri@gmail.com>2012-11-04 11:51:42 +0000
commitc15e9c6575c3b5f39ded167dda5259de3de96151 (patch)
tree5115d7ae3620af24c2bc094cd062575af7adeda9 /src/lib/evas/Evas_GL.h
parenta5ac6a987caec5a7f7596a25d0a065b9cc94c50c (diff)
merge: and now Evas
I've tested make -j 3 install and it works nicely I've tested expedite with software and opengl xlib, and it works. Not tested other engines, so please report any problems (engines or other) on the ML. TODO: examples and tests, I'll add them later ISSUE: Eina_Unicode size check. It indirectly depends on eina_config.h, which is created at the end of the configure script. So its size is always 0. I don't know how that size is used, so I can't do a lot, for now. SVN revision: 78895
Diffstat (limited to 'src/lib/evas/Evas_GL.h')
-rw-r--r--src/lib/evas/Evas_GL.h1531
1 files changed, 1531 insertions, 0 deletions
diff --git a/src/lib/evas/Evas_GL.h b/src/lib/evas/Evas_GL.h
new file mode 100644
index 0000000000..e3a4e331d6
--- /dev/null
+++ b/src/lib/evas/Evas_GL.h
@@ -0,0 +1,1531 @@
1#ifndef _EVAS_GL_H
2#define _EVAS_GL_H
3
4#include <Evas.h>
5//#include <GL/gl.h>
6
7#ifdef __cplusplus
8extern "C" {
9#endif
10
11/**
12 * @defgroup Evas_GL Rendering GL on Evas
13 *
14 * Functions that are used to do OpenGL rendering on Evas. Evas allows you
15 * to use OpenGL to render to specially set up image objects (which act as
16 * render target surfaces).
17 *
18 * Below is an illlustrative example of how to use OpenGL to render to an
19 * object in Evas.
20 *
21 * @code
22// Simple Evas_GL example
23#include <Ecore_Evas.h>
24#include <Ecore.h>
25#include <Evas_GL.h>
26#include <stdio.h>
27
28// GL related data here..
29typedef struct _GLData
30{
31 Evas_GL_Context *ctx;
32 Evas_GL_Surface *sfc;
33 Evas_GL_Config *cfg;
34 Evas_GL *evasgl;
35 Evas_GL_API *glapi;
36 GLuint program;
37 GLuint vtx_shader;
38 GLuint fgmt_shader;
39 Eina_Bool initialized : 1;
40} GLData;
41
42// callbacks we want to handle deletion on the object and updates/draws
43static void on_del (void *data, Evas *e, Evas_Object *obj, void *event_info);
44static void on_pixels (void *data, Evas_Object *obj);
45// demo - animator just to keep ticking over saying to draw the image
46static Eina_Bool on_animate (void *data);
47// gl stuff
48static int init_shaders (GLData *gld);
49static GLuint load_shader (GLData *gld, GLenum type, const char *shader_src);
50
51int
52main(int argc, char **argv)
53{
54 // a size by default
55 int w = 256, h = 256;
56 // some variables we will use
57 Ecore_Evas *ee;
58 Evas *canvas;
59 Evas_Object *r1;
60 Evas_Native_Surface ns;
61 GLData *gld = NULL;
62
63 // regular low-leve EFL (ecore+ecore-evas) init. elm is simpler
64 ecore_init();
65 ecore_evas_init();
66 ee = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 512, 512);
67 ecore_evas_title_set(ee, "Ecore_Evas Template");
68 canvas = ecore_evas_get(ee);
69
70 // alloc a data struct to hold our relevant gl info in
71 if (!(gld = calloc(1, sizeof(GLData)))) return 0;
72
73 //-//-//-// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)
74 //-//
75 // get the evas gl handle for doing gl things
76 gld->evasgl = evas_gl_new(canvas);
77 gld->glapi = evas_gl_api_get(gld->evasgl);
78
79 // Set a surface config
80 gld->cfg = evas_gl_config_new();
81 gld->cfg->color_format = EVAS_GL_RGBA_8888;
82 //gld->cfg->depth_bits = EVAS_GL_DEPTH_NONE; // Othe config options
83 //gld->cfg->stencil_bits = EVAS_GL_STENCIL_NONE;
84 //gld->cfg->options_bits = EVAS_GL_OPTIONS_NONE;
85
86 // create a surface and context
87 gld->sfc = evas_gl_surface_create(gld->evasgl, gld->cfg, w, h);
88 gld->ctx = evas_gl_context_create(gld->evasgl, NULL);
89 //-//
90 //-//-//-// END GL INIT BLOB
91
92 // set up the image object. a filled one by default
93 r1 = evas_object_image_filled_add(canvas);
94 // attach important data we need to the object using key names. this just
95 // avoids some global variables and means we can do nice cleanup. you can
96 // avoid this if you are lazy
97 evas_object_data_set(r1, "..gld", gld);
98 // when the object is deleted - call the on_del callback. like the above,
99 // this is just being clean
100 evas_object_event_callback_add(r1, EVAS_CALLBACK_DEL, on_del, NULL);
101 // set up an actual pixel size fot the buffer data. it may be different
102 // to the output size. any windowing system has something like this, just
103 // evas has 2 sizes, a pixel size and the output object size
104 evas_object_image_size_set(r1, w, h);
105 // set up the native surface info to use the context and surface created
106 // above
107
108 //-//-//-// THIS IS WHERE GL INIT STUFF HAPPENS (ALA EGL)
109 //-//
110 evas_gl_native_surface_get(gld->evasgl, gld->sfc, &ns);
111 evas_object_image_native_surface_set(r1, &ns);
112 evas_object_image_pixels_get_callback_set(r1, on_pixels, r1);
113 //-//
114 //-//-//-// END GL INIT BLOB
115
116 // move the image object somewhere, resize it and show it. any windowing
117 // system would need this kind of thing - place a child "window"
118 evas_object_move(r1, 128, 128);
119 evas_object_resize(r1, w, h);
120 evas_object_show(r1);
121
122 // animating - just a demo. as long as you trigger an update on the image
123 // object via evas_object_image_pixels_dirty_set(). any display system,
124 // mainloop siztem etc. will have something of this kind unless it's making
125 // you spin infinitely yourself and invent your own animation mechanism
126 //
127 // NOTE: if you delete r1, this animator will keep running trying to access
128 // r1 so you'd better delete this animator with ecore_animator_del() or
129 // structure how you do animation differently. you can also attach it like
130 // evasgl, sfc, etc. etc. if this animator is specific to this object
131 // only and delete it in the del handler for the obj.
132 ecore_animator_add(on_animate, r1);
133
134 // finally show the window for the world to see. windowing system generic
135 ecore_evas_show(ee);
136
137 // begin the mainloop and tick over the animator, handle events etc.
138 // also windowing system generic
139 ecore_main_loop_begin();
140
141 // standard EFL shutdown stuff - generic for most systems, EFL or not
142 ecore_evas_shutdown();
143 ecore_shutdown();
144 return 0;
145}
146
147static void
148on_del(void *data, Evas *e, Evas_Object *obj, void *event_info)
149{
150 // on delete of our object clean up some things that don't get auto
151 // celeted for us as they are not intrinsically bound to the image
152 // object as such (you could use the same context and surface across
153 // multiple image objects and re-use the evasgl handle too multiple times.
154 // here we bind them to 1 object only though by doing this.
155 GLData *gld = evas_object_data_get(obj, "..gld");
156 if (!gld) return;
157 Evas_GL_API *gl = gld->glapi;
158
159 evas_object_data_del(obj, "..gld");
160
161 // Do a make_current before deleting all the GL stuff.
162 evas_gl_make_current(gld->evasgl, gld->sfc, gld->ctx);
163 gl->glDeleteShader(gld->vtx_shader);
164 gl->glDeleteShader(gld->fgmt_shader);
165 gl->glDeleteProgram(gld->program);
166
167 evas_gl_surface_destroy(gld->evasgl, gld->sfc);
168 evas_gl_context_destroy(gld->evasgl, gld->ctx);
169 evas_gl_config_free(gld->cfg);
170 evas_gl_free(gld->evasgl);
171 free(gld);
172}
173
174static void
175on_pixels(void *data, Evas_Object *obj)
176{
177 // get some variable we need from the object data keys
178 GLData *gld = evas_object_data_get(obj, "..gld");
179 if (!gld) return;
180 Evas_GL_API *gl = gld->glapi;
181 GLfloat vVertices[] =
182 {
183 0.0f, 0.5f, 0.0f,
184 -0.5f, -0.5f, 0.0f,
185 0.5f, -0.5f, 0.0f
186 };
187 int w, h;
188
189 // get the image size in case it changed with evas_object_image_size_set()
190 evas_object_image_size_get(obj, &w, &h);
191 // set up the context and surface as the current one
192 evas_gl_make_current(gld->evasgl, gld->sfc, gld->ctx);
193
194 if (!gld->initialized)
195 {
196 if (!init_shaders(gld)) printf("Error Initializing Shaders\n");
197 gld->initialized = EINA_TRUE;
198 }
199
200 // GL Viewport stuff. you can avoid doing this if viewport is all the
201 // same as last frame if you want
202 gl->glViewport(0, 0, w, h);
203
204 // Clear the buffer
205 gl->glClearColor(1.0, 0.0, 0.0, 1);
206 gl->glClear(GL_COLOR_BUFFER_BIT);
207
208 // Draw a Triangle
209 gl->glEnable(GL_BLEND);
210
211 gl->glUseProgram(gld->program);
212
213 gl->glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, vVertices);
214 gl->glEnableVertexAttribArray(0);
215
216 gl->glDrawArrays(GL_TRIANGLES, 0, 3);
217
218 // Optional - Flush the GL pipeline
219 gl->glFlush();
220}
221
222static Eina_Bool
223on_animate(void *data)
224{
225 // just a demo - animate here whenever an animation tick happens and then
226 // mark the image as "dirty" meaning it needs an update next time evas
227 // renders. it will call the pixel get callback then.
228 evas_object_image_pixels_dirty_set(data, EINA_TRUE);
229 return EINA_TRUE; // keep looping
230}
231
232static GLuint
233load_shader(GLData *gld, GLenum type, const char *shader_src)
234{
235 Evas_GL_API *gl = gld->glapi;
236 GLuint shader;
237 GLint compiled = 0;
238
239 // Create the shader object
240 if (!(shader = gl->glCreateShader(type))) return 0;
241 gl->glShaderSource(shader, 1, &shader_src, NULL);
242 // Compile the shader
243 gl->glCompileShader(shader);
244 gl->glGetShaderiv(shader, GL_COMPILE_STATUS, &compiled);
245
246 if (!compiled)
247 {
248 GLint len = 0;
249
250 gl->glGetShaderiv(shader, GL_INFO_LOG_LENGTH, &len);
251 if (len > 1)
252 {
253 char *info = malloc(sizeof(char) * len);
254
255 if (info)
256 {
257 gl->glGetShaderInfoLog(shader, len, NULL, info);
258 printf("Error compiling shader:\n"
259 "%s\n", info);
260 free(info);
261 }
262 }
263 gl->glDeleteShader(shader);
264 return 0;
265 }
266 return shader;
267}
268
269// Initialize the shader and program object
270static int
271init_shaders(GLData *gld)
272{
273 Evas_GL_API *gl = gld->glapi;
274 const char vShaderStr[] =
275 "attribute vec4 vPosition; \n"
276 "void main() \n"
277 "{ \n"
278 " gl_Position = vPosition; \n"
279 "} \n";
280 const char fShaderStr[] =
281 "precision mediump float; \n"
282 "void main() \n"
283 "{ \n"
284 " gl_FragColor = vec4( 1.0, 0.0, 0.0, 1.0 );\n"
285 "} \n";
286 GLint linked = 0;
287
288 // Load the vertex/fragment shaders
289 gld->vtx_shader = load_shader(gld, GL_VERTEX_SHADER, vShaderStr);
290 gld->fgmt_shader = load_shader(gld, GL_FRAGMENT_SHADER, fShaderStr);
291
292 // Create the program object
293 if (!(gld->program = gl->glCreateProgram())) return 0;
294
295 gl->glAttachShader(gld->program, gld->vtx_shader);
296 gl->glAttachShader(gld->program, gld->fgmt_shader);
297
298 // Bind vPosition to attribute 0
299 gl->glBindAttribLocation(gld->program, 0, "vPosition");
300 // Link the program
301 gl->glLinkProgram(gld->program);
302 gl->glGetProgramiv(gld->program, GL_LINK_STATUS, &linked);
303
304 if (!linked)
305 {
306 GLint len = 0;
307
308 gl->glGetProgramiv(gld->program, GL_INFO_LOG_LENGTH, &len);
309 if (len > 1)
310 {
311 char *info = malloc(sizeof(char) * len);
312
313 if (info)
314 {
315 gl->glGetProgramInfoLog(gld->program, len, NULL, info);
316 printf("Error linking program:\n"
317 "%s\n", info);
318 free(info);
319 }
320 }
321 gl->glDeleteProgram(gld->program);
322 return 0;
323 }
324 return 1;
325}
326 * @endcode
327 *
328 * @ingroup Evas_Canvas
329 */
330
331/**
332 * @addtogroup Evas_GL
333 * @{
334 */
335
336/**
337 * @typedef Evas_GL
338 *
339 * Evas GL Object for rendering gl in Evas.
340 */
341typedef struct _Evas_GL Evas_GL;
342
343/**
344 * @typedef Evas_GL_Surface
345 *
346 * Evas GL Surface object, a GL rendering target in Evas GL.
347 */
348typedef struct _Evas_GL_Surface Evas_GL_Surface;
349
350/**
351 * @typedef Evas_GL_Context
352 *
353 * Evas GL Context object, a GL rendering context in Evas GL.
354 */
355typedef struct _Evas_GL_Context Evas_GL_Context;
356
357/**
358 * @typedef Evas_GL_Config
359 *
360 * Evas GL Surface configuration object for surface creation.
361 */
362typedef struct _Evas_GL_Config Evas_GL_Config;
363
364/**
365 * @typedef Evas_GL_API
366 *
367 * Evas GL API object that contains the GL APIs to be used in Evas GL.
368 */
369typedef struct _Evas_GL_API Evas_GL_API;
370
371/**
372 * @typedef Evas_GL_Func
373 *
374 * Evas GL Function Object used as a function pointer.
375 */
376typedef void *Evas_GL_Func;
377
378/**
379 * @typedef EvasGLImage
380 *
381 * Evas GL Image Object used in Evas GL Image extension.
382 */
383typedef void *EvasGLImage;
384
385/**
386 * Surface Color Format
387 */
388typedef enum _Evas_GL_Color_Format
389{
390 EVAS_GL_RGB_888 = 0,
391 EVAS_GL_RGBA_8888 = 1
392} Evas_GL_Color_Format;
393
394/**
395 * Surface Depth Format
396 */
397typedef enum _Evas_GL_Depth_Bits
398{
399 EVAS_GL_DEPTH_NONE = 0,
400 EVAS_GL_DEPTH_BIT_8 = 1,
401 EVAS_GL_DEPTH_BIT_16 = 2,
402 EVAS_GL_DEPTH_BIT_24 = 3,
403 EVAS_GL_DEPTH_BIT_32 = 4
404} Evas_GL_Depth_Bits;
405
406/**
407 * Surface Stencil Format
408 */
409typedef enum _Evas_GL_Stencil_Bits
410{
411 EVAS_GL_STENCIL_NONE = 0,
412 EVAS_GL_STENCIL_BIT_1 = 1,
413 EVAS_GL_STENCIL_BIT_2 = 2,
414 EVAS_GL_STENCIL_BIT_4 = 3,
415 EVAS_GL_STENCIL_BIT_8 = 4,
416 EVAS_GL_STENCIL_BIT_16 = 5
417} Evas_GL_Stencil_Bits;
418
419/**
420 * Configuration Options.
421 *
422 * @since 1.1
423 */
424typedef enum _Evas_GL_Options_Bits
425{
426 EVAS_GL_OPTIONS_NONE = 0, /**< No extra options */
427 EVAS_GL_OPTIONS_DIRECT = (1<<0) /**< Optional hint to allow rendering directly to evas' window when possible */
428} Evas_GL_Options_Bits;
429
430/**
431 * Configuration Option for Multisample Anti-aliased (MSAA) rendering surface.
432 * Only works in supported device.
433 *
434 * @since 1.2
435 */
436typedef enum _Evas_GL_Multisample_Bits
437{
438 EVAS_GL_MULTISAMPLE_NONE = 0, /**< No multisample rendering */
439 EVAS_GL_MULTISAMPLE_LOW = 1, /**< MSAA with mininum number of samples */
440 EVAS_GL_MULTISAMPLE_MED = 2, /**< MSAA with half the number of max samples */
441 EVAS_GL_MULTISAMPLE_HIGH = 3 /**< MSAA with maximum allowed samples */
442} Evas_GL_Multisample_Bits;
443
444/**
445 * @struct _Evas_GL_Config
446 *
447 * Evas GL Surface configuration
448 */
449struct _Evas_GL_Config
450{
451 Evas_GL_Color_Format color_format; /**< Surface Color Format */
452 Evas_GL_Depth_Bits depth_bits; /**< Surface Depth Bits */
453 Evas_GL_Stencil_Bits stencil_bits; /**< Surface Stencil Bits */
454 Evas_GL_Options_Bits options_bits; /**< Extra Surface Options */
455 Evas_GL_Multisample_Bits multisample_bits; /**< Optional Surface MSAA Bits */
456};
457
458#define EVAS_GL_EXTENSIONS 1
459
460
461/**
462 * Creates a new Evas_GL object and returns a handle for gl rendering on efl.
463 *
464 * @param e The given evas canvas OpenGL is to be used on.
465 * @return The created evas_gl object, or NULl on fasilure.
466 */
467EAPI Evas_GL *evas_gl_new (Evas *e) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
468
469/**
470 * Frees the created Evas_GL object.
471 *
472 * @param evas_gl The given Evas_GL object.
473 */
474EAPI void evas_gl_free (Evas_GL *evas_gl) EINA_ARG_NONNULL(1);
475
476/**
477 * Allocates a new config object for the user to fill out.
478 *
479 * As long as the Evas creates a config object for the user, it takes care
480 * of the backward compatibility issue.
481 */
482EAPI Evas_GL_Config *evas_gl_config_new (void);
483
484/**
485 * Frees a config object created from evas_gl_config_new.
486 *
487 * As long as the Evas creates a config object for the user, it takes care
488 * of the backward compatibility issue.
489 */
490EAPI void evas_gl_config_free (Evas_GL_Config *cfg) EINA_ARG_NONNULL(1);
491
492/**
493 * Creates and returns new Evas_GL_Surface object for GL Rendering.
494 *
495 * @param evas_gl The given Evas_GL object.
496 * @param cfg The pixel format and configuration of the rendering surface.
497 * @param w The width of the surface.
498 * @param h The height of the surface.
499 * @return The created GL surface object, or NULL on failure.
500 */
501EAPI Evas_GL_Surface *evas_gl_surface_create (Evas_GL *evas_gl, Evas_GL_Config *cfg, int w, int h) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1,2);
502
503/**
504 * Destroys the created Evas GL Surface.
505 *
506 * @param evas_gl The given Evas_GL object.
507 * @param surf The given GL surface object.
508 */
509EAPI void evas_gl_surface_destroy (Evas_GL *evas_gl, Evas_GL_Surface *surf) EINA_ARG_NONNULL(1,2);
510
511/**
512 * Creates and returns a new Evas GL context object
513 *
514 * @param evas_gl The given Evas_GL object.
515 * @return The created context, or NULL on failure.
516 */
517EAPI Evas_GL_Context *evas_gl_context_create (Evas_GL *evas_gl, Evas_GL_Context *share_ctx) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1);
518
519/**
520 * Destroys the given Evas GL context object
521 *
522 * @param evas_gl The given Evas_GL object.
523 * @param ctx The given Evas GL context.
524 */
525EAPI void evas_gl_context_destroy (Evas_GL *evas_gl, Evas_GL_Context *ctx) EINA_ARG_NONNULL(1,2);
526
527/**
528 * Sets the given context as a current context for the given surface
529 *
530 * @param evas_gl The given Evas_GL object.
531 * @param surf The given Evas GL surface.
532 * @param ctx The given Evas GL context.
533 * @return @c EINA_TRUE if successful, @c EINA_FALSE if not.
534 */
535EAPI Eina_Bool evas_gl_make_current (Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_GL_Context *ctx) EINA_ARG_NONNULL(1,2);
536
537/**
538 * Returns a pointer to a static, zero-terminated string describing some aspect of evas_gl.
539 *
540 * @param evas_gl The given Evas_GL object.
541 * @param name Specifies a symbolic constant, one of EVAS_GL_EXTENSIONS...
542 */
543EAPI const char *evas_gl_string_query (Evas_GL *evas_gl, int name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1) EINA_PURE;
544
545/**
546 * Returns a GL or the Glue Layer's extension function.
547 *
548 * @param evas_gl The given Evas_GL object.
549 * @param name The name of the function to return.
550 */
551EAPI Evas_GL_Func evas_gl_proc_address_get (Evas_GL *evas_gl, const char *name) EINA_WARN_UNUSED_RESULT EINA_ARG_NONNULL(1,2) EINA_PURE;
552
553/**
554 * Fills in the Native Surface information from the given Evas GL surface.
555 *
556 * @param evas_gl The given Evas_GL object.
557 * @param surf The given Evas GL surface to retrieve the Native Surface info from.
558 * @param ns The native surface structure that the function fills in.
559 * @return @c EINA_TRUE if successful, @c EINA_FALSE if not.
560 */
561EAPI Eina_Bool evas_gl_native_surface_get (Evas_GL *evas_gl, Evas_GL_Surface *surf, Evas_Native_Surface *ns) EINA_ARG_NONNULL(1,2,3);
562
563/**
564 * Get the API for rendering using OpenGL
565 *
566 * @param evas_gl The given Eva_GL object.
567 * @return The API to use.
568 *
569 * This returns a structure that contains all the OpenGL functions you can
570 * use to render in Evas. These functions consist of all the standard
571 * OpenGL-ES2.0 functions and any extra ones Evas has decided to provide in
572 * addition. This means that if you have your code ported to OpenGL-ES2.0,
573 * it will be easy to render to Evas.
574 *
575 */
576EAPI Evas_GL_API *evas_gl_api_get (Evas_GL *evas_gl) EINA_ARG_NONNULL(1);
577
578#if !defined(__gl_h_) && !defined(__gl2_h_)
579# define __gl_h_
580# define __gl2_h_
581
582/*
583 * This document is licensed under the SGI Free Software B License Version
584 * 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
585 */
586
587/*-------------------------------------------------------------------------
588 * Data type definitions
589 *-----------------------------------------------------------------------*/
590
591typedef void GLvoid;
592typedef char GLchar;
593typedef unsigned int GLenum;
594typedef unsigned char GLboolean;
595typedef unsigned int GLbitfield;
596typedef signed char GLbyte; // Changed khronos_int8_t
597typedef short GLshort;
598typedef int GLint;
599typedef int GLsizei;
600typedef unsigned char GLubyte; // Changed khronos_uint8_t
601typedef unsigned short GLushort;
602typedef unsigned int GLuint;
603typedef float GLfloat; // Changed khronos_float_t
604typedef float GLclampf; // Changed khronos_float_t
605typedef signed int GLfixed; // Changed khronos_int32_t
606
607/* GL types for handling large vertex buffer objects */
608typedef signed long int GLintptr; // Changed khronos_intptr_t
609typedef signed long int GLsizeiptr; // Changed khronos_ssize_t
610
611//#if (!defined(__gl2_h_) && !defined(__gl_h_))
612
613/* OpenGL ES core versions */
614//#define GL_ES_VERSION_2_0 1
615
616/* ClearBufferMask */
617#define GL_DEPTH_BUFFER_BIT 0x00000100
618#define GL_STENCIL_BUFFER_BIT 0x00000400
619#define GL_COLOR_BUFFER_BIT 0x00004000
620
621/* Boolean */
622#define GL_FALSE 0
623#define GL_TRUE 1
624
625/* BeginMode */
626#define GL_POINTS 0x0000
627#define GL_LINES 0x0001
628#define GL_LINE_LOOP 0x0002
629#define GL_LINE_STRIP 0x0003
630#define GL_TRIANGLES 0x0004
631#define GL_TRIANGLE_STRIP 0x0005
632#define GL_TRIANGLE_FAN 0x0006
633
634/* AlphaFunction (not supported in ES20) */
635/* GL_NEVER */
636/* GL_LESS */
637/* GL_EQUAL */
638/* GL_LEQUAL */
639/* GL_GREATER */
640/* GL_NOTEQUAL */
641/* GL_GEQUAL */
642/* GL_ALWAYS */
643
644/* BlendingFactorDest */
645#define GL_ZERO 0
646#define GL_ONE 1
647#define GL_SRC_COLOR 0x0300
648#define GL_ONE_MINUS_SRC_COLOR 0x0301
649#define GL_SRC_ALPHA 0x0302
650#define GL_ONE_MINUS_SRC_ALPHA 0x0303
651#define GL_DST_ALPHA 0x0304
652#define GL_ONE_MINUS_DST_ALPHA 0x0305
653
654/* BlendingFactorSrc */
655/* GL_ZERO */
656/* GL_ONE */
657#define GL_DST_COLOR 0x0306
658#define GL_ONE_MINUS_DST_COLOR 0x0307
659#define GL_SRC_ALPHA_SATURATE 0x0308
660/* GL_SRC_ALPHA */
661/* GL_ONE_MINUS_SRC_ALPHA */
662/* GL_DST_ALPHA */
663/* GL_ONE_MINUS_DST_ALPHA */
664
665/* BlendEquationSeparate */
666#define GL_FUNC_ADD 0x8006
667#define GL_BLEND_EQUATION 0x8009
668#define GL_BLEND_EQUATION_RGB 0x8009 /* same as BLEND_EQUATION */
669#define GL_BLEND_EQUATION_ALPHA 0x883D
670
671/* BlendSubtract */
672#define GL_FUNC_SUBTRACT 0x800A
673#define GL_FUNC_REVERSE_SUBTRACT 0x800B
674
675/* Separate Blend Functions */
676#define GL_BLEND_DST_RGB 0x80C8
677#define GL_BLEND_SRC_RGB 0x80C9
678#define GL_BLEND_DST_ALPHA 0x80CA
679#define GL_BLEND_SRC_ALPHA 0x80CB
680#define GL_CONSTANT_COLOR 0x8001
681#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
682#define GL_CONSTANT_ALPHA 0x8003
683#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
684#define GL_BLEND_COLOR 0x8005
685
686/* Buffer Objects */
687#define GL_ARRAY_BUFFER 0x8892
688#define GL_ELEMENT_ARRAY_BUFFER 0x8893
689#define GL_ARRAY_BUFFER_BINDING 0x8894
690#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
691
692#define GL_STREAM_DRAW 0x88E0
693#define GL_STATIC_DRAW 0x88E4
694#define GL_DYNAMIC_DRAW 0x88E8
695
696#define GL_BUFFER_SIZE 0x8764
697#define GL_BUFFER_USAGE 0x8765
698
699#define GL_CURRENT_VERTEX_ATTRIB 0x8626
700
701/* CullFaceMode */
702#define GL_FRONT 0x0404
703#define GL_BACK 0x0405
704#define GL_FRONT_AND_BACK 0x0408
705
706/* DepthFunction */
707/* GL_NEVER */
708/* GL_LESS */
709/* GL_EQUAL */
710/* GL_LEQUAL */
711/* GL_GREATER */
712/* GL_NOTEQUAL */
713/* GL_GEQUAL */
714/* GL_ALWAYS */
715
716/* EnableCap */
717#define GL_TEXTURE_2D 0x0DE1
718#define GL_CULL_FACE 0x0B44
719#define GL_BLEND 0x0BE2
720#define GL_DITHER 0x0BD0
721#define GL_STENCIL_TEST 0x0B90
722#define GL_DEPTH_TEST 0x0B71
723#define GL_SCISSOR_TEST 0x0C11
724#define GL_POLYGON_OFFSET_FILL 0x8037
725#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
726#define GL_SAMPLE_COVERAGE 0x80A0
727
728/* ErrorCode */
729#define GL_NO_ERROR 0
730#define GL_INVALID_ENUM 0x0500
731#define GL_INVALID_VALUE 0x0501
732#define GL_INVALID_OPERATION 0x0502
733#define GL_OUT_OF_MEMORY 0x0505
734
735/* FrontFaceDirection */
736#define GL_CW 0x0900
737#define GL_CCW 0x0901
738
739/* GetPName */
740#define GL_LINE_WIDTH 0x0B21
741#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
742#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
743#define GL_CULL_FACE_MODE 0x0B45
744#define GL_FRONT_FACE 0x0B46
745#define GL_DEPTH_RANGE 0x0B70
746#define GL_DEPTH_WRITEMASK 0x0B72
747#define GL_DEPTH_CLEAR_VALUE 0x0B73
748#define GL_DEPTH_FUNC 0x0B74
749#define GL_STENCIL_CLEAR_VALUE 0x0B91
750#define GL_STENCIL_FUNC 0x0B92
751#define GL_STENCIL_FAIL 0x0B94
752#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
753#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
754#define GL_STENCIL_REF 0x0B97
755#define GL_STENCIL_VALUE_MASK 0x0B93
756#define GL_STENCIL_WRITEMASK 0x0B98
757#define GL_STENCIL_BACK_FUNC 0x8800
758#define GL_STENCIL_BACK_FAIL 0x8801
759#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
760#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
761#define GL_STENCIL_BACK_REF 0x8CA3
762#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
763#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
764#define GL_VIEWPORT 0x0BA2
765#define GL_SCISSOR_BOX 0x0C10
766/* GL_SCISSOR_TEST */
767#define GL_COLOR_CLEAR_VALUE 0x0C22
768#define GL_COLOR_WRITEMASK 0x0C23
769#define GL_UNPACK_ALIGNMENT 0x0CF5
770#define GL_PACK_ALIGNMENT 0x0D05
771#define GL_MAX_TEXTURE_SIZE 0x0D33
772#define GL_MAX_VIEWPORT_DIMS 0x0D3A
773#define GL_SUBPIXEL_BITS 0x0D50
774#define GL_RED_BITS 0x0D52
775#define GL_GREEN_BITS 0x0D53
776#define GL_BLUE_BITS 0x0D54
777#define GL_ALPHA_BITS 0x0D55
778#define GL_DEPTH_BITS 0x0D56
779#define GL_STENCIL_BITS 0x0D57
780#define GL_POLYGON_OFFSET_UNITS 0x2A00
781/* GL_POLYGON_OFFSET_FILL */
782#define GL_POLYGON_OFFSET_FACTOR 0x8038
783#define GL_TEXTURE_BINDING_2D 0x8069
784#define GL_SAMPLE_BUFFERS 0x80A8
785#define GL_SAMPLES 0x80A9
786#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
787#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
788
789/* GetTextureParameter */
790/* GL_TEXTURE_MAG_FILTER */
791/* GL_TEXTURE_MIN_FILTER */
792/* GL_TEXTURE_WRAP_S */
793/* GL_TEXTURE_WRAP_T */
794
795#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
796#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
797
798/* HintMode */
799#define GL_DONT_CARE 0x1100
800#define GL_FASTEST 0x1101
801#define GL_NICEST 0x1102
802
803/* HintTarget */
804#define GL_GENERATE_MIPMAP_HINT 0x8192
805
806/* DataType */
807#define GL_BYTE 0x1400
808#define GL_UNSIGNED_BYTE 0x1401
809#define GL_SHORT 0x1402
810#define GL_UNSIGNED_SHORT 0x1403
811#define GL_INT 0x1404
812#define GL_UNSIGNED_INT 0x1405
813#define GL_FLOAT 0x1406
814#define GL_FIXED 0x140C
815
816/* PixelFormat */
817#define GL_DEPTH_COMPONENT 0x1902
818#define GL_ALPHA 0x1906
819#define GL_RGB 0x1907
820#define GL_RGBA 0x1908
821#define GL_LUMINANCE 0x1909
822#define GL_LUMINANCE_ALPHA 0x190A
823
824/* PixelType */
825/* GL_UNSIGNED_BYTE */
826#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
827#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
828#define GL_UNSIGNED_SHORT_5_6_5 0x8363
829
830/* Shaders */
831#define GL_FRAGMENT_SHADER 0x8B30
832#define GL_VERTEX_SHADER 0x8B31
833#define GL_MAX_VERTEX_ATTRIBS 0x8869
834#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
835#define GL_MAX_VARYING_VECTORS 0x8DFC
836#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
837#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
838#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
839#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
840#define GL_SHADER_TYPE 0x8B4F
841#define GL_DELETE_STATUS 0x8B80
842#define GL_LINK_STATUS 0x8B82
843#define GL_VALIDATE_STATUS 0x8B83
844#define GL_ATTACHED_SHADERS 0x8B85
845#define GL_ACTIVE_UNIFORMS 0x8B86
846#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
847#define GL_ACTIVE_ATTRIBUTES 0x8B89
848#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
849#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
850#define GL_CURRENT_PROGRAM 0x8B8D
851
852/* StencilFunction */
853#define GL_NEVER 0x0200
854#define GL_LESS 0x0201
855#define GL_EQUAL 0x0202
856#define GL_LEQUAL 0x0203
857#define GL_GREATER 0x0204
858#define GL_NOTEQUAL 0x0205
859#define GL_GEQUAL 0x0206
860#define GL_ALWAYS 0x0207
861
862/* StencilOp */
863/* GL_ZERO */
864#define GL_KEEP 0x1E00
865#define GL_REPLACE 0x1E01
866#define GL_INCR 0x1E02
867#define GL_DECR 0x1E03
868#define GL_INVERT 0x150A
869#define GL_INCR_WRAP 0x8507
870#define GL_DECR_WRAP 0x8508
871
872/* StringName */
873#define GL_VENDOR 0x1F00
874#define GL_RENDERER 0x1F01
875#define GL_VERSION 0x1F02
876#define GL_EXTENSIONS 0x1F03
877
878/* TextureMagFilter */
879#define GL_NEAREST 0x2600
880#define GL_LINEAR 0x2601
881
882/* TextureMinFilter */
883/* GL_NEAREST */
884/* GL_LINEAR */
885#define GL_NEAREST_MIPMAP_NEAREST 0x2700
886#define GL_LINEAR_MIPMAP_NEAREST 0x2701
887#define GL_NEAREST_MIPMAP_LINEAR 0x2702
888#define GL_LINEAR_MIPMAP_LINEAR 0x2703
889
890/* TextureParameterName */
891#define GL_TEXTURE_MAG_FILTER 0x2800
892#define GL_TEXTURE_MIN_FILTER 0x2801
893#define GL_TEXTURE_WRAP_S 0x2802
894#define GL_TEXTURE_WRAP_T 0x2803
895
896/* TextureTarget */
897/* GL_TEXTURE_2D */
898#define GL_TEXTURE 0x1702
899
900#define GL_TEXTURE_CUBE_MAP 0x8513
901#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
902#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
903#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
904#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
905#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
906#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
907#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
908#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
909
910/* TextureUnit */
911#define GL_TEXTURE0 0x84C0
912#define GL_TEXTURE1 0x84C1
913#define GL_TEXTURE2 0x84C2
914#define GL_TEXTURE3 0x84C3
915#define GL_TEXTURE4 0x84C4
916#define GL_TEXTURE5 0x84C5
917#define GL_TEXTURE6 0x84C6
918#define GL_TEXTURE7 0x84C7
919#define GL_TEXTURE8 0x84C8
920#define GL_TEXTURE9 0x84C9
921#define GL_TEXTURE10 0x84CA
922#define GL_TEXTURE11 0x84CB
923#define GL_TEXTURE12 0x84CC
924#define GL_TEXTURE13 0x84CD
925#define GL_TEXTURE14 0x84CE
926#define GL_TEXTURE15 0x84CF
927#define GL_TEXTURE16 0x84D0
928#define GL_TEXTURE17 0x84D1
929#define GL_TEXTURE18 0x84D2
930#define GL_TEXTURE19 0x84D3
931#define GL_TEXTURE20 0x84D4
932#define GL_TEXTURE21 0x84D5
933#define GL_TEXTURE22 0x84D6
934#define GL_TEXTURE23 0x84D7
935#define GL_TEXTURE24 0x84D8
936#define GL_TEXTURE25 0x84D9
937#define GL_TEXTURE26 0x84DA
938#define GL_TEXTURE27 0x84DB
939#define GL_TEXTURE28 0x84DC
940#define GL_TEXTURE29 0x84DD
941#define GL_TEXTURE30 0x84DE
942#define GL_TEXTURE31 0x84DF
943#define GL_ACTIVE_TEXTURE 0x84E0
944
945/* TextureWrapMode */
946#define GL_REPEAT 0x2901
947#define GL_CLAMP_TO_EDGE 0x812F
948#define GL_MIRRORED_REPEAT 0x8370
949
950/* Uniform Types */
951#define GL_FLOAT_VEC2 0x8B50
952#define GL_FLOAT_VEC3 0x8B51
953#define GL_FLOAT_VEC4 0x8B52
954#define GL_INT_VEC2 0x8B53
955#define GL_INT_VEC3 0x8B54
956#define GL_INT_VEC4 0x8B55
957#define GL_BOOL 0x8B56
958#define GL_BOOL_VEC2 0x8B57
959#define GL_BOOL_VEC3 0x8B58
960#define GL_BOOL_VEC4 0x8B59
961#define GL_FLOAT_MAT2 0x8B5A
962#define GL_FLOAT_MAT3 0x8B5B
963#define GL_FLOAT_MAT4 0x8B5C
964#define GL_SAMPLER_2D 0x8B5E
965#define GL_SAMPLER_CUBE 0x8B60
966
967/* Vertex Arrays */
968#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
969#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
970#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
971#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
972#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
973#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
974#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
975
976/* Read Format */
977#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
978#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
979
980/* Shader Source */
981#define GL_COMPILE_STATUS 0x8B81
982#define GL_INFO_LOG_LENGTH 0x8B84
983#define GL_SHADER_SOURCE_LENGTH 0x8B88
984#define GL_SHADER_COMPILER 0x8DFA
985
986/* Shader Binary */
987#define GL_SHADER_BINARY_FORMATS 0x8DF8
988#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
989
990/* Shader Precision-Specified Types */
991#define GL_LOW_FLOAT 0x8DF0
992#define GL_MEDIUM_FLOAT 0x8DF1
993#define GL_HIGH_FLOAT 0x8DF2
994#define GL_LOW_INT 0x8DF3
995#define GL_MEDIUM_INT 0x8DF4
996#define GL_HIGH_INT 0x8DF5
997
998/* Framebuffer Object. */
999#define GL_FRAMEBUFFER 0x8D40
1000#define GL_RENDERBUFFER 0x8D41
1001
1002#define GL_RGBA4 0x8056
1003#define GL_RGB5_A1 0x8057
1004#define GL_RGB565 0x8D62
1005#define GL_DEPTH_COMPONENT16 0x81A5
1006#define GL_STENCIL_INDEX 0x1901
1007#define GL_STENCIL_INDEX8 0x8D48
1008
1009#define GL_RENDERBUFFER_WIDTH 0x8D42
1010#define GL_RENDERBUFFER_HEIGHT 0x8D43
1011#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
1012#define GL_RENDERBUFFER_RED_SIZE 0x8D50
1013#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
1014#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
1015#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
1016#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
1017#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
1018
1019#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
1020#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
1021#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
1022#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
1023
1024#define GL_COLOR_ATTACHMENT0 0x8CE0
1025#define GL_DEPTH_ATTACHMENT 0x8D00
1026#define GL_STENCIL_ATTACHMENT 0x8D20
1027
1028#define GL_NONE 0
1029
1030#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
1031#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
1032#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
1033#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
1034#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
1035
1036#define GL_FRAMEBUFFER_BINDING 0x8CA6
1037#define GL_RENDERBUFFER_BINDING 0x8CA7
1038#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
1039
1040#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
1041
1042#else
1043# ifndef EVAS_GL_NO_GL_H_CHECK
1044# error "You may only include either Evas_GL.h OR use your native OpenGL's headers. If you use Evas to do GL, then you cannot use the native gl headers."
1045# endif
1046#endif
1047
1048
1049#if !defined(__glext_h_) && !defined(__gl2ext_h_)
1050# define __glext_h_
1051# define __gl2ext_h_
1052
1053//---------------------------//
1054// GLES extension defines
1055
1056/* GL_OES_compressed_ETC1_RGB8_texture */
1057#define GL_ETC1_RGB8_OES 0x8D64
1058
1059/* GL_OES_compressed_paletted_texture */
1060#define GL_PALETTE4_RGB8_OES 0x8B90
1061#define GL_PALETTE4_RGBA8_OES 0x8B91
1062#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
1063#define GL_PALETTE4_RGBA4_OES 0x8B93
1064#define GL_PALETTE4_RGB5_A1_OES 0x8B94
1065#define GL_PALETTE8_RGB8_OES 0x8B95
1066#define GL_PALETTE8_RGBA8_OES 0x8B96
1067#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
1068#define GL_PALETTE8_RGBA4_OES 0x8B98
1069#define GL_PALETTE8_RGB5_A1_OES 0x8B99
1070
1071/* GL_OES_depth24 */
1072#define GL_DEPTH_COMPONENT24_OES 0x81A6
1073
1074/* GL_OES_depth32 */
1075#define GL_DEPTH_COMPONENT32_OES 0x81A7
1076
1077/* GL_OES_get_program_binary */
1078#define GL_PROGRAM_BINARY_LENGTH_OES 0x8741
1079#define GL_NUM_PROGRAM_BINARY_FORMATS_OES 0x87FE
1080#define GL_PROGRAM_BINARY_FORMATS_OES 0x87FF
1081
1082/* GL_OES_mapbuffer */
1083#define GL_WRITE_ONLY_OES 0x88B9
1084#define GL_BUFFER_ACCESS_OES 0x88BB
1085#define GL_BUFFER_MAPPED_OES 0x88BC
1086#define GL_BUFFER_MAP_POINTER_OES 0x88BD
1087
1088/* GL_OES_packed_depth_stencil */
1089#define GL_DEPTH_STENCIL_OES 0x84F9
1090#define GL_UNSIGNED_INT_24_8_OES 0x84FA
1091#define GL_DEPTH24_STENCIL8_OES 0x88F0
1092
1093/* GL_OES_rgb8_rgba8 */
1094#define GL_RGB8_OES 0x8051
1095#define GL_RGBA8_OES 0x8058
1096
1097/* GL_OES_standard_derivatives */
1098#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_OES 0x8B8B
1099
1100/* GL_OES_stencil1 */
1101#define GL_STENCIL_INDEX1_OES 0x8D46
1102
1103/* GL_OES_stencil4 */
1104#define GL_STENCIL_INDEX4_OES 0x8D47
1105
1106/* GL_OES_texture_3D */
1107#define GL_TEXTURE_WRAP_R_OES 0x8072
1108#define GL_TEXTURE_3D_OES 0x806F
1109#define GL_TEXTURE_BINDING_3D_OES 0x806A
1110#define GL_MAX_3D_TEXTURE_SIZE_OES 0x8073
1111#define GL_SAMPLER_3D_OES 0x8B5F
1112#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_OES 0x8CD4
1113
1114/* GL_OES_texture_float */
1115/* No new tokens introduced by this extension. */
1116
1117/* GL_OES_texture_float_linear */
1118/* No new tokens introduced by this extension. */
1119
1120/* GL_OES_texture_half_float */
1121#define GL_HALF_FLOAT_OES 0x8D61
1122
1123/* GL_OES_texture_half_float_linear */
1124/* No new tokens introduced by this extension. */
1125
1126/* GL_OES_texture_npot */
1127/* No new tokens introduced by this extension. */
1128
1129/* GL_OES_vertex_half_float */
1130/* GL_HALF_FLOAT_OES defined in GL_OES_texture_half_float already. */
1131
1132/* GL_OES_vertex_type_10_10_10_2 */
1133#define GL_UNSIGNED_INT_10_10_10_2_OES 0x8DF6
1134#define GL_INT_10_10_10_2_OES 0x8DF7
1135
1136/*------------------------------------------------------------------------*
1137 * AMD extension tokens
1138 *------------------------------------------------------------------------*/
1139
1140/* GL_AMD_compressed_3DC_texture */
1141#define GL_3DC_X_AMD 0x87F9
1142#define GL_3DC_XY_AMD 0x87FA
1143
1144/* GL_AMD_compressed_ATC_texture */
1145#define GL_ATC_RGB_AMD 0x8C92
1146#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
1147#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
1148
1149/* GL_AMD_performance_monitor */
1150#define GL_COUNTER_TYPE_AMD 0x8BC0
1151#define GL_COUNTER_RANGE_AMD 0x8BC1
1152#define GL_UNSIGNED_INT64_AMD 0x8BC2
1153#define GL_PERCENTAGE_AMD 0x8BC3
1154#define GL_PERFMON_RESULT_AVAILABLE_AMD 0x8BC4
1155#define GL_PERFMON_RESULT_SIZE_AMD 0x8BC5
1156#define GL_PERFMON_RESULT_AMD 0x8BC6
1157
1158/* GL_AMD_program_binary_Z400 */
1159#define GL_Z400_BINARY_AMD 0x8740
1160
1161/*------------------------------------------------------------------------*
1162 * EXT extension tokens
1163 *------------------------------------------------------------------------*/
1164
1165/* GL_EXT_blend_minmax */
1166#define GL_MIN_EXT 0x8007
1167#define GL_MAX_EXT 0x8008
1168
1169/* GL_EXT_discard_framebuffer */
1170#define GL_COLOR_EXT 0x1800
1171#define GL_DEPTH_EXT 0x1801
1172#define GL_STENCIL_EXT 0x1802
1173
1174/* GL_EXT_multi_draw_arrays */
1175/* No new tokens introduced by this extension. */
1176
1177/* GL_EXT_read_format_bgra */
1178#define GL_BGRA_EXT 0x80E1
1179#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
1180#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
1181
1182/* GL_EXT_texture_filter_anisotropic */
1183#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
1184#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
1185
1186/* GL_EXT_texture_format_BGRA8888 */
1187#define GL_BGRA_EXT 0x80E1
1188
1189/* GL_EXT_texture_type_2_10_10_10_REV */
1190#define GL_UNSIGNED_INT_2_10_10_10_REV_EXT 0x8368
1191
1192/*------------------------------------------------------------------------*
1193 * IMG extension tokens
1194 *------------------------------------------------------------------------*/
1195
1196/* GL_IMG_program_binary */
1197#define GL_SGX_PROGRAM_BINARY_IMG 0x9130
1198
1199/* GL_IMG_read_format */
1200#define GL_BGRA_IMG 0x80E1
1201#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
1202
1203/* GL_IMG_shader_binary */
1204#define GL_SGX_BINARY_IMG 0x8C0A
1205
1206/* GL_IMG_texture_compression_pvrtc */
1207#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
1208#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
1209#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
1210#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
1211
1212/* GL_IMG_multisampled_render_to_texture */
1213#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
1214#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
1215#define GL_MAX_SAMPLES_IMG 0x9135
1216#define GL_TEXTURE_SAMPLES_IMG 0x9136
1217
1218/*------------------------------------------------------------------------*
1219 * NV extension tokens
1220 *------------------------------------------------------------------------*/
1221
1222/* GL_NV_fence */
1223#define GL_ALL_COMPLETED_NV 0x84F2
1224#define GL_FENCE_STATUS_NV 0x84F3
1225#define GL_FENCE_CONDITION_NV 0x84F4
1226
1227/*------------------------------------------------------------------------*
1228 * QCOM extension tokens
1229 *------------------------------------------------------------------------*/
1230
1231/* GL_QCOM_driver_control */
1232/* No new tokens introduced by this extension. */
1233
1234/* GL_QCOM_extended_get */
1235#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
1236#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
1237#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
1238#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
1239#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
1240#define GL_TEXTURE_TYPE_QCOM 0x8BD7
1241#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
1242#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
1243#define GL_TEXTURE_TARGET_QCOM 0x8BDA
1244#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
1245#define GL_STATE_RESTORE 0x8BDC
1246
1247/* GL_QCOM_extended_get2 */
1248/* No new tokens introduced by this extension. */
1249
1250/* GL_QCOM_perfmon_global_mode */
1251#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
1252
1253/* GL_QCOM_writeonly_rendering */
1254#define GL_WRITEONLY_RENDERING_QCOM 0x8823
1255
1256/*------------------------------------------------------------------------*
1257 * End of extension tokens, start of corresponding extension functions
1258 *------------------------------------------------------------------------*/
1259
1260/* EvasGL_KHR_image */
1261#define EVAS_GL_NATIVE_PIXMAP 0x30B0 /* evasglCreateImage target */
1262
1263/* EvasGL_KHR_vg_parent_image */
1264#define EVAS_VG_PARENT_IMAGE 0x30BA /* evasglCreateImage target */
1265
1266/* EvasGL_KHR_gl_texture_2D_image */
1267#define EVAS_GL_TEXTURE_2D 0x30B1 /* evasglCreateImage target */
1268#define EVAS_GL_TEXTURE_LEVEL 0x30BC /* evasglCreateImage attribute */
1269
1270/* EvasGL_KHR_gl_texture_cubemap_image */
1271#define EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3 /* evasglCreateImage target */
1272#define EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4 /* evasglCreateImage target */
1273#define EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5 /* evasglCreateImage target */
1274#define EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6 /* evasglCreateImage target */
1275#define EVAS_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7 /* evasglCreateImage target */
1276#define EVAS_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8 /* evasglCreateImage target */
1277
1278/* EvasGL_KHR_gl_texture_3D_image */
1279#define EVAS_GL_TEXTURE_3D 0x30B2 /* evasglCreateImage target */
1280#define EVAS_GL_TEXTURE_ZOFFSET 0x30BD /* evasglCreateImage attribute */
1281
1282/* EvasGL_KHR_gl_renderbuffer_image */
1283#define EVAS_GL_RENDERBUFFER 0x30B9 /* evasglCreateImage target */
1284
1285#else
1286# ifndef EVAS_GL_NO_GL_H_CHECK
1287# error "You may only include either Evas_GL.h OR use your native OpenGL's headers. If you use Evas to do GL, then you cannot use the native gl headers."
1288# endif
1289#endif
1290
1291#define EVAS_GL_API_VERSION 1
1292struct _Evas_GL_API
1293{
1294 int version;
1295
1296 /* version 1: */
1297 /*------- GLES 2.0 -------*/
1298 void (*glActiveTexture) (GLenum texture);
1299 void (*glAttachShader) (GLuint program, GLuint shader);
1300 void (*glBindAttribLocation) (GLuint program, GLuint index, const char* name);
1301 void (*glBindBuffer) (GLenum target, GLuint buffer);
1302 void (*glBindFramebuffer) (GLenum target, GLuint framebuffer);
1303 void (*glBindRenderbuffer) (GLenum target, GLuint renderbuffer);
1304 void (*glBindTexture) (GLenum target, GLuint texture);
1305 void (*glBlendColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1306 void (*glBlendEquation) ( GLenum mode );
1307 void (*glBlendEquationSeparate) (GLenum modeRGB, GLenum modeAlpha);
1308 void (*glBlendFunc) (GLenum sfactor, GLenum dfactor);
1309 void (*glBlendFuncSeparate) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
1310 void (*glBufferData) (GLenum target, GLsizeiptr size, const void* data, GLenum usage);
1311 void (*glBufferSubData) (GLenum target, GLintptr offset, GLsizeiptr size, const void* data);
1312 GLenum (*glCheckFramebufferStatus) (GLenum target);
1313 void (*glClear) (GLbitfield mask);
1314 void (*glClearColor) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha);
1315 void (*glClearDepthf) (GLclampf depth);
1316 void (*glClearStencil) (GLint s);
1317 void (*glColorMask) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
1318 void (*glCompileShader) (GLuint shader);
1319 void (*glCompressedTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void* data);
1320 void (*glCompressedTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void* data);
1321 void (*glCopyTexImage2D) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
1322 void (*glCopyTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1323 GLuint (*glCreateProgram) (void);
1324 GLuint (*glCreateShader) (GLenum type);
1325 void (*glCullFace) (GLenum mode);
1326 void (*glDeleteBuffers) (GLsizei n, const GLuint* buffers);
1327 void (*glDeleteFramebuffers) (GLsizei n, const GLuint* framebuffers);
1328 void (*glDeleteProgram) (GLuint program);
1329 void (*glDeleteRenderbuffers) (GLsizei n, const GLuint* renderbuffers);
1330 void (*glDeleteShader) (GLuint shader);
1331 void (*glDeleteTextures) (GLsizei n, const GLuint* textures);
1332 void (*glDepthFunc) (GLenum func);
1333 void (*glDepthMask) (GLboolean flag);
1334 void (*glDepthRangef) (GLclampf zNear, GLclampf zFar);
1335 void (*glDetachShader) (GLuint program, GLuint shader);
1336 void (*glDisable) (GLenum cap);
1337 void (*glDisableVertexAttribArray) (GLuint index);
1338 void (*glDrawArrays) (GLenum mode, GLint first, GLsizei count);
1339 void (*glDrawElements) (GLenum mode, GLsizei count, GLenum type, const void* indices);
1340 void (*glEnable) (GLenum cap);
1341 void (*glEnableVertexAttribArray) (GLuint index);
1342 void (*glFinish) (void);
1343 void (*glFlush) (void);
1344 void (*glFramebufferRenderbuffer) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
1345 void (*glFramebufferTexture2D) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
1346 void (*glFrontFace) (GLenum mode);
1347 void (*glGenBuffers) (GLsizei n, GLuint* buffers);
1348 void (*glGenerateMipmap) (GLenum target);
1349 void (*glGenFramebuffers) (GLsizei n, GLuint* framebuffers);
1350 void (*glGenRenderbuffers) (GLsizei n, GLuint* renderbuffers);
1351 void (*glGenTextures) (GLsizei n, GLuint* textures);
1352 void (*glGetActiveAttrib) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
1353 void (*glGetActiveUniform) (GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name);
1354 void (*glGetAttachedShaders) (GLuint program, GLsizei maxcount, GLsizei* count, GLuint* shaders);
1355 int (*glGetAttribLocation) (GLuint program, const char* name);
1356 void (*glGetBooleanv) (GLenum pname, GLboolean* params);
1357 void (*glGetBufferParameteriv) (GLenum target, GLenum pname, GLint* params);
1358 GLenum (*glGetError) (void);
1359 void (*glGetFloatv) (GLenum pname, GLfloat* params);
1360 void (*glGetFramebufferAttachmentParameteriv) (GLenum target, GLenum attachment, GLenum pname, GLint* params);
1361 void (*glGetIntegerv) (GLenum pname, GLint* params);
1362 void (*glGetProgramiv) (GLuint program, GLenum pname, GLint* params);
1363 void (*glGetProgramInfoLog) (GLuint program, GLsizei bufsize, GLsizei* length, char* infolog);
1364 void (*glGetRenderbufferParameteriv) (GLenum target, GLenum pname, GLint* params);
1365 void (*glGetShaderiv) (GLuint shader, GLenum pname, GLint* params);
1366 void (*glGetShaderInfoLog) (GLuint shader, GLsizei bufsize, GLsizei* length, char* infolog);
1367 void (*glGetShaderPrecisionFormat) (GLenum shadertype, GLenum precisiontype, GLint* range, GLint* precision);
1368 void (*glGetShaderSource) (GLuint shader, GLsizei bufsize, GLsizei* length, char* source);
1369 const GLubyte* (*glGetString) (GLenum name);
1370 void (*glGetTexParameterfv) (GLenum target, GLenum pname, GLfloat* params);
1371 void (*glGetTexParameteriv) (GLenum target, GLenum pname, GLint* params);
1372 void (*glGetUniformfv) (GLuint program, GLint location, GLfloat* params);
1373 void (*glGetUniformiv) (GLuint program, GLint location, GLint* params);
1374 int (*glGetUniformLocation) (GLuint program, const char* name);
1375 void (*glGetVertexAttribfv) (GLuint index, GLenum pname, GLfloat* params);
1376 void (*glGetVertexAttribiv) (GLuint index, GLenum pname, GLint* params);
1377 void (*glGetVertexAttribPointerv) (GLuint index, GLenum pname, void** pointer);
1378 void (*glHint) (GLenum target, GLenum mode);
1379 GLboolean (*glIsBuffer) (GLuint buffer);
1380 GLboolean (*glIsEnabled) (GLenum cap);
1381 GLboolean (*glIsFramebuffer) (GLuint framebuffer);
1382 GLboolean (*glIsProgram) (GLuint program);
1383 GLboolean (*glIsRenderbuffer) (GLuint renderbuffer);
1384 GLboolean (*glIsShader) (GLuint shader);
1385 GLboolean (*glIsTexture) (GLuint texture);
1386 void (*glLineWidth) (GLfloat width);
1387 void (*glLinkProgram) (GLuint program);
1388 void (*glPixelStorei) (GLenum pname, GLint param);
1389 void (*glPolygonOffset) (GLfloat factor, GLfloat units);
1390 void (*glReadPixels) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void* pixels);
1391 void (*glReleaseShaderCompiler) (void);
1392 void (*glRenderbufferStorage) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
1393 void (*glSampleCoverage) (GLclampf value, GLboolean invert);
1394 void (*glScissor) (GLint x, GLint y, GLsizei width, GLsizei height);
1395 void (*glShaderBinary) (GLsizei n, const GLuint* shaders, GLenum binaryformat, const void* binary, GLsizei length);
1396 void (*glShaderSource) (GLuint shader, GLsizei count, const char** string, const GLint* length);
1397 void (*glStencilFunc) (GLenum func, GLint ref, GLuint mask);
1398 void (*glStencilFuncSeparate) (GLenum face, GLenum func, GLint ref, GLuint mask);
1399 void (*glStencilMask) (GLuint mask);
1400 void (*glStencilMaskSeparate) (GLenum face, GLuint mask);
1401 void (*glStencilOp) (GLenum fail, GLenum zfail, GLenum zpass);
1402 void (*glStencilOpSeparate) (GLenum face, GLenum fail, GLenum zfail, GLenum zpass);
1403 void (*glTexImage2D) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void* pixels);
1404 void (*glTexParameterf) (GLenum target, GLenum pname, GLfloat param);
1405 void (*glTexParameterfv) (GLenum target, GLenum pname, const GLfloat* params);
1406 void (*glTexParameteri) (GLenum target, GLenum pname, GLint param);
1407 void (*glTexParameteriv) (GLenum target, GLenum pname, const GLint* params);
1408 void (*glTexSubImage2D) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void* pixels);
1409 void (*glUniform1f) (GLint location, GLfloat x);
1410 void (*glUniform1fv) (GLint location, GLsizei count, const GLfloat* v);
1411 void (*glUniform1i) (GLint location, GLint x);
1412 void (*glUniform1iv) (GLint location, GLsizei count, const GLint* v);
1413 void (*glUniform2f) (GLint location, GLfloat x, GLfloat y);
1414 void (*glUniform2fv) (GLint location, GLsizei count, const GLfloat* v);
1415 void (*glUniform2i) (GLint location, GLint x, GLint y);
1416 void (*glUniform2iv) (GLint location, GLsizei count, const GLint* v);
1417 void (*glUniform3f) (GLint location, GLfloat x, GLfloat y, GLfloat z);
1418 void (*glUniform3fv) (GLint location, GLsizei count, const GLfloat* v);
1419 void (*glUniform3i) (GLint location, GLint x, GLint y, GLint z);
1420 void (*glUniform3iv) (GLint location, GLsizei count, const GLint* v);
1421 void (*glUniform4f) (GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1422 void (*glUniform4fv) (GLint location, GLsizei count, const GLfloat* v);
1423 void (*glUniform4i) (GLint location, GLint x, GLint y, GLint z, GLint w);
1424 void (*glUniform4iv) (GLint location, GLsizei count, const GLint* v);
1425 void (*glUniformMatrix2fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
1426 void (*glUniformMatrix3fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
1427 void (*glUniformMatrix4fv) (GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
1428 void (*glUseProgram) (GLuint program);
1429 void (*glValidateProgram) (GLuint program);
1430 void (*glVertexAttrib1f) (GLuint indx, GLfloat x);
1431 void (*glVertexAttrib1fv) (GLuint indx, const GLfloat* values);
1432 void (*glVertexAttrib2f) (GLuint indx, GLfloat x, GLfloat y);
1433 void (*glVertexAttrib2fv) (GLuint indx, const GLfloat* values);
1434 void (*glVertexAttrib3f) (GLuint indx, GLfloat x, GLfloat y, GLfloat z);
1435 void (*glVertexAttrib3fv) (GLuint indx, const GLfloat* values);
1436 void (*glVertexAttrib4f) (GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
1437 void (*glVertexAttrib4fv) (GLuint indx, const GLfloat* values);
1438 void (*glVertexAttribPointer) (GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* ptr);
1439 void (*glViewport) (GLint x, GLint y, GLsizei width, GLsizei height);
1440
1441 /*------- GLES 2.0 Extensions -------*/
1442 // Notice these two names have been changed to fit Evas GL and not EGL!
1443 /* GL_OES_EvasGL_image */
1444 void (*glEvasGLImageTargetTexture2DOES) (GLenum target, EvasGLImage image);
1445 void (*glEvasGLImageTargetRenderbufferStorageOES) (GLenum target, EvasGLImage image);
1446
1447 /* GL_OES_get_program_binary */
1448 void (*glGetProgramBinaryOES) (GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, void *binary);
1449 void (*glProgramBinaryOES) (GLuint program, GLenum binaryFormat, const void *binary, GLint length);
1450 /* GL_OES_mapbuffer */
1451 void* (*glMapBufferOES) (GLenum target, GLenum access);
1452 GLboolean (*glUnmapBufferOES) (GLenum target);
1453 void (*glGetBufferPointervOES) (GLenum target, GLenum pname, void** params);
1454 /* GL_OES_texture_3D */
1455 void (*glTexImage3DOES) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels);
1456 void (*glTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const void* pixels);
1457 void (*glCopyTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
1458 void (*glCompressedTexImage3DOES) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const void* data);
1459 void (*glCompressedTexSubImage3DOES) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const void* data);
1460 void (*glFramebufferTexture3DOES) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset);
1461
1462 /* AMD_performance_monitor */
1463 void (*glGetPerfMonitorGroupsAMD) (GLint* numGroups, GLsizei groupsSize, GLuint* groups);
1464 void (*glGetPerfMonitorCountersAMD) (GLuint group, GLint* numCounters, GLint* maxActiveCounters, GLsizei counterSize, GLuint* counters);
1465 void (*glGetPerfMonitorGroupStringAMD) (GLuint group, GLsizei bufSize, GLsizei* length, char* groupString);
1466 void (*glGetPerfMonitorCounterStringAMD) (GLuint group, GLuint counter, GLsizei bufSize, GLsizei* length, char* counterString);
1467 void (*glGetPerfMonitorCounterInfoAMD) (GLuint group, GLuint counter, GLenum pname, void* data);
1468 void (*glGenPerfMonitorsAMD) (GLsizei n, GLuint* monitors);
1469 void (*glDeletePerfMonitorsAMD) (GLsizei n, GLuint* monitors);
1470 void (*glSelectPerfMonitorCountersAMD) (GLuint monitor, GLboolean enable, GLuint group, GLint numCounters, GLuint* countersList);
1471 void (*glBeginPerfMonitorAMD) (GLuint monitor);
1472 void (*glEndPerfMonitorAMD) (GLuint monitor);
1473 void (*glGetPerfMonitorCounterDataAMD) (GLuint monitor, GLenum pname, GLsizei dataSize, GLuint* data, GLint* bytesWritten);
1474
1475 /* GL_EXT_discard_framebuffer */
1476 void (*glDiscardFramebufferEXT) (GLenum target, GLsizei numAttachments, const GLenum* attachments);
1477
1478 /* GL_EXT_multi_draw_arrays */
1479 void (*glMultiDrawArraysEXT) (GLenum mode, GLint* first, GLsizei* count, GLsizei primcount);
1480 void (*glMultiDrawElementsEXT) (GLenum mode, const GLsizei* count, GLenum type, const GLvoid** indices, GLsizei primcount);
1481
1482 /* GL_NV_fence */
1483 void (*glDeleteFencesNV) (GLsizei n, const GLuint* fences);
1484 void (*glGenFencesNV) (GLsizei n, GLuint* fences);
1485 GLboolean (*glIsFenceNV) (GLuint fence);
1486 GLboolean (*glTestFenceNV) (GLuint fence);
1487 void (*glGetFenceivNV) (GLuint fence, GLenum pname, GLint* params);
1488 void (*glFinishFenceNV) (GLuint fence);
1489 void (*glSetFenceNV) (GLuint, GLenum);
1490
1491 /* GL_QCOM_driver_control */
1492 void (*glGetDriverControlsQCOM) (GLint* num, GLsizei size, GLuint* driverControls);
1493 void (*glGetDriverControlStringQCOM) (GLuint driverControl, GLsizei bufSize, GLsizei* length, char* driverControlString);
1494 void (*glEnableDriverControlQCOM) (GLuint driverControl);
1495 void (*glDisableDriverControlQCOM) (GLuint driverControl);
1496
1497 /* GL_QCOM_extended_get */
1498 void (*glExtGetTexturesQCOM) (GLuint* textures, GLint maxTextures, GLint* numTextures);
1499 void (*glExtGetBuffersQCOM) (GLuint* buffers, GLint maxBuffers, GLint* numBuffers);
1500 void (*glExtGetRenderbuffersQCOM) (GLuint* renderbuffers, GLint maxRenderbuffers, GLint* numRenderbuffers);
1501 void (*glExtGetFramebuffersQCOM) (GLuint* framebuffers, GLint maxFramebuffers, GLint* numFramebuffers);
1502 void (*glExtGetTexLevelParameterivQCOM) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint* params);
1503 void (*glExtTexObjectStateOverrideiQCOM) (GLenum target, GLenum pname, GLint param);
1504 void (*glExtGetTexSubImageQCOM) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void* texels);
1505 void (*glExtGetBufferPointervQCOM) (GLenum target, void** params);
1506
1507
1508 /* GL_QCOM_extended_get2 */
1509 void (*glExtGetShadersQCOM) (GLuint* shaders, GLint maxShaders, GLint* numShaders);
1510 void (*glExtGetProgramsQCOM) (GLuint* programs, GLint maxPrograms, GLint* numPrograms);
1511 GLboolean (*glExtIsProgramBinaryQCOM) (GLuint program);
1512 void (*glExtGetProgramBinarySourceQCOM) (GLuint program, GLenum shadertype, char* source, GLint* length);
1513
1514 //------- EGL Related Extensions -------//
1515 /* EvasGL_KHR_image */
1516 EvasGLImage (*evasglCreateImage) (int target, void* buffer, int* attrib_list);
1517 void (*evasglDestroyImage) (EvasGLImage image);
1518
1519 /* future calls will be added down here for expansion */
1520 /* version 2: */
1521};
1522
1523
1524#ifdef __cplusplus
1525}
1526#endif
1527
1528#endif
1529/**
1530 * @}
1531 */