From 15740faf9fe9fe4be08965098bbf2947e096aeeb Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Aug 2019 22:50:43 +0800 Subject: +Unity Runtime code --- Runtime/GfxDevice/GfxDeviceWindow.h | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 Runtime/GfxDevice/GfxDeviceWindow.h (limited to 'Runtime/GfxDevice/GfxDeviceWindow.h') 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 -- cgit v1.1-26-g67d0