gl.h revision e52adb7b
1e52adb7bSmrg/*
2e52adb7bSmrg * Copyright © 2013 Intel Corporation
3e52adb7bSmrg *
4e52adb7bSmrg * Permission is hereby granted, free of charge, to any person obtaining a
5e52adb7bSmrg * copy of this software and associated documentation files (the "Software"),
6e52adb7bSmrg * to deal in the Software without restriction, including without limitation
7e52adb7bSmrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8e52adb7bSmrg * and/or sell copies of the Software, and to permit persons to whom the
9e52adb7bSmrg * Software is furnished to do so, subject to the following conditions:
10e52adb7bSmrg *
11e52adb7bSmrg * The above copyright notice and this permission notice (including the next
12e52adb7bSmrg * paragraph) shall be included in all copies or substantial portions of the
13e52adb7bSmrg * Software.
14e52adb7bSmrg *
15e52adb7bSmrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16e52adb7bSmrg * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17e52adb7bSmrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
18e52adb7bSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19e52adb7bSmrg * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20e52adb7bSmrg * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21e52adb7bSmrg * IN THE SOFTWARE.
22e52adb7bSmrg */
23e52adb7bSmrg
24e52adb7bSmrg/** @file gl.h
25e52adb7bSmrg *
26e52adb7bSmrg * Provides an implementation of a GL dispatch layer using either
27e52adb7bSmrg * global function pointers or a hidden vtable.
28e52adb7bSmrg */
29e52adb7bSmrg
30e52adb7bSmrg#ifndef EPOXY_GL_H
31e52adb7bSmrg#define EPOXY_GL_H
32e52adb7bSmrg
33e52adb7bSmrg#ifdef __cplusplus
34e52adb7bSmrgextern "C" {
35e52adb7bSmrg#endif
36e52adb7bSmrg
37e52adb7bSmrg#include <stdbool.h>
38e52adb7bSmrg
39e52adb7bSmrg#if defined(__gl_h_) || defined(__glext_h_)
40e52adb7bSmrg#error epoxy/gl.h must be included before (or in place of) GL/gl.h
41e52adb7bSmrg#else
42e52adb7bSmrg#define __gl_h_
43e52adb7bSmrg#define __glext_h_
44e52adb7bSmrg#endif
45e52adb7bSmrg
46e52adb7bSmrg#define KHRONOS_SUPPORT_INT64   1
47e52adb7bSmrg#define KHRONOS_SUPPORT_FLOAT   1
48e52adb7bSmrg#define KHRONOS_APIATTRIBUTES
49e52adb7bSmrg
50e52adb7bSmrg#ifndef _WIN32
51e52adb7bSmrg/* APIENTRY and GLAPIENTRY are not used on Linux or Mac. */
52e52adb7bSmrg#define APIENTRY
53e52adb7bSmrg#define GLAPIENTRY
54e52adb7bSmrg#define EPOXY_IMPORTEXPORT
55e52adb7bSmrg#define EPOXY_CALLSPEC
56e52adb7bSmrg#define GLAPI
57e52adb7bSmrg#define KHRONOS_APIENTRY
58e52adb7bSmrg#define KHRONOS_APICALL
59e52adb7bSmrg
60e52adb7bSmrg#else
61e52adb7bSmrg#ifndef APIENTRY
62e52adb7bSmrg#define APIENTRY __stdcall
63e52adb7bSmrg#endif
64e52adb7bSmrg
65e52adb7bSmrg#ifndef GLAPIENTRY
66e52adb7bSmrg#define GLAPIENTRY APIENTRY
67e52adb7bSmrg#endif
68e52adb7bSmrg
69e52adb7bSmrg#ifndef EPOXY_CALLSPEC
70e52adb7bSmrg#define EPOXY_CALLSPEC __stdcall
71e52adb7bSmrg#endif
72e52adb7bSmrg
73e52adb7bSmrg#ifndef EPOXY_IMPORTEXPORT
74e52adb7bSmrg#define EPOXY_IMPORTEXPORT __declspec(dllimport)
75e52adb7bSmrg#endif
76e52adb7bSmrg
77e52adb7bSmrg#ifndef GLAPI
78e52adb7bSmrg#define GLAPI extern
79e52adb7bSmrg#endif
80e52adb7bSmrg
81e52adb7bSmrg#define KHRONOS_APIENTRY __stdcall
82e52adb7bSmrg#define KHRONOS_APICALL __declspec(dllimport) __stdcall
83e52adb7bSmrg
84e52adb7bSmrg#endif /* _WIN32 */
85e52adb7bSmrg
86e52adb7bSmrg#ifndef APIENTRYP
87e52adb7bSmrg#define APIENTRYP APIENTRY *
88e52adb7bSmrg#endif
89e52adb7bSmrg
90e52adb7bSmrg#ifndef GLAPIENTRYP
91e52adb7bSmrg#define GLAPIENTRYP GLAPIENTRY *
92e52adb7bSmrg#endif
93e52adb7bSmrg
94e52adb7bSmrg#include "epoxy/gl_generated.h"
95e52adb7bSmrg
96e52adb7bSmrgEPOXY_IMPORTEXPORT bool epoxy_has_gl_extension(const char *extension);
97e52adb7bSmrgEPOXY_IMPORTEXPORT bool epoxy_is_desktop_gl(void);
98e52adb7bSmrgEPOXY_IMPORTEXPORT int epoxy_gl_version(void);
99e52adb7bSmrg
100e52adb7bSmrg#ifdef __cplusplus
101e52adb7bSmrg} /* extern "C" */
102e52adb7bSmrg#endif
103e52adb7bSmrg
104e52adb7bSmrg#endif /* EPOXY_GL_H */
105