2003-01-22 00:45:36 +08:00
|
|
|
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield
|
|
|
|
*
|
|
|
|
* This library is open source and may be redistributed and/or modified under
|
|
|
|
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
|
|
|
|
* (at your option) any later version. The full license is in LICENSE file
|
|
|
|
* included with this distribution, and on the openscenegraph.org website.
|
|
|
|
*
|
|
|
|
* This library is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* OpenSceneGraph Public License for more details.
|
|
|
|
*/
|
2001-10-04 23:12:57 +08:00
|
|
|
|
2001-01-11 00:32:10 +08:00
|
|
|
#ifndef OSG_GL
|
|
|
|
#define OSG_GL 1
|
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
#ifndef WIN32
|
2001-01-11 00:32:10 +08:00
|
|
|
|
2001-09-29 04:10:41 +08:00
|
|
|
// non windows, doesn't require nonsense as seen below :-)
|
2001-09-20 05:08:56 +08:00
|
|
|
#ifndef __gl_h_
|
2004-03-08 19:02:05 +08:00
|
|
|
#ifdef __APPLE__
|
2001-10-04 05:44:07 +08:00
|
|
|
#include <OpenGL/gl.h>
|
|
|
|
#else
|
2002-08-25 03:35:00 +08:00
|
|
|
#include <GL/gl.h>
|
|
|
|
#endif
|
2001-09-20 05:08:56 +08:00
|
|
|
#endif
|
2001-01-11 00:32:10 +08:00
|
|
|
|
2001-09-20 05:08:56 +08:00
|
|
|
// required for compatibility with glext.h sytle function definitions of
|
|
|
|
// OpenGL extensions, such as in src/osg/Point.cpp.
|
|
|
|
#ifndef APIENTRY
|
|
|
|
#define APIENTRY
|
|
|
|
#endif
|
2001-01-11 00:32:10 +08:00
|
|
|
|
2002-08-25 03:35:00 +08:00
|
|
|
#else // WIN32
|
2001-01-11 00:32:10 +08:00
|
|
|
|
2002-08-25 03:35:00 +08:00
|
|
|
#if defined(__CYGWIN__) || defined(__MINGW32__)
|
2002-01-04 05:34:57 +08:00
|
|
|
|
2002-08-25 03:35:00 +08:00
|
|
|
#ifndef APIENTRY
|
|
|
|
#define GLUT_APIENTRY_DEFINED
|
|
|
|
#define APIENTRY __stdcall
|
|
|
|
#endif
|
|
|
|
// XXX This is from Win32's <winnt.h>
|
|
|
|
#ifndef CALLBACK
|
|
|
|
#define CALLBACK __stdcall
|
|
|
|
#endif
|
2002-01-04 05:34:57 +08:00
|
|
|
|
2002-08-25 03:35:00 +08:00
|
|
|
#else // ! __CYGWIN__
|
2002-01-04 05:34:57 +08:00
|
|
|
|
2002-08-25 03:35:00 +08:00
|
|
|
// Under windows avoid including <windows.h>
|
|
|
|
// to avoid name space pollution, but Win32's <GL/gl.h>
|
|
|
|
// needs APIENTRY and WINGDIAPI defined properly.
|
|
|
|
// XXX This is from Win32's <windef.h>
|
|
|
|
#ifndef APIENTRY
|
|
|
|
#define GLUT_APIENTRY_DEFINED
|
|
|
|
#if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED)
|
2002-08-27 22:00:04 +08:00
|
|
|
#define WINAPI __stdcall
|
|
|
|
#define APIENTRY WINAPI
|
2002-08-25 03:35:00 +08:00
|
|
|
#else
|
|
|
|
#define APIENTRY
|
|
|
|
#endif
|
|
|
|
#endif
|
2002-01-04 05:34:57 +08:00
|
|
|
|
2002-08-25 03:35:00 +08:00
|
|
|
// XXX This is from Win32's <winnt.h>
|
|
|
|
#ifndef CALLBACK
|
|
|
|
#if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
|
|
|
|
#define CALLBACK __stdcall
|
|
|
|
#else
|
|
|
|
#define CALLBACK
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#endif // __CYGWIN__
|
|
|
|
|
|
|
|
// XXX This is from Win32's <wingdi.h> and <winnt.h>
|
|
|
|
#ifndef WINGDIAPI
|
|
|
|
#define GLUT_WINGDIAPI_DEFINED
|
2002-08-27 22:00:04 +08:00
|
|
|
#define DECLSPEC_IMPORT __declspec(dllimport)
|
|
|
|
#define WINGDIAPI DECLSPEC_IMPORT
|
2002-08-25 03:35:00 +08:00
|
|
|
#endif
|
2002-12-05 01:34:52 +08:00
|
|
|
// XXX This is from Win32's <ctype.h>
|
|
|
|
|
|
|
|
#if !defined(_WCHAR_T_DEFINED) && !(defined(__GNUC__)&&(__GNUC__ == 3))
|
2002-08-25 03:35:00 +08:00
|
|
|
typedef unsigned short wchar_t;
|
|
|
|
#define _WCHAR_T_DEFINED
|
|
|
|
#endif
|
2001-01-11 00:32:10 +08:00
|
|
|
|
|
|
|
#ifndef __gl_h_
|
|
|
|
#include <GL/gl.h>
|
|
|
|
#endif
|
|
|
|
|
2002-08-25 03:35:00 +08:00
|
|
|
#endif // WIN32
|
2001-01-11 00:32:10 +08:00
|
|
|
|
2003-09-06 04:48:42 +08:00
|
|
|
inline void glLoadMatrix(const float* mat) { glLoadMatrixf((GLfloat*)mat); }
|
|
|
|
inline void glLoadMatrix(const double* mat) { glLoadMatrixd((GLdouble*)mat); }
|
|
|
|
inline void glMultMatrix(const float* mat) { glMultMatrixf((GLfloat*)mat); }
|
|
|
|
inline void glMultMatrix(const double* mat) { glMultMatrixd((GLdouble*)mat); }
|
|
|
|
|
|
|
|
|
2001-01-11 00:32:10 +08:00
|
|
|
#endif // __osgGL_h
|