Clone of mesa.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

eglplatform.h 2.4KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. /* -*- mode: c; tab-width: 8; -*- */
  2. /* vi: set sw=4 ts=8: */
  3. /* Platform-specific types and definitions for egl.h */
  4. #ifndef __eglplatform_h_
  5. #define __eglplatform_h_
  6. /* Windows calling convention boilerplate */
  7. #if (defined(WIN32) || defined(_WIN32_WCE))
  8. #ifndef WIN32_LEAN_AND_MEAN
  9. #define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
  10. #endif
  11. #include <windows.h>
  12. #endif
  13. #if !defined(_WIN32_WCE)
  14. #include <sys/types.h>
  15. #include <stdint.h>
  16. #endif
  17. /* Macros used in EGL function prototype declarations.
  18. *
  19. * EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
  20. * typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
  21. *
  22. * On Windows, EGLAPIENTRY can be defined like APIENTRY.
  23. * On most other platforms, it should be empty.
  24. */
  25. #ifndef EGLAPIENTRY
  26. #define EGLAPIENTRY
  27. #endif
  28. #ifndef EGLAPIENTRYP
  29. #define EGLAPIENTRYP EGLAPIENTRY *
  30. #endif
  31. /* The types NativeDisplayType, NativeWindowType, and NativePixmapType
  32. * are aliases of window-system-dependent types, such as X Display * or
  33. * Windows Device Context. They must be defined in platform-specific
  34. * code below. The EGL-prefixed versions of Native*Type are the same
  35. * types, renamed in EGL 1.3 so all types in the API start with "EGL".
  36. */
  37. /* Unix (tentative)
  38. #include <X headers>
  39. typedef Display *NativeDisplayType;
  40. - or maybe, if encoding "hostname:display.head"
  41. typedef const char *NativeWindowType;
  42. etc.
  43. */
  44. #if (defined(WIN32) || defined(_WIN32_WCE))
  45. /** BEGIN Added for Windows **/
  46. #ifndef EGLAPI
  47. #define EGLAPI __declspec(dllexport)
  48. #endif
  49. typedef long int32_t;
  50. typedef unsigned long uint32_t;
  51. typedef unsigned char uint8_t;
  52. #define snprintf _snprintf
  53. #define strcasecmp _stricmp
  54. #define vsnprintf _vsnprintf
  55. typedef HDC NativeDisplayType;
  56. typedef HWND NativeWindowType;
  57. typedef HBITMAP NativePixmapType;
  58. /** END Added for Windows **/
  59. #elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun)
  60. /** BEGIN Added for X (Mesa) **/
  61. #ifndef EGLAPI
  62. #define EGLAPI extern
  63. #endif
  64. #include <X11/Xlib.h>
  65. typedef Display *NativeDisplayType;
  66. typedef Window NativeWindowType;
  67. typedef Pixmap NativePixmapType;
  68. /** END Added for X (Mesa) **/
  69. #endif
  70. /* EGL 1.2 types, renamed for consistency in EGL 1.3 */
  71. typedef NativeDisplayType EGLNativeDisplayType;
  72. typedef NativePixmapType EGLNativePixmapType;
  73. typedef NativeWindowType EGLNativeWindowType;
  74. #endif /* __eglplatform_h */