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