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/Camera/GraphicsSettings.h | 48 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Runtime/Camera/GraphicsSettings.h (limited to 'Runtime/Camera/GraphicsSettings.h') diff --git a/Runtime/Camera/GraphicsSettings.h b/Runtime/Camera/GraphicsSettings.h new file mode 100644 index 0000000..bfb95ce --- /dev/null +++ b/Runtime/Camera/GraphicsSettings.h @@ -0,0 +1,48 @@ +#pragma once + +#include "Runtime/BaseClasses/GameManager.h" +#include "Runtime/Shaders/Shader.h" +#include + + +class GraphicsSettings : public GlobalGameManager +{ +public: + typedef UNITY_VECTOR(kMemRenderer, PPtr) ShaderArray; + + REGISTER_DERIVED_CLASS (GraphicsSettings, GlobalGameManager) + DECLARE_OBJECT_SERIALIZE (GraphicsSettings) + + GraphicsSettings (MemLabelId label, ObjectCreationMode mode); + // ~GraphicsSettings (); declared-by-macro + + static void InitializeClass (); + static void CleanupClass (); + + virtual void Reset (); + + #if UNITY_EDITOR + bool DoesNeedToInitializeDefaultShaders() const { return m_NeedToInitializeDefaultShaders; } + #endif + void SetDefaultAlwaysIncludedShaders(); + + /// Return true if the given shader is in the list of shaders + /// that should always be included in builds. + bool IsAlwaysIncludedShader (PPtr shader) const; + +#if UNITY_EDITOR + + const ShaderArray& GetAlwaysIncludedShaders () const { return m_AlwaysIncludedShaders; } + + /// Add a shader to the list of shaders that are aways included in builds. + /// NOTE: Does not check whether the shader is already on the list. + void AddAlwaysIncludedShader (PPtr shader); + +#endif + +private: + ShaderArray m_AlwaysIncludedShaders; + bool m_NeedToInitializeDefaultShaders; +}; + +GraphicsSettings& GetGraphicsSettings(); -- cgit v1.1-26-g67d0