2008-05-27 20:43:01 +01:00
|
|
|
/* -*- mode: c; tab-width: 8; -*- */
|
|
|
|
/* vi: set sw=4 ts=8: */
|
|
|
|
/* Platform-specific types and definitions for egl.h */
|
|
|
|
|
|
|
|
#ifndef __eglplatform_h_
|
|
|
|
#define __eglplatform_h_
|
|
|
|
|
|
|
|
/* Windows calling convention boilerplate */
|
2008-06-05 22:07:03 +01:00
|
|
|
#if (defined(WIN32) || defined(_WIN32_WCE))
|
|
|
|
#ifndef WIN32_LEAN_AND_MEAN
|
2008-06-28 12:40:44 +01:00
|
|
|
#define WIN32_LEAN_AND_MEAN /* Exclude rarely-used stuff from Windows headers */
|
2008-06-05 22:07:03 +01:00
|
|
|
#endif
|
2008-05-27 20:43:01 +01:00
|
|
|
#include <windows.h>
|
|
|
|
#endif
|
|
|
|
|
2008-06-28 12:40:44 +01:00
|
|
|
#if !defined(_WIN32_WCE)
|
2008-05-27 20:43:01 +01:00
|
|
|
#include <sys/types.h>
|
2009-03-25 19:02:44 +00:00
|
|
|
#include <stdint.h>
|
2008-06-28 12:40:44 +01:00
|
|
|
#endif
|
2008-05-27 20:43:01 +01:00
|
|
|
|
|
|
|
/* Macros used in EGL function prototype declarations.
|
|
|
|
*
|
|
|
|
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
|
|
|
|
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
|
|
|
|
*
|
|
|
|
* On Windows, EGLAPIENTRY can be defined like APIENTRY.
|
|
|
|
* On most other platforms, it should be empty.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef EGLAPIENTRY
|
|
|
|
#define EGLAPIENTRY
|
|
|
|
#endif
|
|
|
|
#ifndef EGLAPIENTRYP
|
|
|
|
#define EGLAPIENTRYP EGLAPIENTRY *
|
|
|
|
#endif
|
|
|
|
|
|
|
|
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
|
|
|
|
* are aliases of window-system-dependent types, such as X Display * or
|
|
|
|
* Windows Device Context. They must be defined in platform-specific
|
|
|
|
* code below. The EGL-prefixed versions of Native*Type are the same
|
|
|
|
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
|
|
|
|
*/
|
|
|
|
|
|
|
|
/* Unix (tentative)
|
|
|
|
#include <X headers>
|
|
|
|
typedef Display *NativeDisplayType;
|
|
|
|
- or maybe, if encoding "hostname:display.head"
|
|
|
|
typedef const char *NativeWindowType;
|
|
|
|
etc.
|
|
|
|
*/
|
|
|
|
|
2008-06-05 22:07:03 +01:00
|
|
|
|
|
|
|
#if (defined(WIN32) || defined(_WIN32_WCE))
|
|
|
|
|
|
|
|
/** BEGIN Added for Windows **/
|
2008-06-06 22:13:59 +01:00
|
|
|
#ifndef EGLAPI
|
|
|
|
#define EGLAPI __declspec(dllexport)
|
|
|
|
#endif
|
2008-08-06 02:20:43 +01:00
|
|
|
|
2008-06-05 22:07:03 +01:00
|
|
|
typedef long int32_t;
|
2009-03-24 02:38:58 +00:00
|
|
|
typedef unsigned long uint32_t;
|
2008-08-05 15:12:38 +01:00
|
|
|
typedef unsigned char uint8_t;
|
2008-08-06 02:20:43 +01:00
|
|
|
#define snprintf _snprintf
|
|
|
|
#define strcasecmp _stricmp
|
2008-08-06 23:42:38 +01:00
|
|
|
#define vsnprintf _vsnprintf
|
2008-08-05 15:12:38 +01:00
|
|
|
|
2008-06-05 22:07:03 +01:00
|
|
|
typedef HDC NativeDisplayType;
|
|
|
|
typedef HWND NativeWindowType;
|
|
|
|
typedef HBITMAP NativePixmapType;
|
|
|
|
/** END Added for Windows **/
|
|
|
|
|
2009-03-24 03:35:54 +00:00
|
|
|
#elif defined(__gnu_linux__) || defined(__FreeBSD__) || defined(__sun)
|
2008-06-05 22:07:03 +01:00
|
|
|
|
2008-05-27 20:43:34 +01:00
|
|
|
/** BEGIN Added for X (Mesa) **/
|
2008-06-06 22:13:59 +01:00
|
|
|
#ifndef EGLAPI
|
|
|
|
#define EGLAPI extern
|
|
|
|
#endif
|
|
|
|
|
2008-05-27 20:43:34 +01:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
typedef Display *NativeDisplayType;
|
|
|
|
typedef Window NativeWindowType;
|
|
|
|
typedef Pixmap NativePixmapType;
|
|
|
|
/** END Added for X (Mesa) **/
|
|
|
|
|
2008-06-05 22:07:03 +01:00
|
|
|
#endif
|
|
|
|
|
2008-05-27 20:43:01 +01:00
|
|
|
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
|
|
|
|
typedef NativeDisplayType EGLNativeDisplayType;
|
|
|
|
typedef NativePixmapType EGLNativePixmapType;
|
|
|
|
typedef NativeWindowType EGLNativeWindowType;
|
|
|
|
|
|
|
|
#endif /* __eglplatform_h */
|