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

OgreD3D9Driver.cpp

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 © 2000-2002 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 #include "OgreD3D9Driver.h"
00026 #include "OgreD3D9VideoModeList.h"
00027 #include "OgreD3D9VideoMode.h"
00028 
00029 namespace Ogre 
00030 {
00031     D3D9Driver::D3D9Driver()
00032     {
00033         tempNo = ++driverCount;
00034         mpD3D = NULL;
00035         ZeroMemory( &mAdapterIdentifier, sizeof(mAdapterIdentifier) );
00036         ZeroMemory( &mDesktopDisplayMode, sizeof(mDesktopDisplayMode) );
00037         mpVideoModeList = NULL;
00038     }
00039 
00040     D3D9Driver::D3D9Driver( const D3D9Driver &ob )
00041     {
00042         tempNo = ++driverCount;
00043         mpD3D = ob.mpD3D;
00044         mAdapterNumber = ob.mAdapterNumber;
00045         mAdapterIdentifier = ob.mAdapterIdentifier;
00046         mDesktopDisplayMode = ob.mDesktopDisplayMode;
00047         mpVideoModeList = NULL;
00048     }
00049 
00050     D3D9Driver::D3D9Driver( LPDIRECT3D9 pD3D, unsigned int adapterNumber, D3DADAPTER_IDENTIFIER9 adapterIdentifier, D3DDISPLAYMODE desktopDisplayMode )
00051     {
00052         tempNo = ++driverCount;
00053         mpD3D = pD3D;
00054         mAdapterNumber = adapterNumber;
00055         mAdapterIdentifier = adapterIdentifier;
00056         mDesktopDisplayMode = desktopDisplayMode;
00057         mpVideoModeList = NULL;
00058     }
00059 
00060     D3D9Driver::~D3D9Driver()
00061     {
00062         SAFE_DELETE( mpVideoModeList );
00063         driverCount--;
00064     }
00065 
00066     String D3D9Driver::DriverName() const
00067     {
00068         return String(mAdapterIdentifier.Driver);
00069     }
00070 
00071     String D3D9Driver::DriverDescription() const
00072     {
00073         String driverDescription(mAdapterIdentifier.Description);
00074         StringUtil::trim(driverDescription);
00075 
00076         return  driverDescription;
00077     }
00078 
00079     D3D9VideoModeList* D3D9Driver::getVideoModeList()
00080     {
00081         if( !mpVideoModeList )
00082             mpVideoModeList = new D3D9VideoModeList( this );
00083 
00084         return mpVideoModeList;
00085     }
00086 }

Copyright © 2002-2003 by The OGRE Team
Last modified Sun Nov 28 19:48:20 2004