fbsdk/fbsdk-opengl.h Source File

fbsdk-opengl.h
Go to the documentation of this file.
1 #ifndef _FBSDK_OPENGL_H_
2 #define _FBSDK_OPENGL_H_
3 /**************************************************************************
4 Copyright (c) 1994 - 2008 Autodesk, Inc. and/or its licensors.
5 All Rights Reserved.
6 
7 The coded instructions, statements, computer programs, and/or related
8 material (collectively the "Data") in these files contain unpublished
9 information proprietary to Autodesk, Inc. and/or its licensors, which is
10 protected by Canada and United States of America federal copyright law
11 and by international treaties.
12 
13 The Data may not be disclosed or distributed to third parties, in whole
14 or in part, without the prior written consent of Autodesk, Inc.
15 ("Autodesk").
16 
17 THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
18 ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO
19 WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR
20 ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES
21 OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR
22 PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT
23 WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR
24 FREE.
25 
26 IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS
27 OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR
28 EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE
29 DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS
30 OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR
31 DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF
32 LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT
33 LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE
34 DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS
35 BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
36 
37 **************************************************************************/
38 
39 #if defined(KARCH_ENV_WIN32)
40 // #include <windows.h> // must include before this include if needed
41 // Now redefining those if not already defined
42  #ifndef WINGDIAPI
43  #define CALLBACK __stdcall
44  #define WINAPI __stdcall
45  #define DECLSPEC_IMPORT __declspec(dllimport)
46  #define WINGDIAPI DECLSPEC_IMPORT
47  #define APIENTRY WINAPI
48  #endif
49  #ifndef _WCHAR_T_DEFINED
50  #ifndef KARCH_ENV_MING32
51  typedef unsigned short wchar_t;
52  #endif
53  #define _WCHAR_T_DEFINED
54  #endif
55 #else
56  #ifdef __sgi
57  #define glDeleteTextures glDeleteTexturesEXT
58  #define glGenTextures glGenTexturesEXT
59  #define glBindTexture glBindTextureEXT
60  #define glCopyTexImage2D glCopyTexImage2DEXT
61  #define glCopyTexSubImage2D glCopyTexSubImage2DEXT
62  #define glTexSubImage2D glTexSubImage2DEXT
63  #define glIsTexture glIsTextureEXT
64  #define glCopyTexImage2D glCopyTexImage2DEXT
65  #define GL_BGRA_EXT GL_BGRA // On SGI only this is not an extension
66  #define GL_BGR_EXT GL_BGR // On SGI only this is not an extension
67  #endif
68  #ifndef CALLBACK
69  #define CALLBACK
70  #endif
71 #endif
72 
73 #if defined(KARCH_ENV_MACOSX)
74  #include <OpenGl/gl.h>
75  #include <OpenGl/glu.h>
76 #else
77  #include <GL/gl.h>
78  #include <GL/glu.h>
79 #endif
80 
81 #if defined(KARCH_ENV_WIN32) || defined(KARCH_ENV_WIN64)
82  #if defined(KARCH_ENV_MING32)
83  #include <GL/glext.h>
84  #endif
85  #ifdef GL_EXT_bgra
86  #define GL_BGR GL_BGR_EXT
87  #define GL_BGRA GL_BGRA_EXT
88  #endif
89  #define GL_POST_COLOR_MATRIX_COLOR_TABLE_EXT 0x80D2 // glEnable
90 
91  #ifndef GL_EXT_abgr
92  #define GL_ABGR_EXT 0x8000
93  #define GL_EXT_abgr 1
94  #endif
95 
96  #ifndef GL_LIGHT_MODEL_COLOR_CONTROL_EXT
97  #define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 // glLightModel OpenGL 1.2
98  #endif
99 
100  #ifndef GL_SINGLE_COLOR_EXT
101  #define GL_SINGLE_COLOR_EXT 0x81F9 // glLightModel OpenGL 1.2
102  #endif
103 
104  #ifndef GL_SEPARATE_SPECULAR_COLOR_EXT
105  #define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA // glLightModel OpenGL 1.2
106  #endif
107 
108  #define GL_DISPLAY_CGP 0x6001
109  #define GL_GLTARGET_CGP 0x6003
110 #endif
111 
112 #if defined(KARCH_ENV_LINUX)
113  #include <GL/glext.h>
114  #define GL_POST_COLOR_MATRIX_COLOR_TABLE_EXT GL_POST_COLOR_MATRIX_COLOR_TABLE
115 #endif
116 
117 #if defined(KARCH_ENV_IRIX)
118  #define GL_POST_COLOR_MATRIX_COLOR_TABLE_EXT GL_POST_COLOR_MATRIX_COLOR_TABLE
119 #endif
120 
121 #if defined(KARCH_ENV_MACOSX)
122  #include <OpenGl/glext.h>
123  #define GL_POST_COLOR_MATRIX_COLOR_TABLE_EXT GL_POST_COLOR_MATRIX_COLOR_TABLE
124 #endif
125 
126 #ifndef GL_LIGHT_MODEL_COLOR_CONTROL
127  #define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8
128 #endif
129 
130 #ifndef GL_SEPARATE_SPECULAR_COLOR
131  #define GL_SEPARATE_SPECULAR_COLOR 0x81FA
132 #endif
133 
134 #ifndef GL_EXT_422_pixels
135  #define GL_422_EXT 0x80cc
136 #endif
137 
138 #ifndef GL_CLAMP_TO_EDGE
139  #define GL_CLAMP_TO_EDGE 0x812F
140 #endif
141 
142 #endif /* _FBSDK_OPENGL_H_ */