summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/GfxDeviceWindow.cpp
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/GfxDevice/GfxDeviceWindow.cpp
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/GfxDevice/GfxDeviceWindow.cpp')
-rw-r--r--Runtime/GfxDevice/GfxDeviceWindow.cpp55
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;
+}