| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162 |
- #pragma once
- #include "BsD3D9Prerequisites.h"
- #include "BsRenderWindow.h"
- #include "BsD3D9Device.h"
- namespace BansheeEngine
- {
- class BS_D3D9_EXPORT D3D9RenderWindow : public RenderWindow
- {
- public:
- ~D3D9RenderWindow();
-
- /**
- * @copydoc RenderWindow::setFullscreen(UINT32, UINT32, float, UINT32)
- */
- void setFullscreen(UINT32 width, UINT32 height, float refreshRate = 60.0f, UINT32 monitorIdx = 0);
- /**
- * @copydoc RenderWindow::setFullscreen(const VideoMode&)
- */
- void setFullscreen(const VideoMode& mode);
- /**
- * @copydoc RenderWindow::setWindowed
- */
- void setWindowed(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 { return mClosed; }
- /**
- * @copydoc RenderWindow::isVSync
- */
- bool isVSync() const { return mVSync; }
- /**
- * @copydoc RenderWindow::reposition
- */
- void move(INT32 left, INT32 top);
- /**
- * @copydoc RenderWindow::resize
- */
- void resize(UINT32 width, UINT32 height);
- /**
- * @copydoc RenderWindow::getCustomAttribute
- */
- void getCustomAttribute(const String& name, void* pData) const;
- /**
- * @copydoc RenderWindow::copyContentsToMemory
- */
- void copyToMemory(const PixelData &dst, FrameBuffer buffer);
- /**
- * @copydoc RenderWindow::requiresTextureFlipping
- */
- bool requiresTextureFlipping() const { return false; }
- /**
- * @copydoc RenderWindow::swapBuffers
- */
- void swapBuffers();
- /**
- * @copydoc RenderWindow::screenToWindowPos
- */
- Vector2I screenToWindowPos(const Vector2I& screenPos) const;
- /**
- * @copydoc RenderWindow::windowToScreenPos
- */
- Vector2I windowToScreenPos(const Vector2I& windowPos) const;
- /**
- * @copydoc RenderWindow::_windowMovedOrResized
- */
- void _windowMovedOrResized();
- HWND _getWindowHandle() const { return mHWnd; }
- IDirect3DDevice9* _getD3D9Device() const;
- D3D9Device* _getDevice() const;
- void _setDevice(D3D9Device* device);
- /**
- * @brief Build the presentation parameters used with this window.
- */
- void _buildPresentParameters(D3DPRESENT_PARAMETERS* presentParams) const;
- /**
- * @brief Accessor for render surface.
- */
- IDirect3DSurface9* _getRenderSurface() const;
-
- /**
- * @brief Returns true if this window use depth buffer.
- */
- bool _isDepthBuffered() const;
- /**
- * @brief Validate the device for this window.
- */
- bool _validateDevice();
- void _adjustWindow(unsigned int clientWidth, unsigned int clientHeight,
- DWORD style, unsigned int* winWidth, unsigned int* winHeight);
- protected:
- friend class D3D9RenderWindowManager;
- D3D9RenderWindow (const RENDER_WINDOW_DESC& desc, HINSTANCE instance);
- void updateWindowRect();
- /**
- * @copydoc RenderWindow::initialize_internal().
- */
- void initialize_internal();
- /**
- * @copydoc RenderWindow::destroy_internal().
- */
- void destroy_internal();
- protected:
- HINSTANCE mInstance;
- D3D9Device* mDevice;
- bool mDeviceValid;
- HWND mHWnd;
- bool mIsExternal;
- bool mClosed;
- D3DMULTISAMPLE_TYPE mMultisampleType;
- DWORD mMultisampleQuality;
- UINT mDisplayFrequency;
- bool mVSync;
- unsigned int mVSyncInterval;
- DWORD mStyle;
- DWORD mWindowedStyle;
- DWORD mWindowedStyleEx;
- bool mIsDepthBuffered;
- bool mIsChild;
- };
- }
|