2 * freeglut_internal_mswin.h
4 * The freeglut library private include file.
6 * Copyright (c) 2012 Stephen J. Baker. All Rights Reserved.
7 * Written by John F. Fay, <fayjf@sourceforge.net>
8 * Creation date: Thu Jan 19, 2012
10 * Permission is hereby granted, free of charge, to any person obtaining a
11 * copy of this software and associated documentation files (the "Software"),
12 * to deal in the Software without restriction, including without limitation
13 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
14 * and/or sell copies of the Software, and to permit persons to whom the
15 * Software is furnished to do so, subject to the following conditions:
17 * The above copyright notice and this permission notice shall be included
18 * in all copies or substantial portions of the Software.
20 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
21 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
22 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
23 * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
24 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
25 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 #ifndef FREEGLUT_INTERNAL_MSWIN_H
29 #define FREEGLUT_INTERNAL_MSWIN_H
32 /* All Win32 headers depend on the huge windows.h recursive include.
33 * Note: Lower-case header names are used, for best cross-platform
36 #if !defined(_WIN32_WCE)
38 # include <windowsx.h>
39 # include <mmsystem.h>
40 /* CYGWIN does not have tchar.h, but has TEXT(x), defined in winnt.h. */
44 # define _TEXT(x) TEXT(x)
45 # define _T(x) TEXT(x)
51 #define HAVE_VFPRINTF 1
53 /* MinGW may lack a prototype for ChangeDisplaySettingsEx() (depending on the version?) */
54 #if !defined(ChangeDisplaySettingsEx)
55 LONG WINAPI ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPVOID);
56 LONG WINAPI ChangeDisplaySettingsExW(LPCWSTR,LPDEVMODEW,HWND,DWORD,LPVOID);
58 # define ChangeDisplaySettingsEx ChangeDisplaySettingsExW
60 # define ChangeDisplaySettingsEx ChangeDisplaySettingsExA
65 /* Structure Definitions */
67 typedef struct tagSFG_PlatformDisplay SFG_PlatformDisplay;
68 struct tagSFG_PlatformDisplay
70 HINSTANCE Instance; /* The application's instance */
71 DEVMODE DisplayMode; /* Desktop's display settings */
72 char *DisplayName; /* Display name for multi display support*/
76 * Make "freeglut" window handle and context types so that we don't need so
77 * much conditionally-compiled code later in the library.
79 typedef HWND SFG_WindowHandleType ;
80 typedef HGLRC SFG_WindowContextType ;
81 typedef struct tagSFG_PlatformContext SFG_PlatformContext;
82 struct tagSFG_PlatformContext
84 HDC Device; /* The window's device context */
88 /* Window's state description. This structure should be kept portable. */
89 typedef struct tagSFG_PlatformWindowState SFG_PlatformWindowState;
90 struct tagSFG_PlatformWindowState
92 RECT OldRect; /* window rect - stored before the window is made fullscreen */
93 DWORD OldStyle; /* window style - stored before the window is made fullscreen */
98 /* For "freeglut_init.c", some definitions of symbols and a prototype to emulate the X11 functionality */
99 #define NoValue 0x0000
100 #define XValue 0x0001
101 #define YValue 0x0002
102 #define WidthValue 0x0004
103 #define HeightValue 0x0008
104 #define AllValues 0x000F
105 #define XNegative 0x0010
106 #define YNegative 0x0020
108 extern int XParseGeometry (
112 unsigned int *width, /* RETURN */
113 unsigned int *height); /* RETURN */
117 /* Joystick-Specific Definitions */
118 #if !defined(_WIN32_WCE)
119 # define _JS_MAX_AXES 8
120 typedef struct tagSFG_PlatformJoystick SFG_PlatformJoystick;
121 struct tagSFG_PlatformJoystick
130 /* Menu font and color definitions */
131 #define FREEGLUT_MENU_FONT GLUT_BITMAP_8_BY_13
133 #define FREEGLUT_MENU_PEN_FORE_COLORS {0.0f, 0.0f, 0.0f, 1.0f}
134 #define FREEGLUT_MENU_PEN_BACK_COLORS {0.85f, 0.85f, 0.85f, 1.0f}
135 #define FREEGLUT_MENU_PEN_HFORE_COLORS {1.0f, 1.0f, 1.0f, 1.0f}
136 #define FREEGLUT_MENU_PEN_HBACK_COLORS {0.15f, 0.15f, 0.45f, 1.0f}
139 /* Function to be called on exit */
140 extern void (__cdecl *__glutExitFunc)( int return_value );
143 #endif /* FREEGLUT_INTERNAL_MSWIN_H */