NcEngine
NcGraphics.h
Go to the documentation of this file.
1
5#pragma once
6
8#include "ncengine/graphics/Camera.h"
14#include "ncengine/type/EngineId.h"
15#include "ncengine/ui/IUI.h"
16
17namespace nc
18{
19struct SystemEvents;
20
21namespace config
22{
23struct AssetSettings;
24struct GraphicsSettings;
25struct MemorySettings;
26struct ProjectSettings;
27} // namespace config
28
47struct NcGraphics : public Module
48{
49 explicit NcGraphics() noexcept
50 : Module{NcGraphicsId} {}
51
60 virtual void SetCamera(Camera* camera) noexcept = 0;
61
66 virtual auto GetCamera() noexcept -> Camera* = 0;
67
72 virtual void SetUi(ui::IUI* ui) noexcept = 0;
73
77 virtual bool IsUiHovered() const noexcept = 0;
78
83 virtual auto GetSkybox() const -> nc::asset::AssetId = 0;
84
89 virtual void SetSkybox(const std::string& path) = 0;
90
96 virtual void ClearSkybox() = 0;
97
102 virtual auto GetEnvironment() const -> const Environment& = 0;
103
108 virtual void SetEnvironment(const Environment& environment) = 0;
109
116 virtual void ClearEnvironment() = 0;
117
119 virtual auto IsPostProcessEffectEnabled(PostProcessEffectId effectId) const -> bool = 0;
120
122 virtual void SetPostProcessEffectEnabled(PostProcessEffectId effectId, bool enabled) = 0;
123
126 PostProcessPassFlag::type pass) const -> const PostProcessPassProperties& = 0;
127
130 PostProcessPassFlag::type pass,
131 const PostProcessPassProperties& properties) = 0;
132
134 virtual auto GetTextureView(TextureViewType type, uint32_t index) -> void* = 0;
135};
136
141auto BuildGraphicsModule(const config::ProjectSettings& projectSettings,
142 const config::AssetSettings& assetSettings,
143 const config::GraphicsSettings& graphicsSettings,
144 const config::MemorySettings& memorySettings,
145 ModuleProvider modules,
146 ecs::Ecs world,
147 SystemEvents& events) -> std::unique_ptr<NcGraphics>;
148} // namespace nc
TextureViewType
Texture view types used throughout NcEngine.
Definition: GraphicsUtility.h:24
std::variant< EmptyPassProperties, OutlinePassProperties, NoisePassProperties > PostProcessPassProperties
Generic post process property type.
Definition: PostProcess.h:68
uint32_t PostProcessEffectId
Identifier for a post process effect.
Definition: PostProcess.h:27
Basic camera component.
Definition: Camera.h:44
Modules are extensions that provide functionality to the engine.
Definition: Module.h:19
Provides access to registered Modules.
Definition: ModuleProvider.h:15
Contains global graphics properties.
Definition: Environment.h:14
Graphics module interface.
Definition: NcGraphics.h:48
virtual void SetSkybox(const std::string &path)=0
Set the current skybox.
virtual auto IsPostProcessEffectEnabled(PostProcessEffectId effectId) const -> bool=0
Returns if a post process effect is enabled.
virtual auto GetPostProcessEffectProperties(PostProcessEffectId effectId, PostProcessPassFlag::type pass) const -> const PostProcessPassProperties &=0
Get the pass properties for a post process effect.
virtual void SetCamera(Camera *camera) noexcept=0
Set the main Camera.
virtual auto GetTextureView(TextureViewType type, uint32_t index) -> void *=0
Get the handle to the texture view at the given index and the given type.
virtual void SetEnvironment(const Environment &environment)=0
Set the current environment properties.
virtual void SetUi(ui::IUI *ui) noexcept=0
Set a custom ui to receive draw callbacks during rendering.
virtual auto GetCamera() noexcept -> Camera *=0
Get the main Camera.
virtual auto GetEnvironment() const -> const Environment &=0
Gets the current environment properties.
virtual void ClearSkybox()=0
Clears the active skybox.
virtual auto GetSkybox() const -> nc::asset::AssetId=0
Gets the current skybox.
virtual bool IsUiHovered() const noexcept=0
Returns if the ui is currently hovered by the mouse.
virtual void ClearEnvironment()=0
Clears all environment data.
virtual void SetPostProcessEffectEnabled(PostProcessEffectId effectId, bool enabled)=0
Enabled or disable a post process effect.
virtual void SetPostProcessEffectProperties(PostProcessEffectId effectId, PostProcessPassFlag::type pass, const PostProcessPassProperties &properties)=0
Set the pass properties for a post process effect.
Post process pass flags.
Definition: PostProcess.h:17
Signals for internal engine events.
Definition: Events.h:14