1 | /*
|
---|
2 | -----------------------------------------------------------------------------
|
---|
3 | This source file is part of OGRE
|
---|
4 | (Object-oriented Graphics Rendering Engine)
|
---|
5 | For the latest info, see http://www.ogre3d.org/
|
---|
6 |
|
---|
7 | Copyright (c) 2000-2005 The OGRE Team
|
---|
8 | Also see acknowledgements in Readme.html
|
---|
9 |
|
---|
10 | This program is free software; you can redistribute it and/or modify it under
|
---|
11 | the terms of the GNU Lesser General Public License as published by the Free Software
|
---|
12 | Foundation; either version 2 of the License, or (at your option) any later
|
---|
13 | version.
|
---|
14 |
|
---|
15 | This program is distributed in the hope that it will be useful, but WITHOUT
|
---|
16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
---|
17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
|
---|
18 |
|
---|
19 | You should have received a copy of the GNU Lesser General Public License along with
|
---|
20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
---|
21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to
|
---|
22 | http://www.gnu.org/copyleft/lesser.txt.
|
---|
23 | -----------------------------------------------------------------------------
|
---|
24 | */
|
---|
25 |
|
---|
26 | #ifndef __Win32Window_H__
|
---|
27 | #define __Win32Window_H__
|
---|
28 |
|
---|
29 | #include "OgreWin32Prerequisites.h"
|
---|
30 | #include "OgreRenderWindow.h"
|
---|
31 |
|
---|
32 | namespace Ogre {
|
---|
33 | class Win32Window : public RenderWindow
|
---|
34 | {
|
---|
35 | public:
|
---|
36 | Win32Window(Win32GLSupport &glsupport);
|
---|
37 | ~Win32Window();
|
---|
38 |
|
---|
39 | void create(const String& name, unsigned int width, unsigned int height,
|
---|
40 | bool fullScreen, const NameValuePairList *miscParams);
|
---|
41 | void destroy(void);
|
---|
42 | bool isVisible() const;
|
---|
43 | bool isClosed(void) const;
|
---|
44 | void reposition(int left, int top);
|
---|
45 | void resize(unsigned int width, unsigned int height);
|
---|
46 | void swapBuffers(bool waitForVSync);
|
---|
47 |
|
---|
48 | /** Overridden - see RenderTarget.
|
---|
49 | */
|
---|
50 | void writeContentsToFile(const String& filename);
|
---|
51 |
|
---|
52 | bool requiresTextureFlipping() const { return false; }
|
---|
53 |
|
---|
54 | HWND getWindowHandle() const { return mHWnd; }
|
---|
55 | HDC getHDC() const { return mHDC; }
|
---|
56 |
|
---|
57 | // Method for dealing with resize / move & 3d library
|
---|
58 | virtual void windowMovedOrResized(void);
|
---|
59 |
|
---|
60 | void getCustomAttribute( const String& name, void* pData );
|
---|
61 |
|
---|
62 | protected:
|
---|
63 | Win32GLSupport &mGLSupport;
|
---|
64 | HWND mHWnd; // Win32 Window handle
|
---|
65 | HDC mHDC;
|
---|
66 | HGLRC mGlrc;
|
---|
67 | bool mIsExternal;
|
---|
68 | bool mSizing;
|
---|
69 | bool mClosed;
|
---|
70 | int mDisplayFrequency; // fullscreen only, to restore display
|
---|
71 | Win32Context *mContext;
|
---|
72 |
|
---|
73 | static LRESULT CALLBACK WndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
|
---|
74 | };
|
---|
75 | }
|
---|
76 |
|
---|
77 | #endif
|
---|