1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of OGRE
|
---|
4 | (Object-oriented Graphics Rendering Engine)
|
---|
5 | For the latest info, see http://www.ogre3d.org/
|
---|
6 |
|
---|
7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
8 | Also see acknowledgements in Readme.html
|
---|
9 |
|
---|
10 | This program is free software; you can redistribute it and/or modify it under
|
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
13 | version.
|
---|
14 |
|
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
23 | -----------------------------------------------------------------------------
|
---|
24 | */
|
---|
25 | #define D3D_OVERLOADS
|
---|
26 |
|
---|
27 | #ifndef __D3DDEVICE_H_
|
---|
28 | #define __D3DDEVICE_H_
|
---|
29 |
|
---|
30 | // Precompiler options
|
---|
31 | #include "OgreD3D7Prerequisites.h"
|
---|
32 |
|
---|
33 | namespace Ogre
|
---|
34 | {
|
---|
35 | /** Encapsulates a Direct3D Device. Utility class for D3DRenderSystem. */
|
---|
36 | class _OgreD3DExport D3DDevice
|
---|
37 | {
|
---|
38 |
|
---|
39 |
|
---|
40 | private:
|
---|
41 | String mDeviceName;
|
---|
42 | String mDeviceDescription;
|
---|
43 | D3DDEVICEDESC7 mD3DDeviceDesc;
|
---|
44 | bool mIsHardwareAccelerated;
|
---|
45 | bool mNeedsZBuffer;
|
---|
46 | std::vector<DDPIXELFORMAT> mDepthBufferFormats;
|
---|
47 | ushort mStencilBufferDepth;
|
---|
48 |
|
---|
49 |
|
---|
50 |
|
---|
51 | LPDIRECT3D7 lpD3D;
|
---|
52 | D3DVIEWPORT7 mViewport;
|
---|
53 | D3DRECT rcViewportRect;
|
---|
54 |
|
---|
55 | DDDriver* mParentDriver;
|
---|
56 |
|
---|
57 |
|
---|
58 |
|
---|
59 |
|
---|
60 | public:
|
---|
61 | // Constructors
|
---|
62 | D3DDevice(); // Default
|
---|
63 | D3DDevice(const D3DDevice &ob); // Copy
|
---|
64 | D3DDevice(LPDIRECT3D7 lpDirect3D, LPSTR lpDeviceDesc, LPSTR lpDeviceName,
|
---|
65 | LPD3DDEVICEDESC7 lpD3DDeviceDesc);
|
---|
66 | ~D3DDevice();
|
---|
67 | void Cleanup(void);
|
---|
68 | void logCaps(void) const;
|
---|
69 |
|
---|
70 | /** Creates a new per-rendering surface device */
|
---|
71 | LPDIRECT3DDEVICE7 createDevice(LPDIRECTDRAWSURFACE7 renderTarget);
|
---|
72 | LPDIRECT3D7 getID3D(void);
|
---|
73 |
|
---|
74 | // Overloaded operator =
|
---|
75 | D3DDevice operator=(const D3DDevice &orig);
|
---|
76 |
|
---|
77 | // Information accessors
|
---|
78 | String DeviceName(void) const;
|
---|
79 | String DeviceDescription(void) const;
|
---|
80 | bool HardwareAccelerated(void) const;
|
---|
81 | bool NeedsZBuffer(void) const;
|
---|
82 |
|
---|
83 | void createDepthBuffer(LPDIRECTDRAWSURFACE7 renderTarget);
|
---|
84 |
|
---|
85 |
|
---|
86 | friend static HRESULT CALLBACK EnumZBuffersCallback(DDPIXELFORMAT* pddpf,
|
---|
87 | VOID* pFormats);
|
---|
88 |
|
---|
89 |
|
---|
90 | // Capability access
|
---|
91 | bool CanMipmap(void) const;
|
---|
92 | bool CanBilinearFilter(void) const;
|
---|
93 | bool CanTrilinearFilter(void) const;
|
---|
94 | unsigned int RenderBitDepth(void) const;
|
---|
95 | unsigned int ZBufferBitDepth(void) const;
|
---|
96 | bool CanHWTransformAndLight(void) const;
|
---|
97 | unsigned int MaxSinglePassTextureLayers(void) const;
|
---|
98 | ushort StencilBufferBitDepth(void) const;
|
---|
99 |
|
---|
100 |
|
---|
101 |
|
---|
102 |
|
---|
103 |
|
---|
104 |
|
---|
105 | };
|
---|
106 | } // Namespace Ogre
|
---|
107 | #endif
|
---|