mirror of
https://github.com/nigels-com/glew.git
synced 2025-12-20 06:01:48 +00:00
256 lines
5.8 KiB
C
256 lines
5.8 KiB
C
#ifndef __glew_h__
|
|
#define __glew_h__
|
|
#define __GLEW_H__
|
|
|
|
#if defined(__gl_h_) || defined(__GL_H__) || defined(_GL_H) || defined(__X_GL_H)
|
|
#error gl.h included before glew.h
|
|
#endif
|
|
#if defined(__gl2_h_)
|
|
#error gl2.h included before glew.h
|
|
#endif
|
|
#if defined(__gltypes_h_)
|
|
#error gltypes.h included before glew.h
|
|
#endif
|
|
#if defined(__REGAL_H__)
|
|
#error Regal.h included before glew.h
|
|
#endif
|
|
#if defined(__glext_h_) || defined(__GLEXT_H_)
|
|
#error glext.h included before glew.h
|
|
#endif
|
|
#if defined(__gl_ATI_h_)
|
|
#error glATI.h included before glew.h
|
|
#endif
|
|
|
|
#define __gl_h_
|
|
#define __gl2_h_
|
|
#define __GL_H__
|
|
#define _GL_H
|
|
#define __gltypes_h_
|
|
#define __REGAL_H__
|
|
#define __X_GL_H
|
|
#define __glext_h_
|
|
#define __GLEXT_H_
|
|
#define __gl_ATI_h_
|
|
|
|
#if defined(_WIN32)
|
|
|
|
/*
|
|
* GLEW does not include <windows.h> to avoid name space pollution.
|
|
* GL needs GLAPI and GLAPIENTRY, GLU needs APIENTRY, CALLBACK, and wchar_t
|
|
* defined properly.
|
|
*/
|
|
/* <windef.h> and <gl.h>*/
|
|
#ifdef APIENTRY
|
|
# ifndef GLAPIENTRY
|
|
# define GLAPIENTRY APIENTRY
|
|
# endif
|
|
# ifndef GLEWAPIENTRY
|
|
# define GLEWAPIENTRY APIENTRY
|
|
# endif
|
|
#else
|
|
#define GLEW_APIENTRY_DEFINED
|
|
# if defined(__MINGW32__) || defined(__CYGWIN__) || (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__)
|
|
# define APIENTRY __stdcall
|
|
# ifndef GLAPIENTRY
|
|
# define GLAPIENTRY __stdcall
|
|
# endif
|
|
# ifndef GLEWAPIENTRY
|
|
# define GLEWAPIENTRY __stdcall
|
|
# endif
|
|
# else
|
|
# define APIENTRY
|
|
# endif
|
|
#endif
|
|
#ifndef GLAPI
|
|
# if defined(__MINGW32__) || defined(__CYGWIN__)
|
|
# define GLAPI extern
|
|
# endif
|
|
#endif
|
|
/* <winnt.h> */
|
|
#ifndef CALLBACK
|
|
#define GLEW_CALLBACK_DEFINED
|
|
# if defined(__MINGW32__) || defined(__CYGWIN__)
|
|
# define CALLBACK __attribute__ ((__stdcall__))
|
|
# elif (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
|
|
# define CALLBACK __stdcall
|
|
# else
|
|
# define CALLBACK
|
|
# endif
|
|
#endif
|
|
/* <wingdi.h> and <winnt.h> */
|
|
#ifndef WINGDIAPI
|
|
#define GLEW_WINGDIAPI_DEFINED
|
|
#define WINGDIAPI __declspec(dllimport)
|
|
#endif
|
|
/* <ctype.h> */
|
|
#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(_WCHAR_T_DEFINED)
|
|
typedef unsigned short wchar_t;
|
|
# define _WCHAR_T_DEFINED
|
|
#endif
|
|
/* <stddef.h> */
|
|
#if !defined(_W64)
|
|
# if !defined(__midl) && (defined(_X86_) || defined(_M_IX86)) && defined(_MSC_VER) && _MSC_VER >= 1300
|
|
# define _W64 __w64
|
|
# else
|
|
# define _W64
|
|
# endif
|
|
#endif
|
|
#if !defined(_PTRDIFF_T_DEFINED) && !defined(_PTRDIFF_T_) && !defined(__MINGW64__)
|
|
# ifdef _WIN64
|
|
typedef __int64 ptrdiff_t;
|
|
# else
|
|
typedef _W64 int ptrdiff_t;
|
|
# endif
|
|
# define _PTRDIFF_T_DEFINED
|
|
# define _PTRDIFF_T_
|
|
#endif
|
|
|
|
#ifndef GLAPI
|
|
# if defined(__MINGW32__) || defined(__CYGWIN__)
|
|
# define GLAPI extern
|
|
# else
|
|
# define GLAPI WINGDIAPI
|
|
# endif
|
|
#endif
|
|
|
|
/*
|
|
* GLEW_STATIC is defined for static library.
|
|
* GLEW_BUILD is defined for building the DLL library.
|
|
*/
|
|
|
|
#ifdef GLEW_STATIC
|
|
# define GLEWAPI extern
|
|
#else
|
|
# ifdef GLEW_BUILD
|
|
# define GLEWAPI extern __declspec(dllexport)
|
|
# else
|
|
# define GLEWAPI extern __declspec(dllimport)
|
|
# endif
|
|
#endif
|
|
|
|
#else /* _UNIX */
|
|
|
|
/*
|
|
* Needed for ptrdiff_t in turn needed by VBO. This is defined by ISO
|
|
* C. On my system, this amounts to _3 lines_ of included code, all of
|
|
* them pretty much harmless. If you know of a way of detecting 32 vs
|
|
* 64 _targets_ at compile time you are free to replace this with
|
|
* something that's portable. For now, _this_ is the portable solution.
|
|
* (mem, 2004-01-04)
|
|
*/
|
|
|
|
#include <stddef.h>
|
|
|
|
/* SGI MIPSPro doesn't like stdint.h in C++ mode */
|
|
/* ID: 3376260 Solaris 9 has inttypes.h, but not stdint.h */
|
|
|
|
#if (defined(__sgi) || defined(__sun)) && !defined(__GNUC__)
|
|
#include <inttypes.h>
|
|
#else
|
|
#include <stdint.h>
|
|
#endif
|
|
|
|
#define GLEW_APIENTRY_DEFINED
|
|
#define APIENTRY
|
|
|
|
/*
|
|
* GLEW_STATIC is defined for static library.
|
|
*/
|
|
|
|
#ifdef GLEW_STATIC
|
|
# define GLEWAPI extern
|
|
#else
|
|
# if defined(__GNUC__) && __GNUC__>=4
|
|
# define GLEWAPI extern __attribute__ ((visibility("default")))
|
|
# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
|
|
# define GLEWAPI extern __global
|
|
# else
|
|
# define GLEWAPI extern
|
|
# endif
|
|
#endif
|
|
|
|
/* <glu.h> */
|
|
#ifndef GLAPI
|
|
#define GLAPI extern
|
|
#endif
|
|
|
|
#endif /* _WIN32 */
|
|
|
|
#ifndef GLAPIENTRY
|
|
#define GLAPIENTRY
|
|
#endif
|
|
|
|
#ifndef GLEWAPIENTRY
|
|
#define GLEWAPIENTRY
|
|
#endif
|
|
|
|
#define GLEW_VAR_EXPORT GLEWAPI
|
|
#define GLEW_FUN_EXPORT GLEWAPI
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* ----------------------------- GL_VERSION_1_0 ---------------------------- */
|
|
|
|
#ifndef GL_VERSION_1_0
|
|
#define GL_VERSION_1_0 1
|
|
|
|
typedef unsigned int GLenum;
|
|
typedef unsigned int GLbitfield;
|
|
typedef unsigned int GLuint;
|
|
typedef int GLint;
|
|
typedef int GLsizei;
|
|
typedef unsigned char GLboolean;
|
|
typedef signed char GLbyte;
|
|
typedef short GLshort;
|
|
typedef unsigned char GLubyte;
|
|
typedef unsigned short GLushort;
|
|
typedef unsigned long GLulong;
|
|
typedef float GLfloat;
|
|
typedef float GLclampf;
|
|
typedef double GLdouble;
|
|
typedef double GLclampd;
|
|
typedef void GLvoid;
|
|
#if defined(_MSC_VER) && _MSC_VER < 1400
|
|
typedef __int64 GLint64EXT;
|
|
typedef unsigned __int64 GLuint64EXT;
|
|
#elif defined(_MSC_VER) || defined(__BORLANDC__)
|
|
typedef signed long long GLint64EXT;
|
|
typedef unsigned long long GLuint64EXT;
|
|
#else
|
|
# if defined(__MINGW32__) || defined(__CYGWIN__)
|
|
#include <inttypes.h>
|
|
# endif
|
|
typedef int64_t GLint64EXT;
|
|
typedef uint64_t GLuint64EXT;
|
|
#endif
|
|
typedef GLint64EXT GLint64;
|
|
typedef GLuint64EXT GLuint64;
|
|
typedef struct __GLsync *GLsync;
|
|
|
|
typedef char GLchar;
|
|
|
|
#endif /* GL_VERSION_1_0 */
|
|
|
|
/* ---------------------------------- GLU ---------------------------------- */
|
|
|
|
#ifndef GLEW_NO_GLU
|
|
# ifdef __APPLE__
|
|
# include <Availability.h>
|
|
# if defined(__IPHONE_OS_VERSION_MIN_REQUIRED)
|
|
# define GLEW_NO_GLU
|
|
# endif
|
|
# endif
|
|
#endif
|
|
|
|
#ifndef GLEW_NO_GLU
|
|
/* this is where we can safely include GLU */
|
|
# if defined(__APPLE__) && defined(__MACH__)
|
|
# include <OpenGL/glu.h>
|
|
# else
|
|
# include <GL/glu.h>
|
|
# endif
|
|
#endif
|
|
|