summaryrefslogtreecommitdiff
path: root/Runtime/GfxDevice/GfxDeviceWindow.h
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.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/GfxDevice/GfxDeviceWindow.h')
-rw-r--r--Runtime/GfxDevice/GfxDeviceWindow.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/Runtime/GfxDevice/GfxDeviceWindow.h b/Runtime/GfxDevice/GfxDeviceWindow.h
new file mode 100644
index 0000000..0b8b022
--- /dev/null
+++ b/Runtime/GfxDevice/GfxDeviceWindow.h
@@ -0,0 +1,36 @@
+#ifndef GFXDEVICEWINDOW_H
+#define GFXDEVICEWINDOW_H
+
+#include "GfxDeviceTypes.h"
+
+class GfxDeviceWindow
+{
+protected:
+ NativeWindow m_Window;
+ int m_Width;
+ int m_Height;
+ bool m_InvalidState;
+ bool m_CanUseBlitOptimization;
+public:
+ GfxDeviceWindow (NativeWindow window, int width, int height, DepthBufferFormat depthFormat, int antiAlias);
+ virtual ~GfxDeviceWindow();
+
+ //Returns true if reshaping was successful
+ virtual bool Reshape( int width, int height, DepthBufferFormat depthFormat, int antiAlias );
+
+ //Returns true if succeeded to prepare for rendering
+ virtual bool BeginRendering();
+
+ virtual void SetAsActiveWindow () { };
+
+ //Returns true if succeeded to finish rendering
+ virtual bool EndRendering( bool presentContent );
+
+ inline bool CanUseBlitOptimization() const { return m_CanUseBlitOptimization; }
+
+ inline int GetWidth() const { return m_Width; }
+ inline int GetHeight() const { return m_Height; }
+ inline NativeWindow GetHandle () const { return m_Window; }
+};
+
+#endif