Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

OgreD3D7Device.h

Go to the documentation of this file.
00001 /*
00002 -----------------------------------------------------------------------------
00003 This source file is part of OGRE
00004     (Object-oriented Graphics Rendering Engine)
00005 For the latest info, see http://www.ogre3d.org/
00006 
00007 Copyright (c) 2000-2005 The OGRE Team
00008 Also see acknowledgements in Readme.html
00009 
00010 This program is free software; you can redistribute it and/or modify it under
00011 the terms of the GNU Lesser General Public License as published by the Free Software
00012 Foundation; either version 2 of the License, or (at your option) any later
00013 version.
00014 
00015 This program is distributed in the hope that it will be useful, but WITHOUT
00016 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
00017 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
00018 
00019 You should have received a copy of the GNU Lesser General Public License along with
00020 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
00021 Place - Suite 330, Boston, MA 02111-1307, USA, or go to
00022 http://www.gnu.org/copyleft/lesser.txt.
00023 -----------------------------------------------------------------------------
00024 */
00025 #define D3D_OVERLOADS
00026 
00027 #ifndef __D3DDEVICE_H_
00028 #define __D3DDEVICE_H_
00029 
00030 // Precompiler options
00031 #include "OgreD3D7Prerequisites.h"
00032 
00033 namespace Ogre
00034 {
00036     class _OgreD3DExport D3DDevice
00037     {
00038 
00039 
00040     private:
00041         String mDeviceName;
00042         String mDeviceDescription;
00043         D3DDEVICEDESC7 mD3DDeviceDesc;
00044         bool mIsHardwareAccelerated;
00045         bool mNeedsZBuffer;
00046         std::vector<DDPIXELFORMAT> mDepthBufferFormats;
00047         ushort mStencilBufferDepth;
00048 
00049 
00050 
00051         LPDIRECT3D7 lpD3D;
00052         D3DVIEWPORT7 mViewport;
00053         D3DRECT rcViewportRect;
00054 
00055         DDDriver* mParentDriver;
00056 
00057 
00058 
00059 
00060     public:
00061         // Constructors
00062         D3DDevice(); // Default
00063         D3DDevice(const D3DDevice &ob); // Copy
00064         D3DDevice(LPDIRECT3D7 lpDirect3D, LPSTR lpDeviceDesc, LPSTR lpDeviceName,
00065                     LPD3DDEVICEDESC7 lpD3DDeviceDesc);
00066         ~D3DDevice();
00067         void Cleanup(void);
00068         void logCaps(void) const;
00069 
00071         LPDIRECT3DDEVICE7 createDevice(LPDIRECTDRAWSURFACE7 renderTarget);
00072         LPDIRECT3D7 getID3D(void);
00073 
00074         // Overloaded operator =
00075         D3DDevice operator=(const D3DDevice &orig);
00076 
00077         // Information accessors
00078         String DeviceName(void) const;
00079         String DeviceDescription(void) const;
00080         bool HardwareAccelerated(void) const;
00081         bool NeedsZBuffer(void) const;
00082 
00083         void createDepthBuffer(LPDIRECTDRAWSURFACE7 renderTarget);
00084 
00085 
00086         friend static HRESULT CALLBACK EnumZBuffersCallback(DDPIXELFORMAT* pddpf,
00087             VOID* pFormats);
00088 
00089 
00090         // Capability access
00091         bool CanMipmap(void) const;
00092         bool CanBilinearFilter(void) const;
00093         bool CanTrilinearFilter(void) const;
00094         unsigned int RenderBitDepth(void) const;
00095         unsigned int ZBufferBitDepth(void) const;
00096         bool CanHWTransformAndLight(void) const;
00097         unsigned int MaxSinglePassTextureLayers(void) const;
00098         ushort StencilBufferBitDepth(void) const;
00099 
00100 
00101 
00102 
00103 
00104 
00105     };
00106 } // Namespace Ogre
00107 #endif

Copyright © 2000-2005 by The OGRE Team
Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 2.5 License.
Last modified Sun Feb 12 12:59:43 2006