diff options
author | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2019-08-14 22:50:43 +0800 |
commit | 15740faf9fe9fe4be08965098bbf2947e096aeeb (patch) | |
tree | a730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/GfxDeviceWindow.cpp |
Diffstat (limited to 'Runtime/GfxDevice/GfxDeviceWindow.cpp')
-rw-r--r-- | Runtime/GfxDevice/GfxDeviceWindow.cpp | 55 |
1 files changed, 55 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/GfxDeviceWindow.cpp b/Runtime/GfxDevice/GfxDeviceWindow.cpp new file mode 100644 index 0000000..c6e4933 --- /dev/null +++ b/Runtime/GfxDevice/GfxDeviceWindow.cpp @@ -0,0 +1,55 @@ +#include "UnityPrefix.h" +#include "GfxDeviceWindow.h" + + +GfxDeviceWindow::GfxDeviceWindow (NativeWindow window, int width, int height, DepthBufferFormat depthFormat, int antiAlias) + : m_Window (window) + , m_Width (0) + , m_Height (0) + , m_InvalidState (true) + , m_CanUseBlitOptimization (false) +{ + //Reshape (width, height, depthFormat, antiAlias); +} + +GfxDeviceWindow::~GfxDeviceWindow () +{ +} + +bool GfxDeviceWindow::Reshape (int width, int height, DepthBufferFormat depthFormat, int antiAlias) +{ + m_InvalidState = false; + + AssertIf (!m_Window); + + m_Width = width; + m_Height = height; + + if (m_Width <= 0 || m_Height <= 0) + { + m_InvalidState = true; + } + + return !m_InvalidState; +} + + +bool GfxDeviceWindow::BeginRendering () +{ + if (m_InvalidState) + { + return false; + } + + return true; +} + +bool GfxDeviceWindow::EndRendering (bool presentContent) +{ + if (m_InvalidState) + { + return false; + } + + return true; +} |