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 <GLES/gl.h>
39#include <GLES/egltypes.h>
40
41/*
42** egltypes.h is platform dependent. It defines:
43**
44**     - EGL types and resources
45**     - Native types
46**     - EGL and native handle values
47**
48** EGL types and resources are to be typedef'ed with appropriate platform
49** dependent resource handle types. EGLint must be an integer of at least
50** 32-bit.
51**
52** NativeDisplayType, NativeWindowType and NativePixmapType are to be
53** replaced with corresponding types of the native window system in egl.h.
54**
55** EGL and native handle values must match their types.
56**
57** Example egltypes.h:
58*/
59
60#if 0
61
62#include <sys/types.h>
63#include <native_window_system.h>
64
65/*
66** Types and resources
67*/
68typedef int EGLBoolean;
69typedef int32_t EGLint;
70typedef void *EGLDisplay;
71typedef void *EGLConfig;
72typedef void *EGLSurface;
73typedef void *EGLContext;
74
75/*
76** EGL and native handle values
77*/
78#define EGL_DEFAULT_DISPLAY ((NativeDisplayType)0)
79#define EGL_NO_CONTEXT ((EGLContext)0)
80#define EGL_NO_DISPLAY ((EGLDisplay)0)
81#define EGL_NO_SURFACE ((EGLSurface)0)
82
83#endif
84
85/*
86** Versioning and extensions
87*/
88#define EGL_VERSION_1_0		       1
89
90/*
91** Boolean
92*/
93#define EGL_FALSE		       0
94#define EGL_TRUE		       1
95
96/*
97** Errors
98*/
99#define EGL_SUCCESS		       0x3000
100#define EGL_NOT_INITIALIZED	       0x3001
101#define EGL_BAD_ACCESS		       0x3002
102#define EGL_BAD_ALLOC		       0x3003
103#define EGL_BAD_ATTRIBUTE	       0x3004
104#define EGL_BAD_CONFIG		       0x3005
105#define EGL_BAD_CONTEXT		       0x3006
106#define EGL_BAD_CURRENT_SURFACE        0x3007
107#define EGL_BAD_DISPLAY		       0x3008
108#define EGL_BAD_MATCH		       0x3009
109#define EGL_BAD_NATIVE_PIXMAP	       0x300A
110#define EGL_BAD_NATIVE_WINDOW	       0x300B
111#define EGL_BAD_PARAMETER	       0x300C
112#define EGL_BAD_SURFACE		       0x300D
113/* 0x300E - 0x301F reserved for additional errors. */
114
115/*
116** Config attributes
117*/
118#define EGL_BUFFER_SIZE		       0x3020
119#define EGL_ALPHA_SIZE		       0x3021
120#define EGL_BLUE_SIZE		       0x3022
121#define EGL_GREEN_SIZE		       0x3023
122#define EGL_RED_SIZE		       0x3024
123#define EGL_DEPTH_SIZE		       0x3025
124#define EGL_STENCIL_SIZE	       0x3026
125#define EGL_CONFIG_CAVEAT	       0x3027
126#define EGL_CONFIG_ID		       0x3028
127#define EGL_LEVEL		       0x3029
128#define EGL_MAX_PBUFFER_HEIGHT	       0x302A
129#define EGL_MAX_PBUFFER_PIXELS	       0x302B
130#define EGL_MAX_PBUFFER_WIDTH	       0x302C
131#define EGL_NATIVE_RENDERABLE	       0x302D
132#define EGL_NATIVE_VISUAL_ID	       0x302E
133#define EGL_NATIVE_VISUAL_TYPE	       0x302F
134/*#define EGL_PRESERVED_RESOURCES	 0x3030*/
135#define EGL_SAMPLES		       0x3031
136#define EGL_SAMPLE_BUFFERS	       0x3032
137#define EGL_SURFACE_TYPE	       0x3033
138#define EGL_TRANSPARENT_TYPE	       0x3034
139#define EGL_TRANSPARENT_BLUE_VALUE     0x3035
140#define EGL_TRANSPARENT_GREEN_VALUE    0x3036
141#define EGL_TRANSPARENT_RED_VALUE      0x3037
142
143/*
144** Config attribute and value
145*/
146#define EGL_NONE		       0x3038
147/* 0x3039 - 0x304F reserved for additional config attributes. */
148
149/*
150** Config values
151*/
152#define EGL_DONT_CARE		       ((EGLint) -1)
153#define EGL_PBUFFER_BIT		       0x01
154#define EGL_PIXMAP_BIT		       0x02
155#define EGL_WINDOW_BIT		       0x04
156#define EGL_SLOW_CONFIG		       0x3050
157#define EGL_NON_CONFORMANT_CONFIG      0x3051
158#define EGL_TRANSPARENT_RGB	       0x3052
159
160/*
161** String names
162*/
163#define EGL_VENDOR		       0x3053
164#define EGL_VERSION		       0x3054
165#define EGL_EXTENSIONS		       0x3055
166
167/*
168** Surface attributes
169*/
170#define EGL_HEIGHT		       0x3056
171#define EGL_WIDTH		       0x3057
172#define EGL_LARGEST_PBUFFER	       0x3058
173
174/*
175** Current surfaces
176*/
177#define EGL_DRAW		       0x3059
178#define EGL_READ		       0x305A
179
180/*
181** Engines
182*/
183#define EGL_CORE_NATIVE_ENGINE	       0x305B
184
185/* 0x305C-0x3FFFF reserved for future use */
186
187/*
188** Functions
189*/
190#ifdef __cplusplus
191extern "C" {
192#endif
193
194GLAPI EGLint APIENTRY eglGetError (void);
195
196GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display);
197GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
198GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy);
199GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
200GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))();
201
202GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
203GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
204GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
205
206GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list);
207GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list);
208GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
209GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
210GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
211
212GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list);
213GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
214GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
215GLAPI EGLContext APIENTRY eglGetCurrentContext (void);
216GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw);
217GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void);
218GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
219
220GLAPI EGLBoolean APIENTRY eglWaitGL (void);
221GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine);
222GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw);
223GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target);
224
225#ifdef __cplusplus
226}
227#endif
228
229#endif /* ___egl_h_ */
230