patch to import Jon Smirl's work from Bitkeeper
[mesa.git] / src / glu / mini / gluP.h
1 /* $Id: gluP.h,v 1.2 2003/08/22 20:11:43 brianp Exp $ */
2
3 /*
4 * Mesa 3-D graphics library
5 * Version: 3.3
6 * Copyright (C) 1995-2000 Brian Paul
7 *
8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This library is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Library General Public License for more details.
17 *
18 * You should have received a copy of the GNU Library General Public
19 * License along with this library; if not, write to the Free
20 * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
21 */
22
23
24 /*
25 * This file allows the GLU code to be compiled either with the Mesa
26 * headers or with the real OpenGL headers.
27 */
28
29
30 #ifndef GLUP_H
31 #define GLUP_H
32
33
34 #include <GL/gl.h>
35 #include <GL/glu.h>
36 #include <string.h>
37
38
39 #if defined(_WIN32) && !defined(__WIN32__)
40 # define __WIN32__
41 #endif
42
43 #if !defined(OPENSTEP) && (defined(__WIN32__) || defined(__CYGWIN__))
44 # pragma warning( disable : 4068 ) /* unknown pragma */
45 # pragma warning( disable : 4710 ) /* function 'foo' not inlined */
46 # pragma warning( disable : 4711 ) /* function 'foo' selected for automatic inline expansion */
47 # pragma warning( disable : 4127 ) /* conditional expression is constant */
48 # if defined(MESA_MINWARN)
49 # pragma warning( disable : 4244 ) /* '=' : conversion from 'const double ' to 'float ', possible loss of data */
50 # pragma warning( disable : 4018 ) /* '<' : signed/unsigned mismatch */
51 # pragma warning( disable : 4305 ) /* '=' : truncation from 'const double ' to 'float ' */
52 # pragma warning( disable : 4550 ) /* 'function' undefined; assuming extern returning int */
53 # pragma warning( disable : 4761 ) /* integral size mismatch in argument; conversion supplied */
54 # endif
55 # if defined(_MSC_VER) && defined(BUILD_GL32) /* tag specify we're building mesa as a DLL */
56 # define GLAPI __declspec(dllexport)
57 # define WGLAPI __declspec(dllexport)
58 # elif defined(_MSC_VER) && defined(_DLL) /* tag specifying we're building for DLL runtime support */
59 # define GLAPI __declspec(dllimport)
60 # define WGLAPI __declspec(dllimport)
61 # else /* for use with static link lib build of Win32 edition only */
62 # define GLAPI extern
63 # define WGLAPI __declspec(dllimport)
64 # endif /* _STATIC_MESA support */
65 # define GLAPIENTRY __stdcall
66 # define GLAPIENTRYP __stdcall *
67 # define GLCALLBACK __stdcall
68 # define GLCALLBACKP __stdcall *
69 # if defined(__CYGWIN__)
70 # define GLCALLBACKPCAST *
71 # else
72 # define GLCALLBACKPCAST __stdcall *
73 # endif
74 # define GLWINAPI __stdcall
75 # define GLWINAPIV __cdecl
76 #else
77 /* non-Windows compilation */
78 # define GLAPI extern
79 # define GLAPIENTRY
80 # define GLAPIENTRYP *
81 # define GLCALLBACK
82 # define GLCALLBACKP *
83 # define GLCALLBACKPCAST *
84 # define GLWINAPI
85 # define GLWINAPIV
86 #endif /* WIN32 / CYGWIN bracket */
87
88 /* compatibility guard so we don't need to change client code */
89
90 #if defined(_WIN32) && !defined(_WINDEF_) && !defined(_GNU_H_WINDOWS32_BASE) && !defined(OPENSTEP)
91 # define CALLBACK GLCALLBACK
92 typedef int (GLAPIENTRY *PROC)();
93 typedef void *HGLRC;
94 typedef void *HDC;
95 typedef unsigned long COLORREF;
96 #endif
97
98 #if defined(_WIN32) && !defined(_WINGDI_) && !defined(_GNU_H_WINDOWS32_DEFINES) && !defined(OPENSTEP)
99 # define WGL_FONT_LINES 0
100 # define WGL_FONT_POLYGONS 1
101 #ifndef _GNU_H_WINDOWS32_FUNCTIONS
102 # ifdef UNICODE
103 # define wglUseFontBitmaps wglUseFontBitmapsW
104 # define wglUseFontOutlines wglUseFontOutlinesW
105 # else
106 # define wglUseFontBitmaps wglUseFontBitmapsA
107 # define wglUseFontOutlines wglUseFontOutlinesA
108 # endif /* !UNICODE */
109 #endif /* _GNU_H_WINDOWS32_FUNCTIONS */
110 typedef struct tagLAYERPLANEDESCRIPTOR LAYERPLANEDESCRIPTOR, *PLAYERPLANEDESCRIPTOR, *LPLAYERPLANEDESCRIPTOR;
111 typedef struct _GLYPHMETRICSFLOAT GLYPHMETRICSFLOAT, *PGLYPHMETRICSFLOAT, *LPGLYPHMETRICSFLOAT;
112 typedef struct tagPIXELFORMATDESCRIPTOR PIXELFORMATDESCRIPTOR, *PPIXELFORMATDESCRIPTOR, *LPPIXELFORMATDESCRIPTOR;
113 #include <gl/mesa_wgl.h>
114 #endif
115
116
117
118 #ifndef GLU_TESS_ERROR9
119 /* If we're using the real OpenGL header files... */
120 # define GLU_TESS_ERROR9 100159
121 #endif
122
123
124 #define GLU_NO_ERROR GL_NO_ERROR
125
126
127 /* for Sun: */
128 #ifdef SUNOS4
129 #define MEMCPY( DST, SRC, BYTES) \
130 memcpy( (char *) (DST), (char *) (SRC), (int) (BYTES) )
131 #else
132 #define MEMCPY( DST, SRC, BYTES) \
133 memcpy( (void *) (DST), (void *) (SRC), (size_t) (BYTES) )
134 #endif
135
136
137 #ifndef NULL
138 # define NULL 0
139 #endif
140
141
142 #endif