eglplatform.h revision cdc920a0
14a49301eSmrg#ifndef __eglplatform_h_ 24a49301eSmrg#define __eglplatform_h_ 34a49301eSmrg 4cdc920a0Smrg/* 5cdc920a0Smrg** Copyright (c) 2007-2009 The Khronos Group Inc. 6cdc920a0Smrg** 7cdc920a0Smrg** Permission is hereby granted, free of charge, to any person obtaining a 8cdc920a0Smrg** copy of this software and/or associated documentation files (the 9cdc920a0Smrg** "Materials"), to deal in the Materials without restriction, including 10cdc920a0Smrg** without limitation the rights to use, copy, modify, merge, publish, 11cdc920a0Smrg** distribute, sublicense, and/or sell copies of the Materials, and to 12cdc920a0Smrg** permit persons to whom the Materials are furnished to do so, subject to 13cdc920a0Smrg** the following conditions: 14cdc920a0Smrg** 15cdc920a0Smrg** The above copyright notice and this permission notice shall be included 16cdc920a0Smrg** in all copies or substantial portions of the Materials. 17cdc920a0Smrg** 18cdc920a0Smrg** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19cdc920a0Smrg** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20cdc920a0Smrg** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21cdc920a0Smrg** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY 22cdc920a0Smrg** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 23cdc920a0Smrg** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 24cdc920a0Smrg** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. 25cdc920a0Smrg*/ 26cdc920a0Smrg 27cdc920a0Smrg/* Platform-specific types and definitions for egl.h 28cdc920a0Smrg * $Revision: 1.1.1.2 $ on $Date: 2010/07/19 05:31:29 $ 29cdc920a0Smrg * 30cdc920a0Smrg * Adopters may modify khrplatform.h and this file to suit their platform. 31cdc920a0Smrg * You are encouraged to submit all modifications to the Khronos group so that 32cdc920a0Smrg * they can be included in future versions of this file. Please submit changes 33cdc920a0Smrg * by sending them to the public Khronos Bugzilla (http://khronos.org/bugzilla) 34cdc920a0Smrg * by filing a bug against product "EGL" component "Registry". 35cdc920a0Smrg */ 364a49301eSmrg 37cdc920a0Smrg#include <KHR/khrplatform.h> 384a49301eSmrg 394a49301eSmrg/* Macros used in EGL function prototype declarations. 40cdc920a0Smrg * 41cdc920a0Smrg * EGL functions should be prototyped as: 424a49301eSmrg * 434a49301eSmrg * EGLAPI return-type EGLAPIENTRY eglFunction(arguments); 444a49301eSmrg * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments); 454a49301eSmrg * 46cdc920a0Smrg * KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h 474a49301eSmrg */ 484a49301eSmrg 49cdc920a0Smrg#ifndef EGLAPI 50cdc920a0Smrg#define EGLAPI KHRONOS_APICALL 514a49301eSmrg#endif 52cdc920a0Smrg 53cdc920a0Smrg#ifndef EGLAPIENTRY 54cdc920a0Smrg#define EGLAPIENTRY KHRONOS_APIENTRY 554a49301eSmrg#endif 56cdc920a0Smrg#define EGLAPIENTRYP EGLAPIENTRY* 574a49301eSmrg 584a49301eSmrg/* The types NativeDisplayType, NativeWindowType, and NativePixmapType 594a49301eSmrg * are aliases of window-system-dependent types, such as X Display * or 604a49301eSmrg * Windows Device Context. They must be defined in platform-specific 614a49301eSmrg * code below. The EGL-prefixed versions of Native*Type are the same 624a49301eSmrg * types, renamed in EGL 1.3 so all types in the API start with "EGL". 634a49301eSmrg */ 644a49301eSmrg 65cdc920a0Smrg#if defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */ 66cdc920a0Smrg#ifndef WIN32_LEAN_AND_MEAN 67cdc920a0Smrg#define WIN32_LEAN_AND_MEAN 1 684a49301eSmrg#endif 69cdc920a0Smrg#include <windows.h> 704a49301eSmrg 71cdc920a0Smrgtypedef HDC EGLNativeDisplayType; 72cdc920a0Smrgtypedef HBITMAP EGLNativePixmapType; 73cdc920a0Smrgtypedef HWND EGLNativeWindowType; 744a49301eSmrg 75cdc920a0Smrg#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */ 764a49301eSmrg 77cdc920a0Smrgtypedef int EGLNativeDisplayType; 78cdc920a0Smrgtypedef void *EGLNativeWindowType; 79cdc920a0Smrgtypedef void *EGLNativePixmapType; 804a49301eSmrg 81cdc920a0Smrg#elif defined(__unix__) || defined(__unix) 824a49301eSmrg 83cdc920a0Smrg/* X11 (tentative) */ 844a49301eSmrg#include <X11/Xlib.h> 85cdc920a0Smrg#include <X11/Xutil.h> 86cdc920a0Smrg 87cdc920a0Smrgtypedef Display *EGLNativeDisplayType; 88cdc920a0Smrgtypedef Pixmap EGLNativePixmapType; 89cdc920a0Smrgtypedef Window EGLNativeWindowType; 904a49301eSmrg 91cdc920a0Smrg#else 92cdc920a0Smrg#error "Platform not recognized" 934a49301eSmrg#endif 944a49301eSmrg 954a49301eSmrg/* EGL 1.2 types, renamed for consistency in EGL 1.3 */ 96cdc920a0Smrgtypedef EGLNativeDisplayType NativeDisplayType; 97cdc920a0Smrgtypedef EGLNativePixmapType NativePixmapType; 98cdc920a0Smrgtypedef EGLNativeWindowType NativeWindowType; 99cdc920a0Smrg 100cdc920a0Smrg 101cdc920a0Smrg/* Define EGLint. This must be a signed integral type large enough to contain 102cdc920a0Smrg * all legal attribute names and values passed into and out of EGL, whether 103cdc920a0Smrg * their type is boolean, bitmask, enumerant (symbolic constant), integer, 104cdc920a0Smrg * handle, or other. While in general a 32-bit integer will suffice, if 105cdc920a0Smrg * handles are 64 bit types, then EGLint should be defined as a signed 64-bit 106cdc920a0Smrg * integer type. 107cdc920a0Smrg */ 108cdc920a0Smrgtypedef khronos_int32_t EGLint; 1094a49301eSmrg 1104a49301eSmrg#endif /* __eglplatform_h */ 111