egl.h revision 8ff72e97231da2f81de422d2f58c23d09562446e
1#ifndef _EGL_H
2#define _EGL_H
3
4/*
5** License Applicability. Except to the extent portions of this file are
6** made subject to an alternative license as permitted in the SGI Free
7** Software License B, Version 1.0 (the "License"), the contents of this
8** file are subject only to the provisions of the License. You may not use
9** this file except in compliance with the License. You may obtain a copy
10** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600
11** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at:
12**
13** http://oss.sgi.com/projects/FreeB
14**
15** Note that, as provided in the License, the Software is distributed on an
16** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS
17** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND
18** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A
19** PARTICULAR PURPOSE, AND NON-INFRINGEMENT.
20**
21** Original Code. The Original Code is: OpenGL Sample Implementation,
22** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics,
23** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc.
24** Copyright in any portions created by third parties is as indicated
25** elsewhere herein. All Rights Reserved.
26**
27** Additional Notice Provisions: The application programming interfaces
28** established by SGI in conjunction with the Original Code are The
29** OpenGL(R) Graphics System: A Specification (Version 1.2.1), released
30** April 1, 1999; The OpenGL(R) Graphics System Utility Library (Version
31** 1.3), released November 4, 1998; and OpenGL(R) Graphics with the X
32** Window System(R) (Version 1.3), released October 19, 1998. This software
33** was created using the OpenGL(R) version 1.2.1 Sample Implementation
34** published by SGI, but has not been independently verified as being
35** compliant with the OpenGL(R) version 1.2.1 Specification.
36*/
37
38#include <GL/gl.h>
39#include <GLES/egltypes.h>
40
41/* XXX should go in eglext.h */
42#define GL_OES_VERSION_1_0  1
43#define GL_OES_read_format  1
44#define GL_OES_compressed_paletted_texture 1
45#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
46#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
47#define GL_PALETTE4_RGB8_OES        0x8B90
48#define GL_PALETTE4_RGBA8_OES       0x8B91
49#define GL_PALETTE4_R5_G6_B5_OES    0x8B92
50#define GL_PALETTE4_RGBA4_OES       0x8B93
51#define GL_PALETTE4_RGB5_A1_OES     0x8B94
52#define GL_PALETTE8_RGB8_OES        0x8B95
53#define GL_PALETTE8_RGBA8_OES       0x8B96
54#define GL_PALETTE8_R5_G6_B5_OES    0x8B97
55#define GL_PALETTE8_RGBA4_OES       0x8B98
56#define GL_PALETTE8_RGB5_A1_OES     0x8B99
57/* XXX */
58
59/*
60** Versioning and extensions
61*/
62#define EGL_VERSION_1_0		       1
63#if 0
64#define EGL_VERSION_1_1		       1
65#endif
66
67/*
68** Boolean
69*/
70#define EGL_FALSE		       0
71#define EGL_TRUE		       1
72
73/*
74** Errors
75*/
76#define EGL_SUCCESS		       0x3000
77#define EGL_NOT_INITIALIZED	       0x3001
78#define EGL_BAD_ACCESS		       0x3002
79#define EGL_BAD_ALLOC		       0x3003
80#define EGL_BAD_ATTRIBUTE	       0x3004
81#define EGL_BAD_CONFIG		       0x3005
82#define EGL_BAD_CONTEXT		       0x3006
83#define EGL_BAD_CURRENT_SURFACE        0x3007
84#define EGL_BAD_DISPLAY		       0x3008
85#define EGL_BAD_MATCH		       0x3009
86#define EGL_BAD_NATIVE_PIXMAP	       0x300A
87#define EGL_BAD_NATIVE_WINDOW	       0x300B
88#define EGL_BAD_PARAMETER	       0x300C
89#define EGL_BAD_SURFACE		       0x300D
90#define EGL_CONTEXT_LOST	       0x300E
91/* 0x300F - 0x301F reserved for additional errors. */
92
93/*
94** Config attributes
95*/
96#define EGL_BUFFER_SIZE		       0x3020
97#define EGL_ALPHA_SIZE		       0x3021
98#define EGL_BLUE_SIZE		       0x3022
99#define EGL_GREEN_SIZE		       0x3023
100#define EGL_RED_SIZE		       0x3024
101#define EGL_DEPTH_SIZE		       0x3025
102#define EGL_STENCIL_SIZE	       0x3026
103#define EGL_CONFIG_CAVEAT	       0x3027
104#define EGL_CONFIG_ID		       0x3028
105#define EGL_LEVEL		       0x3029
106#define EGL_MAX_PBUFFER_HEIGHT	       0x302A
107#define EGL_MAX_PBUFFER_PIXELS	       0x302B
108#define EGL_MAX_PBUFFER_WIDTH	       0x302C
109#define EGL_NATIVE_RENDERABLE	       0x302D
110#define EGL_NATIVE_VISUAL_ID	       0x302E
111#define EGL_NATIVE_VISUAL_TYPE	       0x302F
112/*#define EGL_PRESERVED_RESOURCES	 0x3030*/
113#define EGL_SAMPLES		       0x3031
114#define EGL_SAMPLE_BUFFERS	       0x3032
115#define EGL_SURFACE_TYPE	       0x3033
116#define EGL_TRANSPARENT_TYPE	       0x3034
117#define EGL_TRANSPARENT_BLUE_VALUE     0x3035
118#define EGL_TRANSPARENT_GREEN_VALUE    0x3036
119#define EGL_TRANSPARENT_RED_VALUE      0x3037
120#define EGL_NONE		       0x3038	/* Also a config value */
121#define EGL_BIND_TO_TEXTURE_RGB        0x3039
122#define EGL_BIND_TO_TEXTURE_RGBA       0x303A
123#define EGL_MIN_SWAP_INTERVAL	       0x303B
124#define EGL_MAX_SWAP_INTERVAL	       0x303C
125
126/*
127** Config values
128*/
129#define EGL_DONT_CARE		       ((EGLint) -1)
130
131#define EGL_SLOW_CONFIG		       0x3050	/* EGL_CONFIG_CAVEAT value */
132#define EGL_NON_CONFORMANT_CONFIG      0x3051	/* " */
133#define EGL_TRANSPARENT_RGB	       0x3052	/* EGL_TRANSPARENT_TYPE value */
134#define EGL_NO_TEXTURE		       0x305C	/* EGL_TEXTURE_FORMAT/TARGET value */
135#define EGL_TEXTURE_RGB		       0x305D	/* EGL_TEXTURE_FORMAT value */
136#define EGL_TEXTURE_RGBA	       0x305E	/* " */
137#define EGL_TEXTURE_2D		       0x305F	/* EGL_TEXTURE_TARGET value */
138
139/*
140** Config attribute mask bits
141*/
142#define EGL_PBUFFER_BIT		       0x01	/* EGL_SURFACE_TYPE mask bit */
143#define EGL_PIXMAP_BIT		       0x02	/* " */
144#define EGL_WINDOW_BIT		       0x04	/* " */
145
146/*
147** String names
148*/
149#define EGL_VENDOR		       0x3053	/* eglQueryString target */
150#define EGL_VERSION		       0x3054	/* " */
151#define EGL_EXTENSIONS		       0x3055	/* " */
152
153/*
154** Surface attributes
155*/
156#define EGL_HEIGHT		       0x3056
157#define EGL_WIDTH		       0x3057
158#define EGL_LARGEST_PBUFFER	       0x3058
159#define EGL_TEXTURE_FORMAT	       0x3080	/* For pbuffers bound as textures */
160#define EGL_TEXTURE_TARGET	       0x3081	/* " */
161#define EGL_MIPMAP_TEXTURE	       0x3082	/* " */
162#define EGL_MIPMAP_LEVEL	       0x3083	/* " */
163
164/*
165** BindTexImage / ReleaseTexImage buffer target
166*/
167#define EGL_BACK_BUFFER		       0x3084
168
169/*
170** Current surfaces
171*/
172#define EGL_DRAW		       0x3059
173#define EGL_READ		       0x305A
174
175/*
176** Engines
177*/
178#define EGL_CORE_NATIVE_ENGINE	       0x305B
179
180/* 0x305C-0x3FFFF reserved for future use */
181
182/*
183** Functions
184*/
185#ifdef __cplusplus
186extern "C" {
187#endif
188
189GLAPI EGLint APIENTRY eglGetError (void);
190
191GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display);
192GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
193GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy);
194GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
195GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))();
196
197GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
198GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
199GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
200
201GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
202GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
203GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
204GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
205GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
206
207/* EGL 1.1 render-to-texture APIs */
208GLAPI EGLBoolean APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
209GLAPI EGLBoolean APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
210GLAPI EGLBoolean APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
211
212/* EGL 1.1 swap control API */
213GLAPI EGLBoolean APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
214
215GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
216GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
217GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
218GLAPI EGLContext APIENTRY eglGetCurrentContext (void);
219GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw);
220GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void);
221GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
222
223GLAPI EGLBoolean APIENTRY eglWaitGL (void);
224GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine);
225GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
226GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
227
228#ifdef __cplusplus
229}
230#endif
231
232#endif /* _EGL_H */
233