michael@0: #ifndef __eglplatform_h_ michael@0: #define __eglplatform_h_ michael@0: michael@0: /* michael@0: ** Copyright (c) 2007-2009 The Khronos Group Inc. michael@0: ** michael@0: ** Permission is hereby granted, free of charge, to any person obtaining a michael@0: ** copy of this software and/or associated documentation files (the michael@0: ** "Materials"), to deal in the Materials without restriction, including michael@0: ** without limitation the rights to use, copy, modify, merge, publish, michael@0: ** distribute, sublicense, and/or sell copies of the Materials, and to michael@0: ** permit persons to whom the Materials are furnished to do so, subject to michael@0: ** the following conditions: michael@0: ** michael@0: ** The above copyright notice and this permission notice shall be included michael@0: ** in all copies or substantial portions of the Materials. michael@0: ** michael@0: ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, michael@0: ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF michael@0: ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. michael@0: ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY michael@0: ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, michael@0: ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE michael@0: ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. michael@0: */ michael@0: michael@0: /* Platform-specific types and definitions for egl.h michael@0: * $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $ michael@0: * michael@0: * Adopters may modify khrplatform.h and this file to suit their platform. michael@0: * You are encouraged to submit all modifications to the Khronos group so that michael@0: * they can be included in future versions of this file. Please submit changes michael@0: * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) michael@0: * by filing a bug against product "EGL" component "Registry". michael@0: */ michael@0: michael@0: #include michael@0: michael@0: /* Macros used in EGL function prototype declarations. michael@0: * michael@0: * EGL functions should be prototyped as: michael@0: * michael@0: * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); michael@0: * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); michael@0: * michael@0: * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h michael@0: */ michael@0: michael@0: #ifndef EGLAPI michael@0: #define EGLAPI KHRONOS_APICALL michael@0: #endif michael@0: michael@0: #ifndef EGLAPIENTRY michael@0: #define EGLAPIENTRY KHRONOS_APIENTRY michael@0: #endif michael@0: #define EGLAPIENTRYP EGLAPIENTRY* michael@0: michael@0: /* The types NativeDisplayType, NativeWindowType, and NativePixmapType michael@0: * are aliases of window-system-dependent types, such as X Display * or michael@0: * Windows Device Context. They must be defined in platform-specific michael@0: * code below. The EGL-prefixed versions of Native*Type are the same michael@0: * types, renamed in EGL 1.3 so all types in the API start with "EGL". michael@0: * michael@0: * Khronos STRONGLY RECOMMENDS that you use the default definitions michael@0: * provided below, since these changes affect both binary and source michael@0: * portability of applications using EGL running on different EGL michael@0: * implementations. michael@0: */ michael@0: michael@0: #if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ michael@0: #ifndef WIN32_LEAN_AND_MEAN michael@0: #define WIN32_LEAN_AND_MEAN 1 michael@0: #endif michael@0: #include michael@0: michael@0: typedef HDC EGLNativeDisplayType; michael@0: typedef HBITMAP EGLNativePixmapType; michael@0: typedef HWND EGLNativeWindowType; michael@0: michael@0: #elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ michael@0: michael@0: typedef int EGLNativeDisplayType; michael@0: typedef void *EGLNativeWindowType; michael@0: typedef void *EGLNativePixmapType; michael@0: michael@0: #elif defined(WL_EGL_PLATFORM) michael@0: michael@0: typedef struct wl_display *EGLNativeDisplayType; michael@0: typedef struct wl_egl_pixmap *EGLNativePixmapType; michael@0: typedef struct wl_egl_window *EGLNativeWindowType; michael@0: michael@0: #elif defined(__unix__) && !defined(ANDROID) michael@0: michael@0: /* X11 (tentative) */ michael@0: #include michael@0: #include michael@0: michael@0: typedef Display *EGLNativeDisplayType; michael@0: typedef Pixmap EGLNativePixmapType; michael@0: typedef Window EGLNativeWindowType; michael@0: michael@0: #elif defined(ANDROID) michael@0: michael@0: struct egl_native_pixmap_t; michael@0: michael@0: typedef struct ANativeWindow* EGLNativeWindowType; michael@0: typedef struct egl_native_pixmap_t* EGLNativePixmapType; michael@0: typedef void* EGLNativeDisplayType; michael@0: michael@0: #else michael@0: #error "Platform not recognized" michael@0: #endif michael@0: michael@0: /* EGL 1.2 types, renamed for consistency in EGL 1.3 */ michael@0: typedef EGLNativeDisplayType NativeDisplayType; michael@0: typedef EGLNativePixmapType NativePixmapType; michael@0: typedef EGLNativeWindowType NativeWindowType; michael@0: michael@0: michael@0: /* Define EGLint. This must be a signed integral type large enough to contain michael@0: * all legal attribute names and values passed into and out of EGL, whether michael@0: * their type is boolean, bitmask, enumerant (symbolic constant), integer, michael@0: * handle, or other. While in general a 32-bit integer will suffice, if michael@0: * handles are 64 bit types, then EGLint should be defined as a signed 64-bit michael@0: * integer type. michael@0: */ michael@0: typedef khronos_int32_t EGLint; michael@0: michael@0: #endif /* __eglplatform_h */