summaryrefslogtreecommitdiff
path: root/include/epoxy/gl.h
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2016-12-07 14:45:14 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2016-12-07 14:45:14 +0000
commit8dead45cb366bf5c08539bef2ccaa36b80eb1483 (patch)
tree25bdc2041b9d00d0e2e1e46ece0f96b8aaca0527 /include/epoxy/gl.h
parent0aa9d1bc831683bfe93980eb3cffa1f0c2f058fb (diff)
downloadlibepoxy-8dead45cb366bf5c08539bef2ccaa36b80eb1483.tar.gz
Revert all changes since 8bbc0d40
Most of the changes that happened after commit 8bbc0d40 broke epoxy pretty much irreparably because of the CMake build and the attempt at making libepoxy a static library that can be copy-pasted into another project without generating files. Since all the commits are entangled, and are full of unrelated changes, we cannot simply do a localized set of reverts; instead, we need to hit the reset button. From this point forward, we're going to improve libepoxy's build while attempting to keep the existing build system working. This may mean reinstating the CMake build system at a later date.
Diffstat (limited to 'include/epoxy/gl.h')
-rw-r--r--include/epoxy/gl.h71
1 files changed, 40 insertions, 31 deletions
diff --git a/include/epoxy/gl.h b/include/epoxy/gl.h
index 333b5e4..0be3a66 100644
--- a/include/epoxy/gl.h
+++ b/include/epoxy/gl.h
@@ -30,41 +30,59 @@
#ifndef EPOXY_GL_H
#define EPOXY_GL_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_)
-
-#error "epoxy/gl.h" must be included before (or in place of) the desktop OpenGL / OpenGL ES headers.
+#ifdef __cplusplus
+extern "C" {
#endif
-#define __glplatform_h_
+#include <stdbool.h>
+
+#if defined(__gl_h_) || defined(__glext_h_)
+#error epoxy/gl.h must be included before (or in place of) GL/gl.h
+#else
#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
-#ifdef __cplusplus
-extern "C" {
+#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_IMPORTEXPORT
+#define EPOXY_CALLSPEC
+#define GLAPI
+#define KHRONOS_APIENTRY
+#define KHRONOS_APICALL
+
+#else
+#ifndef APIENTRY
+#define APIENTRY __stdcall
#endif
#ifndef GLAPIENTRY
-#define GLAPIENTRY KHRONOS_APIENTRY
+#define GLAPIENTRY APIENTRY
#endif
-#ifndef APIENTRY
-#define APIENTRY GLAPIENTRY
+#ifndef EPOXY_CALLSPEC
+#define EPOXY_CALLSPEC __stdcall
+#endif
+
+#ifndef EPOXY_IMPORTEXPORT
+#define EPOXY_IMPORTEXPORT __declspec(dllimport)
#endif
+#ifndef GLAPI
+#define GLAPI extern
+#endif
+
+#define KHRONOS_APIENTRY __stdcall
+#define KHRONOS_APICALL __declspec(dllimport) __stdcall
+
+#endif /* _WIN32 */
+
#ifndef APIENTRYP
#define APIENTRYP APIENTRY *
#endif
@@ -73,20 +91,11 @@ 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);
EPOXY_IMPORTEXPORT bool epoxy_is_desktop_gl(void);
EPOXY_IMPORTEXPORT int epoxy_gl_version(void);
-EPOXY_IMPORTEXPORT bool epoxy_current_context_is_egl(void);
#ifdef __cplusplus
} /* extern "C" */