Advertisement
Guest User

Untitled

a guest
Dec 18th, 2013
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.14 KB | None | 0 0
  1. /* -*- mode: c; tab-width: 8; -*- */
  2. /* vi: set sw=4 ts=8: */
  3. /* Platform-specific types and definitions for egl.h
  4. * Last modified 2008/10/22
  5. *
  6. * If you make additions or modifications to eglplatform.h specific to
  7. * your implementation or runtime environment, please send them to
  8. * Khronos (preferably by filing a bug in the member or public Bugzillas
  9. * and attaching a copy) for possible inclusion in future versions.
  10. */
  11.  
  12. /*
  13. ** Copyright (c) 2007-2008 The Khronos Group Inc.
  14. **
  15. ** Permission is hereby granted, free of charge, to any person obtaining a
  16. ** copy of this software and/or associated documentation files (the
  17. ** "Materials"), to deal in the Materials without restriction, including
  18. ** without limitation the rights to use, copy, modify, merge, publish,
  19. ** distribute, sublicense, and/or sell copies of the Materials, and to
  20. ** permit persons to whom the Materials are furnished to do so, subject to
  21. ** the following conditions:
  22. **
  23. ** The above copyright notice and this permission notice shall be included
  24. ** in all copies or substantial portions of the Materials.
  25. **
  26. ** THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
  27. ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  28. ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
  29. ** IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
  30. ** CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  31. ** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  32. ** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
  33. */
  34.  
  35. #ifndef __eglplatform_h_
  36. #define __eglplatform_h_
  37.  
  38. // AMD commented out this include so WinCE would build
  39. //#include <sys/types.h>
  40.  
  41. /* Macros used in EGL function prototype declarations.
  42. *
  43. * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
  44. * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
  45. *
  46. * On Windows, EGLAPIENTRY can be defined like APIENTRY.
  47. * On most other platforms, it should be empty.
  48. */
  49.  
  50. #ifndef EGLAPI
  51. # if (defined(_WIN32) || defined(__VC32__)) && !defined(__SYMBIAN32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
  52. # define EGLAPI __declspec(dllimport)
  53. # elif defined (__SYMBIAN32__) /* Symbian */
  54. # define EGLAPI __declspec(dllexport) //IMPORT_C
  55. # else
  56. # define EGLAPI
  57. # endif
  58. #endif
  59.  
  60. #if (defined(_WIN32) || defined(__VC32__)) && !defined(__SYMBIAN32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) && !defined(_WIN32_WCE) /* Win32 */
  61. #define EGLAPIENTRY __stdcall
  62. #else
  63. #define EGLAPIENTRY
  64. #endif
  65.  
  66. #define EGLAPIENTRYP EGLAPIENTRY *
  67.  
  68. /* The types NativeDisplayType, NativeWindowType, and NativePixmapType
  69. * are aliases of window-system-dependent types, such as X Display * or
  70. * Windows Device Context. They must be defined in platform-specific
  71. * code below. The EGL-prefixed versions of Native*Type are the same
  72. * types, renamed in EGL 1.3 so all types in the API start with "EGL".
  73. */
  74.  
  75. #if defined(__SYMBIAN32__) || defined(_NUCLEUS) /* Symbian */
  76.  
  77. typedef int NativeDisplayType;
  78. typedef void* NativeWindowType;
  79. typedef void* NativePixmapType;
  80.  
  81. #elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
  82. #ifndef WIN32_LEAN_AND_MEAN
  83. # define WIN32_LEAN_AND_MEAN 1
  84. #endif
  85. #include <windows.h>
  86. #ifndef _WINCE
  87. typedef HDC NativeDisplayType;
  88. typedef HWND NativeWindowType;
  89. #else
  90. typedef int NativeDisplayType;
  91. typedef PVOID NativeWindowType;
  92. #endif
  93. typedef HBITMAP NativePixmapType;
  94.  
  95.  
  96. #elif defined(__unix__)
  97.  
  98. typedef void* NativeDisplayType;
  99. typedef void* NativePixmapType;
  100.  
  101. #ifdef ANDROID
  102. typedef struct android_native_window_t* NativeWindowType;
  103. #else
  104. typedef int NativeWindowType;
  105. #endif
  106.  
  107. #elif defined(__ARMCC_VERSION) /* native ARM build without any specific OS */
  108.  
  109. typedef int NativeDisplayType;
  110. typedef void *NativeWindowType;
  111. typedef void *NativePixmapType;
  112.  
  113. #else
  114. #error "Platform not recognized"
  115. #endif
  116.  
  117. /* EGL 1.2 types, renamed for consistency in EGL 1.3 */
  118. typedef NativeDisplayType EGLNativeDisplayType;
  119. typedef NativePixmapType EGLNativePixmapType;
  120. typedef NativeWindowType EGLNativeWindowType;
  121.  
  122. /* platform specific Out-of-band handle values */
  123. #ifdef UNDER_CE
  124. #define EGL_DIRECTDRAW_DISPLAY ((EGLNativeDisplayType)1)
  125. #endif
  126.  
  127. /* Define EGLint. This must be an integral type large enough to contain
  128. * all legal attribute names and values passed into and out of EGL,
  129. * whether their type is boolean, bitmask, enumerant (symbolic
  130. * constant), integer, handle, or other.
  131. * While in general a 32-bit integer will suffice, if handles are
  132. * represented as pointers, then EGLint should be defined as a 64-bit
  133. * integer type.
  134. */
  135. #if (defined(__STDC__) && __STDC__ && __STDC_VERSION__ >= 199901L) || defined(__GNUC__)
  136. #include <stdint.h>
  137. typedef int32_t EGLint;
  138. #elif defined(__SYMBIAN32__)
  139. typedef int EGLint;
  140. #elif (defined(_WIN32) || defined(__VC32__)) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
  141. #include <windows.h>
  142. typedef INT32 EGLint;
  143. #else
  144. typedef int EGLint;
  145. #endif
  146.  
  147. #endif /* __eglplatform_h */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement