1 /****************************************************************************
3 * Mesa 3-D graphics library
4 * Direct3D Driver Interface
6 * ========================================================================
8 * Copyright (C) 1991-2004 SciTech Software, Inc. All rights reserved.
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 * SCITECH SOFTWARE INC BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
24 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
25 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28 * ======================================================================
31 * Environment: Windows 9x (Win32)
33 * Description: Globals.
35 ****************************************************************************/
37 #ifndef __DGLGLOBALS_H
38 #define __DGLGLOBALS_H
40 #include "dglcontext.h"
41 #include "dglpf.h" // Pixel format
43 #include "d3dtexture.h"
46 /*---------------------- Macros and type definitions ----------------------*/
49 DGL_RENDER_MESASW = 0,
51 DGL_RENDER_FORCE_DWORD = 0x7ffffff,
56 // Same as DGL_renderType? KeithH
58 GLDS_DRIVER_MESA_SW = 0, // Mesa SW rendering
59 GLDS_DRIVER_REF = 1, // Direct3D Reference Rasteriser
60 GLDS_DRIVER_HAL = 2, // Direct3D HW rendering
64 GLDS_TNL_DEFAULT = 0, // Choose best TnL method
65 GLDS_TNL_MESA = 1, // Mesa TnL
66 GLDS_TNL_D3DSW = 2, // D3D Software TnL
67 GLDS_TNL_D3DHW = 3, // D3D Hardware TnL
71 GLDS_MULTISAMPLE_NONE = 0,
72 GLDS_MULTISAMPLE_FASTEST = 1,
73 GLDS_MULTISAMPLE_NICEST = 2,
79 char szDDName[MAX_DDDEVICEID_STRING]; // DirectDraw device name
80 char szD3DName[MAX_DDDEVICEID_STRING]; // Direct3D driver name
81 BOOL bPrimary; // Is ddraw device the Primary device?
82 BOOL bHardware; // Is the d3d driver a Hardware driver?
84 GUID ddGuid; // GUID of the ddraw device
85 GUID d3dGuid; // GUID of the direct3d driver
86 #endif // _USE_GLD3_WGL
87 // BOOL bFullscreen; // Force fullscreen - only useful for primary adaptors.
88 BOOL bSquareTextures; // Does this driver require square textures?
89 DWORD dwRendering; // Type of rendering required
91 BOOL bWaitForRetrace; // Sync to vertical retrace
92 BOOL bFullscreenBlit; // Use Blt instead of Flip in fullscreen modes
99 DWORD dwMemoryType; // Sysmem or Vidmem
103 DDPIXELFORMAT ddpfPAL8;
106 WORD wMaxSimultaneousTextures;
109 BOOL bAppActive; // Keep track of Alt-Tab
110 LONG lpfnWndProc; // WndProc of calling app
112 // Pixel Format Descriptior list.
113 int nPixelFormatCount;
114 DGL_pixelFormat *lpPF;
115 #ifndef _USE_GLD3_WGL
116 // ZBuffer pixel formats
117 int nZBufferPFCount; // Count of Zbuffer pixel formats
118 DDPIXELFORMAT *lpZBufferPF; // ZBuffer pixel formats
120 // Display modes (for secondary devices)
121 int nDisplayModeCount;
122 DDSURFACEDESC2 *lpDisplayModes;
124 // Texture pixel formats
125 int nTextureFormatCount;
126 DGL_textureFormat *lpTextureFormat;
127 #endif // _USE_GLD3_WGL
128 // Alpha emulation via chroma key
129 BOOL bEmulateAlphaTest;
131 // Geom pipeline override.
132 // If this is set TRUE then the D3D pipeline will never be used,
133 // and the Mesa pipline will always be used.
134 BOOL bForceMesaPipeline;
137 BOOL bPixelformatsDirty; // Signal a list rebuild
140 // Additional globals to support multiple GL rendering contexts, GLRCs
141 BOOL bDirectDraw; // DirectDraw interface exists ?
142 BOOL bDirectDrawPrimary; // DirectDraw primary surface exists ?
143 BOOL bDirect3D; // Direct3D interface exists ?
144 BOOL bDirect3DDevice; // Direct3D device exists ?
146 BOOL bDirectDrawStereo; // DirectDraw Stereo driver started ?
147 int iDirectDrawStereo; // DirectDraw Stereo driver reference count
148 HWND hWndActive; // copy of active window
150 // Copies of DirectX COM interfaces for re-referencing across multiple GLRCs
151 // IDirectDraw4 *lpDD4; // copy of DirectDraw interface
152 // IDirectDrawSurface4 *lpPrimary4; // copy of DirectDraw primary surface
153 // IDirectDrawSurface4 *lpBack4;
154 // IDirectDrawSurface4 *lpDepth4;
155 // IDirectDrawPalette *lpGlobalPalette;
157 // Aids for heavy-duty MFC-windowed OGL apps, like AutoCAD
158 BOOL bMessageBoxWarnings; // popup message box warning
159 BOOL bDirectDrawPersistant; // DirectDraw is persisitant
160 BOOL bPersistantBuffers; // DirectDraw buffers persisitant
162 // FPU setup option for CAD precision (AutoCAD) vs GAME speed (Quake)
163 BOOL bFastFPU; // single-precision-only FPU ?
165 // Hot-Key support, like for real-time stereo parallax adjustments
166 BOOL bHotKeySupport; // hot-key support ?
168 // Multi-threaded support, for apps like 3DStudio
169 BOOL bMultiThreaded; // multi-threaded ?
171 // Detect and use app-specific customizations for apps like 3DStudio
172 BOOL bAppCustomizations; // app customizations ?
175 DWORD dwAdapter; // Primary DX8 adapter
176 DWORD dwTnL; // MesaSW TnL
177 DWORD dwMultisample; // Multisample Off
178 DWORD dwDriver; // Direct3D HW
179 void *pDrvPrivate; // Driver-specific data
184 /*------------------------- Function Prototypes ---------------------------*/
192 void dglInitGlobals();