egl.h revision 7012d01d888d482f2c6ad1180231a482026d213a
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#if 0/*XXX TEMPORARY HACK*/ 39#include <GLES/gl.h> 40#else 41#include <GL/gl.h> 42#endif 43#include <GLES/egltypes.h> 44 45/* XXX should go in eglext.h */ 46#define GL_OES_VERSION_1_0 1 47#define GL_OES_read_format 1 48#define GL_OES_compressed_paletted_texture 1 49#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A 50#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B 51#define GL_PALETTE4_RGB8_OES 0x8B90 52#define GL_PALETTE4_RGBA8_OES 0x8B91 53#define GL_PALETTE4_R5_G6_B5_OES 0x8B92 54#define GL_PALETTE4_RGBA4_OES 0x8B93 55#define GL_PALETTE4_RGB5_A1_OES 0x8B94 56#define GL_PALETTE8_RGB8_OES 0x8B95 57#define GL_PALETTE8_RGBA8_OES 0x8B96 58#define GL_PALETTE8_R5_G6_B5_OES 0x8B97 59#define GL_PALETTE8_RGBA4_OES 0x8B98 60#define GL_PALETTE8_RGB5_A1_OES 0x8B99 61/* XXX */ 62 63/* 64** Versioning and extensions 65*/ 66#define EGL_VERSION_1_0 1 67#if 0 68#define EGL_VERSION_1_1 1 69#endif 70 71/* 72** Boolean 73*/ 74#define EGL_FALSE 0 75#define EGL_TRUE 1 76 77/* 78** Errors 79*/ 80#define EGL_SUCCESS 0x3000 81#define EGL_NOT_INITIALIZED 0x3001 82#define EGL_BAD_ACCESS 0x3002 83#define EGL_BAD_ALLOC 0x3003 84#define EGL_BAD_ATTRIBUTE 0x3004 85#define EGL_BAD_CONFIG 0x3005 86#define EGL_BAD_CONTEXT 0x3006 87#define EGL_BAD_CURRENT_SURFACE 0x3007 88#define EGL_BAD_DISPLAY 0x3008 89#define EGL_BAD_MATCH 0x3009 90#define EGL_BAD_NATIVE_PIXMAP 0x300A 91#define EGL_BAD_NATIVE_WINDOW 0x300B 92#define EGL_BAD_PARAMETER 0x300C 93#define EGL_BAD_SURFACE 0x300D 94#define EGL_CONTEXT_LOST 0x300E 95/* 0x300F - 0x301F reserved for additional errors. */ 96 97/* 98** Config attributes 99*/ 100#define EGL_BUFFER_SIZE 0x3020 101#define EGL_ALPHA_SIZE 0x3021 102#define EGL_BLUE_SIZE 0x3022 103#define EGL_GREEN_SIZE 0x3023 104#define EGL_RED_SIZE 0x3024 105#define EGL_DEPTH_SIZE 0x3025 106#define EGL_STENCIL_SIZE 0x3026 107#define EGL_CONFIG_CAVEAT 0x3027 108#define EGL_CONFIG_ID 0x3028 109#define EGL_LEVEL 0x3029 110#define EGL_MAX_PBUFFER_HEIGHT 0x302A 111#define EGL_MAX_PBUFFER_PIXELS 0x302B 112#define EGL_MAX_PBUFFER_WIDTH 0x302C 113#define EGL_NATIVE_RENDERABLE 0x302D 114#define EGL_NATIVE_VISUAL_ID 0x302E 115#define EGL_NATIVE_VISUAL_TYPE 0x302F 116/*#define EGL_PRESERVED_RESOURCES 0x3030*/ 117#define EGL_SAMPLES 0x3031 118#define EGL_SAMPLE_BUFFERS 0x3032 119#define EGL_SURFACE_TYPE 0x3033 120#define EGL_TRANSPARENT_TYPE 0x3034 121#define EGL_TRANSPARENT_BLUE_VALUE 0x3035 122#define EGL_TRANSPARENT_GREEN_VALUE 0x3036 123#define EGL_TRANSPARENT_RED_VALUE 0x3037 124#define EGL_NONE 0x3038 /* Also a config value */ 125#define EGL_BIND_TO_TEXTURE_RGB 0x3039 126#define EGL_BIND_TO_TEXTURE_RGBA 0x303A 127#define EGL_MIN_SWAP_INTERVAL 0x303B 128#define EGL_MAX_SWAP_INTERVAL 0x303C 129 130/* 131** Config values 132*/ 133#define EGL_DONT_CARE ((EGLint) -1) 134 135#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */ 136#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* " */ 137#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */ 138#define EGL_NO_TEXTURE 0x305C /* EGL_TEXTURE_FORMAT/TARGET value */ 139#define EGL_TEXTURE_RGB 0x305D /* EGL_TEXTURE_FORMAT value */ 140#define EGL_TEXTURE_RGBA 0x305E /* " */ 141#define EGL_TEXTURE_2D 0x305F /* EGL_TEXTURE_TARGET value */ 142 143/* 144** Config attribute mask bits 145*/ 146#define EGL_PBUFFER_BIT 0x01 /* EGL_SURFACE_TYPE mask bit */ 147#define EGL_PIXMAP_BIT 0x02 /* " */ 148#define EGL_WINDOW_BIT 0x04 /* " */ 149 150/* 151** String names 152*/ 153#define EGL_VENDOR 0x3053 /* eglQueryString target */ 154#define EGL_VERSION 0x3054 /* " */ 155#define EGL_EXTENSIONS 0x3055 /* " */ 156 157/* 158** Surface attributes 159*/ 160#define EGL_HEIGHT 0x3056 161#define EGL_WIDTH 0x3057 162#define EGL_LARGEST_PBUFFER 0x3058 163#define EGL_TEXTURE_FORMAT 0x3080 /* For pbuffers bound as textures */ 164#define EGL_TEXTURE_TARGET 0x3081 /* " */ 165#define EGL_MIPMAP_TEXTURE 0x3082 /* " */ 166#define EGL_MIPMAP_LEVEL 0x3083 /* " */ 167 168/* 169** BindTexImage / ReleaseTexImage buffer target 170*/ 171#define EGL_BACK_BUFFER 0x3084 172 173/* 174** Current surfaces 175*/ 176#define EGL_DRAW 0x3059 177#define EGL_READ 0x305A 178 179/* 180** Engines 181*/ 182#define EGL_CORE_NATIVE_ENGINE 0x305B 183 184/* 0x305C-0x3FFFF reserved for future use */ 185 186/* 187** Functions 188*/ 189#ifdef __cplusplus 190extern "C" { 191#endif 192 193GLAPI EGLint APIENTRY eglGetError (void); 194 195GLAPI EGLDisplay APIENTRY eglGetDisplay (NativeDisplayType display); 196GLAPI EGLBoolean APIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor); 197GLAPI EGLBoolean APIENTRY eglTerminate (EGLDisplay dpy); 198GLAPI const char * APIENTRY eglQueryString (EGLDisplay dpy, EGLint name); 199GLAPI void (* APIENTRY eglGetProcAddress (const char *procname))(); 200 201GLAPI EGLBoolean APIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config); 202GLAPI EGLBoolean APIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config); 203GLAPI EGLBoolean APIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value); 204 205GLAPI EGLSurface APIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, NativeWindowType window, const EGLint *attrib_list); 206GLAPI EGLSurface APIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, NativePixmapType pixmap, const EGLint *attrib_list); 207GLAPI EGLSurface APIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); 208GLAPI EGLBoolean APIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface); 209GLAPI EGLBoolean APIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value); 210 211/* EGL 1.1 render-to-texture APIs */ 212GLAPI EGLBoolean APIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value); 213GLAPI EGLBoolean APIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 214GLAPI EGLBoolean APIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer); 215 216/* EGL 1.1 swap control API */ 217GLAPI EGLBoolean APIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval); 218 219GLAPI EGLContext APIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_list, const EGLint *attrib_list); 220GLAPI EGLBoolean APIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx); 221GLAPI EGLBoolean APIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx); 222GLAPI EGLContext APIENTRY eglGetCurrentContext (void); 223GLAPI EGLSurface APIENTRY eglGetCurrentSurface (EGLint readdraw); 224GLAPI EGLDisplay APIENTRY eglGetCurrentDisplay (void); 225GLAPI EGLBoolean APIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value); 226 227GLAPI EGLBoolean APIENTRY eglWaitGL (void); 228GLAPI EGLBoolean APIENTRY eglWaitNative (EGLint engine); 229GLAPI EGLBoolean APIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface draw); 230GLAPI EGLBoolean APIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, NativePixmapType target); 231 232 233 234/* EGL_MESA_screen extension >>> PRELIMINARY <<< */ 235#ifndef EGL_MESA_screen_surface 236#define EGL_MESA_screen_surface 1 237 238#define EGL_BAD_SCREEN_MESA 0x4000 239#define EGL_BAD_MODE_MESA 0x4001 240#define EGL_SCREEN_COUNT_MESA 0x4002 241#define EGL_SCREEN_POSITION_MESA 0x4003 242#define EGL_MODE_ID_MESA 0x4004 243#define EGL_REFRESH_RATE_MESA 0x4005 244#define EGL_OPTIMAL_MODE_MESA 0x4006 245#define EGL_SCREEN_BIT_MESA 0x08 246 247GLAPI EGLBoolean APIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); 248GLAPI EGLBoolean APIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes); 249GLAPI EGLBoolean APIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value); 250GLAPI EGLBoolean APIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens); 251GLAPI EGLSurface APIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list); 252GLAPI EGLBoolean APIENTRY eglShowSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode); 253GLAPI EGLBoolean APIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y); 254GLAPI EGLBoolean APIENTRY eglQueryDisplayMESA(EGLDisplay dpy, EGLint attrib, EGLint *value); 255GLAPI EGLBoolean APIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value); 256GLAPI EGLBoolean APIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface); 257GLAPI EGLBoolean APIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode); 258GLAPI const char * APIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode); 259 260#endif /* EGL_MESA_screen_surface */ 261 262 263 264 265 266 267 268 269#ifdef __cplusplus 270} 271#endif 272 273#endif /* _EGL_H */ 274