| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- /*
- -----------------------------------------------------------------------------
- This source file is part of OGRE
- (Object-oriented Graphics Rendering Engine)
- For the latest info, see http://www.ogre3d.org/
- Copyright (c) 2000-2011 Torus Knot Software Ltd
- Permission is hereby granted, free of charge, to any person obtaining a copy
- of this software and associated documentation files (the "Software"), to deal
- in the Software without restriction, including without limitation the rights
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- copies of the Software, and to permit persons to whom the Software is
- furnished to do so, subject to the following conditions:
- The above copyright notice and this permission notice shall be included in
- all copies or substantial portions of the Software.
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- THE SOFTWARE.
- -----------------------------------------------------------------------------
- */
- #pragma once
- #include "CmWin32Prerequisites.h"
- #include "CmRenderWindow.h"
- namespace CamelotFramework
- {
- class CM_RSGL_EXPORT Win32Window : public RenderWindow
- {
- public:
- ~Win32Window();
- /**
- * @copydoc RenderWindow::setFullscreen
- */
- void setFullscreen(bool fullScreen, UINT32 width, UINT32 height);
- /**
- * @copydoc RenderWindow::setHidden
- */
- void setHidden(bool hidden);
- /**
- * @copydoc RenderWindow::isActive
- */
- bool isActive() const;
- /**
- * @copydoc RenderWindow::isVisible
- */
- bool isVisible() const;
- /**
- * @copydoc RenderWindow::isClosed
- */
- bool isClosed() const;
- /**
- * @copydoc RenderWindow::reposition
- */
- void move(INT32 left, INT32 top);
- /**
- * @copydoc RenderWindow::resize
- */
- void resize(UINT32 width, UINT32 height);
- /**
- * @copydoc RenderWindow::copyContentsToMemory
- */
- void copyToMemory(const PixelData &dst, FrameBuffer buffer);
- /**
- * @copydoc RenderWindow::swapBuffers
- */
- void swapBuffers();
- /**
- * @copydoc RenderWindow::requiresTextureFlipping
- */
- bool requiresTextureFlipping() const { return false; }
- /**
- * @copydoc RenderWindow::screenToWindowPos
- */
- Vector2I screenToWindowPos(const Vector2I& screenPos) const;
- /**
- * @copydoc RenderWindow::windowToScreenPos
- */
- Vector2I windowToScreenPos(const Vector2I& windowPos) const;
- /**
- * @copydoc RenderWindow::getCustomAttribute
- */
- void getCustomAttribute(const String& name, void* pData) const;
- /**
- * @copydoc RenderWindow::setActive
- */
- virtual void setActive( bool state );
- /**
- * @copydoc RenderWindow::_windowMovedOrResized
- */
- void _windowMovedOrResized(void);
- HWND _getWindowHandle() const { return mHWnd; }
- HDC _getHDC() const { return mHDC; }
-
- void _adjustWindow(unsigned int clientWidth, unsigned int clientHeight,
- unsigned int* winWidth, unsigned int* winHeight);
- protected:
- friend class GLRenderWindowManager;
- friend class Win32GLSupport;
- Win32Window(const RENDER_WINDOW_DESC& desc, Win32GLSupport &glsupport);
- Win32GLSupport &mGLSupport;
- HWND mHWnd; // Win32 Window handle
- HDC mHDC;
- HGLRC mGlrc;
- bool mIsExternal;
- char* mDeviceName;
- bool mIsExternalGLControl;
- bool mIsExternalGLContext;
- bool mSizing;
- bool mClosed;
- int mDisplayFrequency; // fullscreen only, to restore display
- Win32Context *mContext;
- /**
- * @copydoc RenderWindow::initialize_internal().
- */
- void initialize_internal();
- /**
- * @copydoc RenderWindow::destroy_internal().
- */
- void destroy_internal();
- };
- }
|