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

OgreD3D7RenderWindow.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 __D3D7RenderWindow_H__
00026 #define __D3D7RenderWindow_H__
00027 
00028 // Precompiler options
00029 #include "OgreD3D7Prerequisites.h"
00030 
00031 #include "OgreRenderWindow.h"
00032 #include "OgreDDDriver.h"
00033 #include "OgreD3D7DeviceList.h"
00034 #include "OgreD3D7Device.h"
00035 
00036 namespace Ogre {
00042     class D3D7RenderWindow : public RenderWindow
00043     {
00044     public:
00045         D3D7RenderWindow(HINSTANCE instance, DDDriver *driver);
00046         ~D3D7RenderWindow();
00047 
00048         void create(const String& name, unsigned int width, unsigned int height,
00049             bool fullScreen, const NameValuePairList *miscParams);
00050 
00053         void destroy(void);
00054 
00057         bool isActive(void) const;
00058 
00061         bool isClosed(void) const;
00062 
00065         void reposition(int left, int top);
00066 
00069         void resize(unsigned int width, unsigned int height);
00070 
00073         void swapBuffers(bool waitForVSync);
00074 
00077         HWND getWindowHandle(void) const;
00078 
00081         HWND getParentWindowHandle(void) const;
00082 
00085         bool isUsingDirectDraw(void) const;
00091         DDDriver* getDirectDrawDriver(void);
00092 
00098         LPDIRECTDRAWSURFACE7 getDDFrontBuffer(void);
00099 
00103         LPDIRECTDRAWSURFACE7 getDDBackBuffer(void);
00104 
00110         LPDIRECT3DDEVICE7 getD3DDevice(void);
00111 
00112         bool requiresTextureFlipping() const { return false; }
00113 
00116         void getCustomAttribute(const String& name, void* pData);
00117 
00120         void writeContentsToFile(const String& filename);
00121         // DirectDraw Methods
00122         void createDDSurfaces(void);
00123         void releaseDDSurfaces(void);
00124         void restoreDDSurfaces(void);
00125         void createDepthBuffer(void);
00126 
00127     protected:
00128         HINSTANCE mInstance;            // Process instance
00129         DDDriver *mDriver;          // D3D9 driver
00130         // Win32-specific data members
00131         bool mIsUsingDirectDraw;
00132         HWND mHWnd;                    // Win32 Window handle
00133         HWND mParentHWnd;
00134         bool mActive;                // Is active i.e. visible
00135         bool mReady;                // Is ready i.e. available for update
00136         bool mClosed;
00137 
00138         RECT rcBlitDest;            // Target for blit operation
00139                                     // == window client area
00140 
00141 
00142         static LRESULT CALLBACK WndProc( 
00143             HWND hWnd, 
00144             UINT uMsg, 
00145             WPARAM wParam, 
00146             LPARAM lParam);
00147 
00148         // ---------------------------------------------------------
00149         // DirectX-specific
00150         // ---------------------------------------------------------
00151 
00152         // Pointer to DDDriver encapsulating DirectDraw driver (if DirectX in use)
00153         DDDriver* mlpDDDriver;
00154 
00155         // Pointers to DX surfaces
00156         LPDIRECTDRAWSURFACE7 mlpDDSFront; // Pointer to primary (front) buffer surface
00157         LPDIRECTDRAWSURFACE7 mlpDDSBack; // Pointer to back buffer
00158 
00159         // Pointer to the 3D Device specific for this window
00160         LPDIRECT3DDEVICE7 mlpD3DDevice;
00161 
00162 
00163         // Method for dealing with resize / move & 3d library
00164         void windowMovedOrResized(void);
00165         
00166         // ---------------------------------------------------------
00167         // OpenGL-specific details
00168         // ---------------------------------------------------------
00169 
00170         // TODO
00171     };
00172 }
00173 #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