diff options
author | Yaron Cohen-Tal <yaronct@gmail.com> | 2015-08-03 21:07:37 +0300 |
---|---|---|
committer | Yaron Cohen-Tal <yaronct@gmail.com> | 2015-08-26 19:41:51 +0300 |
commit | 06fd4a271ad88476d8c6a37d49b6a8af5a11d988 (patch) | |
tree | 6e0422152c8ee3f2a984c5a77dbf0bbbca701618 /include/epoxy/gl.h | |
parent | 540952010bc2707bedfbbfe89c77d1a1640e76ae (diff) | |
download | libepoxy-06fd4a271ad88476d8c6a37d49b6a8af5a11d988.tar.gz |
Add support for CMake (no support for building/running the tests yet). Fix support for Android. Add built-in support for building with EGL support (using "khrplatform.h" and "eglplatform.h" which are distributed together with Epoxy, and should work with any platform).
Diffstat (limited to 'include/epoxy/gl.h')
-rw-r--r-- | include/epoxy/gl.h | 64 |
1 files changed, 29 insertions, 35 deletions
diff --git a/include/epoxy/gl.h b/include/epoxy/gl.h index d150da4..49ca270 100644 --- a/include/epoxy/gl.h +++ b/include/epoxy/gl.h @@ -30,55 +30,41 @@ #ifndef EPOXY_GL_H #define EPOXY_GL_H -#include <epoxy/common.h> -#include <stdbool.h> +#if defined(__glplatform_h_) || defined(__gl_h_) || defined(__glext_h_) \ + || defined(__gl2platform_h_) || defined(__gl2_h_) || defined(__gl2ext_h_) \ + || defined(__gl3platform_h_) || defined(__gl3_h_) || defined(__gl31_h_) -#ifdef __cplusplus -extern "C" { +#error "epoxy/gl.h" must be included before (or in place of) the desktop OpenGL / OpenGL ES headers. #endif -#if defined(__gl_h_) || defined(__glext_h_) -#error epoxy/gl.h must be included before (or in place of) GL/gl.h -#else +#define __glplatform_h_ #define __gl_h_ #define __glext_h_ +#define __gl2platform_h +#define __gl2_h_ 1 +#define __gl2ext_h_ 1 +#define __gl3platform_h_ +#define __gl3_h_ 1 +#define __gl31_h_ 1 + +#include "epoxy/common.h" +#include "epoxy/khrplatform.h" +#ifdef _WIN32 +# include <Windows.h> #endif -#define KHRONOS_SUPPORT_INT64 1 -#define KHRONOS_SUPPORT_FLOAT 1 -#define KHRONOS_APIATTRIBUTES - -#ifndef _WIN32 -/* APIENTRY and GLAPIENTRY are not used on Linux or Mac. */ -#define APIENTRY -#define GLAPIENTRY -#define EPOXY_CALLSPEC -#define GLAPI -#define KHRONOS_APIENTRY -#define KHRONOS_APICALL - -#else -#ifndef APIENTRY -#define APIENTRY __stdcall +#ifdef __cplusplus +extern "C" { #endif #ifndef GLAPIENTRY -#define GLAPIENTRY APIENTRY +#define GLAPIENTRY KHRONOS_APIENTRY #endif -#ifndef EPOXY_CALLSPEC -#define EPOXY_CALLSPEC __stdcall -#endif - -#ifndef GLAPI -#define GLAPI extern +#ifndef APIENTRY +#define APIENTRY GLAPIENTRY #endif -#define KHRONOS_APIENTRY __stdcall -#define KHRONOS_APICALL __declspec(dllimport) __stdcall - -#endif /* _WIN32 */ - #ifndef APIENTRYP #define APIENTRYP APIENTRY * #endif @@ -87,6 +73,14 @@ extern "C" { #define GLAPIENTRYP GLAPIENTRY * #endif +#define EPOXY_CALLSPEC KHRONOS_APIENTRY + +#if (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590)) +# define GLAPI __attribute__((visibility("default"))) +#else +# define GLAPI extern +#endif + #include "epoxy/gl_generated.h" EPOXY_IMPORTEXPORT bool epoxy_has_gl_extension(const char *extension); |