Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Device.h

Go to the documentation of this file.
00001 
00002 /*
00003     TEDDY - General graphics application library
00004     Copyright (C) 1999-2002  Timo Suoranta
00005     tksuoran@cc.helsinki.fi
00006 
00007     This library is free software; you can redistribute it and/or
00008     modify it under the terms of the GNU Lesser General Public
00009     License as published by the Free Software Foundation; either
00010     version 2.1 of the License, or (at your option) any later version.
00011 
00012     This library is distributed in the hope that it will be useful,
00013     but WITHOUT ANY WARRANTY; without even the implied warranty of
00014     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00015     Lesser General Public License for more details.
00016 
00017     You should have received a copy of the GNU Lesser General Public
00018     License along with this library; if not, write to the Free Software
00019     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00020 
00021     $Id: Device.h,v 1.4 2002/01/11 14:34:59 tksuoran Exp $
00022 */
00023 
00024 
00034 #ifndef TEDDY__GRAPHICS__DEVICE__H
00035 #define TEDDY__GRAPHICS__DEVICE__H
00036 
00037 
00038 #include "Teddy/TeddyConfig.h"
00039 
00040 #ifndef SWIG
00041 
00042 
00043 /*  Choose either OpenGL or TinyGL includes and definitions  */
00044 #if defined (USE_TINY_GL)
00045 
00046 /*  TinyGL on all platforms  */
00047 # include "Teddy/TinyGL/gl_gl.h"
00048 # include "Teddy/TinyGL/gl_sdlswgl.h"
00049 
00050 #else
00051 
00052 /*  OpenGL on Win32  */
00053 # if defined (_WIN32)
00054 
00055 #  ifndef APIENTRY
00056 #   define GLUT_APIENTRY_DEFINED
00057 #   if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__MINGW32__) /*not sure about cygwin*/
00058 #    define APIENTRY    __stdcall
00059 #   else
00060 #    define APIENTRY
00061 #   endif
00062 #  endif
00063 
00064 #  ifndef CALLBACK
00065 #   if (defined(_M_MRX000) || defined(_M_IX86) || defined(_M_ALPHA) || defined(_M_PPC)) && !defined(MIDL_PASS)
00066 #    define CALLBACK __stdcall
00067 #   else
00068 #    define CALLBACK
00069 #   endif
00070 #  endif
00071 
00072 #  ifndef WINGDIAPI
00073 #   define GLUT_WINGDIAPI_DEFINED
00074 #   define WINGDIAPI __declspec(dllimport)
00075 #  endif
00076 
00077 #  if !defined(_WCHAR_T_DEFINED) && defined(_MSC_VER)
00078 typedef unsigned short wchar_t;
00079 #   define _WCHAR_T_DEFINED
00080 #  endif
00081 
00082 # endif  /*  Choose platform for OpenGL  */
00083 
00084 #if defined (__APPLE__)  /*  Macintosh  */
00085 # include <OpenGL/gl.h>
00086 #else
00087 # include <GL/gl.h>      /*  Rest  */
00088 #endif
00089 
00090 #endif   /*  Choose TinyGL or OpenGL  */
00091 
00092 
00093 /*  ---------------------------------------------------------------------------------------------  */
00094 
00095 #define GL_LIGHT_MODEL_COLOR_CONTROL_EXT  0x81F8
00096 #define GL_SINGLE_COLOR_EXT               0x81F9
00097 #define GL_SEPARATE_SPECULAR_COLOR_EXT    0x81FA
00098 
00099 /*  ---------------------------------------------------------------------------------------------  */
00100 
00101 
00102 /*  Visual Studio Linking with SDL and either OpenGL or TinyGL  */
00103 #if defined( _MSC_VER )
00104 # if defined( _DEBUG )
00105 #  pragma comment (lib, "SDLD.lib"     )
00106 #  pragma comment (lib, "SDLmainD.lib" )
00107 # else
00108 #  pragma comment (lib, "SDL.lib"     )
00109 #  pragma comment (lib, "SDLmain.lib" )
00110 # endif
00111 # if defined( USE_OPEN_GL ) && !defined( USE_TINY_GL )
00112 #  pragma comment (lib, "opengl32.lib")
00113 # endif
00114 #endif
00115 
00116 
00117 #endif  /*  SWIG  */
00118 
00119 #endif  /*  TEDDY__GRAPHICS__DEVICE__H  */
00120