1 /* Copyright (C) 2010 Wildfire Games.
2  *
3  * Permission is hereby granted, free of charge, to any person obtaining
4  * a copy of this software and associated documentation files (the
5  * "Software"), to deal in the Software without restriction, including
6  * without limitation the rights to use, copy, modify, merge, publish,
7  * distribute, sublicense, and/or sell copies of the Software, and to
8  * permit persons to whom the Software is furnished to do so, subject to
9  * the following conditions:
10  *
11  * The above copyright notice and this permission notice shall be included
12  * in all copies or substantial portions of the Software.
13  *
14  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
15  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
17  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
18  * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
19  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
20  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 /*
24  * Windows definitions required for GL/gl.h
25  */
26 
27 // RAGE! Win32 OpenGL headers are full of crap we have to emulate
28 // (must not include windows.h)
29 
30 #ifndef WGL_HEADER_NEEDED
31 #error "wgl.h: why is this included from anywhere but ogl.h?"
32 #endif
33 
34 
35 #ifndef WINGDIAPI
36 #define WINGDIAPI __declspec(dllimport)
37 #endif
38 #ifndef CALLBACK
39 #define CALLBACK __stdcall
40 #endif
41 #ifndef APIENTRY
42 #define APIENTRY __stdcall
43 #endif
44 #ifndef WINAPI
45 #define WINAPI __stdcall
46 #endif
47 
48 #ifndef DECLARE_HANDLE
49 typedef void VOID;
50 typedef void* LPVOID;
51 typedef int BOOL;
52 typedef unsigned short USHORT;
53 typedef int INT;
54 typedef unsigned int UINT;
55 typedef long LONG;
56 typedef unsigned long DWORD;
57 typedef int INT32;
58 typedef __int64 INT64;
59 typedef float FLOAT;
60 typedef char CHAR;
61 typedef const char* LPCSTR;
62 typedef void* HANDLE;
63 typedef int (*PROC)();
64 struct RECT
65 {
66 	LONG left;
67 	LONG top;
68 	LONG right;
69 	LONG bottom;
70 };
71 #define DECLARE_HANDLE(name) typedef HANDLE name
72 DECLARE_HANDLE(HDC);
73 DECLARE_HANDLE(HGLRC);
74 #endif
75 
76 // VC6 doesn't define wchar_t as built-in type
77 #ifndef _WCHAR_T_DEFINED
78 typedef unsigned short wchar_t;	// for glu.h
79 #define _WCHAR_T_DEFINED
80 #endif
81 
82 WINGDIAPI BOOL  WINAPI wglCopyContext(HGLRC, HGLRC, UINT);
83 WINGDIAPI HGLRC WINAPI wglCreateContext(HDC);
84 WINGDIAPI HGLRC WINAPI wglCreateLayerContext(HDC, int);
85 WINGDIAPI BOOL  WINAPI wglDeleteContext(HGLRC);
86 WINGDIAPI HGLRC WINAPI wglGetCurrentContext();
87 WINGDIAPI HDC   WINAPI wglGetCurrentDC();
88 WINGDIAPI PROC  WINAPI wglGetProcAddress(LPCSTR);
89 WINGDIAPI BOOL  WINAPI wglMakeCurrent(HDC, HGLRC);
90 WINGDIAPI BOOL  WINAPI wglShareLists(HGLRC, HGLRC);
91 WINGDIAPI BOOL  WINAPI wglUseFontBitmapsA(HDC, DWORD, DWORD, DWORD);
92 WINGDIAPI BOOL  WINAPI wglUseFontBitmapsW(HDC, DWORD, DWORD, DWORD);
93