source: OGRE/trunk/ogre_changes/obsolete/RenderSystems/Direct3D7/include/OgreD3D7RenderWindow.h @ 657

Revision 657, 5.9 KB checked in by mattausch, 18 years ago (diff)

added ogre dependencies and patched ogre sources

Line 
1/*
2-----------------------------------------------------------------------------
3This source file is part of OGRE
4    (Object-oriented Graphics Rendering Engine)
5For the latest info, see http://www.ogre3d.org/
6
7Copyright (c) 2000-2005 The OGRE Team
8Also see acknowledgements in Readme.html
9
10This program is free software; you can redistribute it and/or modify it under
11the terms of the GNU Lesser General Public License as published by the Free Software
12Foundation; either version 2 of the License, or (at your option) any later
13version.
14
15This program is distributed in the hope that it will be useful, but WITHOUT
16ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
17FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
18
19You should have received a copy of the GNU Lesser General Public License along with
20this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21Place - Suite 330, Boston, MA 02111-1307, USA, or go to
22http://www.gnu.org/copyleft/lesser.txt.
23-----------------------------------------------------------------------------
24*/
25#ifndef __D3D7RenderWindow_H__
26#define __D3D7RenderWindow_H__
27
28// Precompiler options
29#include "OgreD3D7Prerequisites.h"
30
31#include "OgreRenderWindow.h"
32#include "OgreDDDriver.h"
33#include "OgreD3D7DeviceList.h"
34#include "OgreD3D7Device.h"
35
36namespace Ogre {
37    /** Defines the rendering window on Win32 systems
38        @remarks
39            This class represents the rendering window on the
40            Windows family of operating systems.
41     */
42    class D3D7RenderWindow : public RenderWindow
43    {
44    public:
45        D3D7RenderWindow(HINSTANCE instance, DDDriver *driver);
46        ~D3D7RenderWindow();
47
48                void create(const String& name, unsigned int width, unsigned int height,
49                        bool fullScreen, const NameValuePairList *miscParams);
50
51        /** Overridden - see RenderWindow
52        */
53        void destroy(void);
54
55        /** Overridden - see RenderWindow
56        */
57        bool isActive(void) const;
58
59        /** Overridden - see RenderWindow
60        */
61        bool isClosed(void) const;
62
63        /** Overridden - see RenderWindow
64        */
65        void reposition(int left, int top);
66
67        /** Overridden - see RenderWindow
68        */
69        void resize(unsigned int width, unsigned int height);
70
71        /** Overridden - see RenderWindow
72        */
73        void swapBuffers(bool waitForVSync);
74
75        /** Retrieves a handle to the window (Win32 specific)
76        */
77        HWND getWindowHandle(void) const;
78
79        /** Retrieves a handle to the window's parent, or 0 if there is no parent.
80        */
81        HWND getParentWindowHandle(void) const;
82
83        /** Returns true if this window is using DirectDraw.
84        */
85        bool isUsingDirectDraw(void) const;
86        /** Retrieves a pointer to the DirectDraw wrapper object used to
87            manage the window's surface. (Win32 specific)
88            @note
89                Only applicable for windows using DirectDraw.
90        */
91        DDDriver* getDirectDrawDriver(void);
92
93        /** Returns a pointer to a DirectDraw surface containing the
94            front buffer.
95            @note
96                Only applicable for windows using DirectDraw.
97        */
98        LPDIRECTDRAWSURFACE7 getDDFrontBuffer(void);
99
100        /** Returns a pointer to a DirectDraw surface containing the back
101            buffer. Only applicable if using DirectDraw.
102        */
103        LPDIRECTDRAWSURFACE7 getDDBackBuffer(void);
104
105        /** Returns a pointer to the Direct3D device that works with this
106            window
107            @note
108                Only applicable for windows using DirectDraw.
109        */
110        LPDIRECT3DDEVICE7 getD3DDevice(void);
111
112        bool requiresTextureFlipping() const { return false; }
113
114        /** Overridden - see RenderTarget.
115        */
116        void getCustomAttribute(const String& name, void* pData);
117
118        /** Overridden - see RenderTarget.
119        */
120        void writeContentsToFile(const String& filename);
121        // DirectDraw Methods
122                void createDDSurfaces(void);
123                void releaseDDSurfaces(void);
124                void restoreDDSurfaces(void);
125                void createDepthBuffer(void);
126#ifdef GTP_VISIBILITY_MODIFIED_OGRE
127                uchar *getBufferContents(int &dimx, int &dimy);
128#endif // GTP_VISIBILITY_MODIFIED_OGRE
129
130    protected:
131                HINSTANCE mInstance;                    // Process instance
132                DDDriver *mDriver;                      // D3D9 driver
133        // Win32-specific data members
134        bool mIsUsingDirectDraw;
135        HWND mHWnd;                    // Win32 Window handle
136        HWND mParentHWnd;
137        bool mActive;                // Is active i.e. visible
138        bool mReady;                // Is ready i.e. available for update
139        bool mClosed;
140
141        RECT rcBlitDest;            // Target for blit operation
142                                    // == window client area
143
144
145        static LRESULT CALLBACK WndProc(
146            HWND hWnd,
147            UINT uMsg,
148            WPARAM wParam,
149            LPARAM lParam);
150
151        // ---------------------------------------------------------
152        // DirectX-specific
153        // ---------------------------------------------------------
154
155        // Pointer to DDDriver encapsulating DirectDraw driver (if DirectX in use)
156        DDDriver* mlpDDDriver;
157
158        // Pointers to DX surfaces
159        LPDIRECTDRAWSURFACE7 mlpDDSFront; // Pointer to primary (front) buffer surface
160        LPDIRECTDRAWSURFACE7 mlpDDSBack; // Pointer to back buffer
161
162        // Pointer to the 3D Device specific for this window
163        LPDIRECT3DDEVICE7 mlpD3DDevice;
164
165
166        // Method for dealing with resize / move & 3d library
167        void windowMovedOrResized(void);
168       
169        // ---------------------------------------------------------
170        // OpenGL-specific details
171        // ---------------------------------------------------------
172
173        // TODO
174    };
175}
176#endif
Note: See TracBrowser for help on using the repository browser.