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

OgreDDDriver.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 #ifndef __DDDRIVER_H__
00026 #define __DDDRIVER_H__
00027 
00028 // Precompiler options
00029 #include "OgreD3D7Prerequisites.h"
00030 
00031 // Declaration
00032 #include "OgreString.h"
00033 
00034 namespace Ogre {
00035 
00036     class D3DDeviceList;
00037     class DDVideoModeList;
00038     class DDVideoMode;
00039     class D3DDevice;
00040 
00041 
00045     class _OgreD3DExport DDDriver
00046     {
00047     private:
00048 
00049         String mDriverName;
00050         String mDriverDesc;
00051         GUID  mGuid; // Note - copy of GUID, not pointer to
00052         bool  mPrimaryDisplay;
00053 
00054         LPDIRECTDRAW7 lpDD7; // pointer to IDirectDraw7 interface
00055         LPDIRECT3D7   lpD3D; // pointer to IDirect3D7 interface (if required)
00056         D3DDeviceList* mDeviceList; // List of Direct3D devices
00057         DDVideoModeList* mVideoModeList; // List of video modes
00058         D3DDevice* active3DDevice;
00059         DDVideoMode* activeVideoMode;
00060         HWND activeHWnd;
00061 
00062         DDCAPS mSWCaps; // Software capabilities
00063         DDCAPS mHWCaps; // Hardware capabilities
00064         void logCaps(void) const;
00065 
00066         LPDIRECTDRAWSURFACE7 lpDDSPrimary; // Pointer to primary surface
00067         LPDIRECTDRAWSURFACE7 lpDDSBack; // Pointer to back buffer
00068 
00069         bool runningFullScreen;
00070         bool using3DMode;
00071 
00072         RECT rcViewport; //Only used for windowed mode
00073         LPDIRECTDRAWCLIPPER lpDDClipper;
00074 
00075         // Private accessor functions
00076 
00077         void RestoreSurfaces(void);
00078 
00079 
00080 
00081     public:
00082         // Constructors
00083         DDDriver(); // Default
00084         DDDriver(const DDDriver &ob); // Copy
00085         DDDriver(GUID FAR *lpGuid,    // Create from enum
00086                                 LPSTR lpDriverDescription,
00087                                 LPSTR lpDriverName);
00088         // Destructor
00089         ~DDDriver();
00090 
00114         void createWindowSurfaces(HWND hWnd, unsigned int width, unsigned int height, unsigned int colourDepth, bool fullScreen,
00115             LPDIRECTDRAWSURFACE7 *front, LPDIRECTDRAWSURFACE7 *back);
00116 
00117         void Cleanup(void);
00118         void CheckWindow(void);
00119 
00120         // Overloaded operator =
00121         DDDriver operator=(const DDDriver &orig);
00122 
00123         // Information accessors
00124         String DriverName(void) const;
00125         String DriverDescription(void) const;
00126         LPDIRECTDRAW7 directDraw(); // Gets lpDD7 (instantiates if required)
00127 
00128         D3DDeviceList* get3DDeviceList(void);
00129         DDVideoModeList* getVideoModeList(void);
00130         DDVideoMode* getActiveVideoMode(void);
00131 
00132         // Retrieval of other objects
00133         D3DDevice* get3DDevice(void);
00134 
00135         void OutputText(int x, int y, char* text);
00136         void FlipBuffers(void);
00137         bool RunningFullScreen(void) const;
00138         RECT ViewportRect(void) const;
00139 
00140         // Capabilities
00141         bool Has3DAcceleration(void) const;
00142         bool CanRenderWindowed(void) const;
00143 
00144         // Generalised info
00145         void GetDisplayDetails(unsigned int& width, unsigned int& height, unsigned int& colourDepth);
00146     };
00147 }
00148 
00149 #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:44 2006