5#include "../../PreferencesModule.h"
8class ViewportModule :
public PreferencesModule
11 DECLARE_PREFERENCES_MODULE(ViewportModule)
14 virtual ~ViewportModule();
16 virtual const char* GetName()
const override {
return GetStaticName(); }
17 virtual const char* GetParentPath()
const override {
return GetStaticParentPath(); }
18 virtual void Render()
override;
23 glm::vec4 GetBackgroundColor()
const {
return mBackgroundColor; }
24 bool GetShowGrid()
const {
return mShowGrid; }
26 float GetGridSize()
const {
return mGridSize; }
27 glm::vec4 GetSelectedColor()
const {
return mSelectedColor; }
28 float GetSelectedCheckerSize()
const {
return mSelectedCheckerSize; }
29 float GetMenuBarPadding()
const {
return mMenuBarPadding; }
30 bool GetShowGizmosInPreview()
const {
return mShowGizmosInPreview; }
31 void SetShowGizmosInPreview(
bool show);
33 static ViewportModule*
Get();
34 static void HandleExternalGridToggle(
bool enabled);
37 void ApplyBackgroundColorToRenderer()
const;
38 void ApplyGridVisibility();
39 void ApplySelectedOverlay()
const;
41 glm::vec4 mBackgroundColor = glm::vec4(0.1f, 0.1f, 0.1f, 1.0f);
42 bool mShowGrid =
true;
43 glm::vec4 mGridColor = glm::vec4(0.3f, 0.3f, 0.3f, 1.0f);
44 float mGridSize = 1.0f;
45 glm::vec4 mSelectedColor = glm::vec4(0.2f, 0.1f, 1.0f, 0.6f);
46 float mSelectedCheckerSize = 8.0f;
47 float mMenuBarPadding = 8.0f;
48 bool mShowGizmosInPreview =
false;
50 static ViewportModule* sInstance;
51 static bool sSyncingGridState;
Definition JsonHelpers.h:15