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