NcEngine
NcGraphics.h
Go to the documentation of this file.
1
5#pragma once
6
8#include "ncengine/graphics/Camera.h"
13#include "ncengine/type/EngineId.h"
14#include "ncengine/ui/IUI.h"
15
16namespace nc
17{
18struct SystemEvents;
19
20namespace config
21{
22struct AssetSettings;
23struct GraphicsSettings;
24struct MemorySettings;
25struct ProjectSettings;
26} // namespace config
27
46struct NcGraphics : public Module
47{
48 explicit NcGraphics() noexcept
49 : Module{NcGraphicsId} {}
50
59 virtual void SetCamera(Camera* camera) noexcept = 0;
60
65 virtual auto GetCamera() noexcept -> Camera* = 0;
66
71 virtual void SetUi(ui::IUI* ui) noexcept = 0;
72
76 virtual bool IsUiHovered() const noexcept = 0;
77
82 virtual void SetSkybox(const std::string& path) = 0;
83
88 virtual auto GetSkybox() const -> nc::asset::AssetId = 0;
89
96 virtual void ClearEnvironment() = 0;
97
99 virtual auto IsPostProcessEffectEnabled(PostProcessEffectId effectId) const -> bool = 0;
100
102 virtual void SetPostProcessEffectEnabled(PostProcessEffectId effectId, bool enabled) = 0;
103
106 PostProcessPassFlag::type pass) const -> const PostProcessPassProperties& = 0;
107
110 PostProcessPassFlag::type pass,
111 const PostProcessPassProperties& properties) = 0;
112
114 virtual auto GetTextureView(TextureViewType type, uint32_t index) -> void* = 0;
115};
116
121auto BuildGraphicsModule(const config::ProjectSettings& projectSettings,
122 const config::AssetSettings& assetSettings,
123 const config::GraphicsSettings& graphicsSettings,
124 const config::MemorySettings& memorySettings,
125 ModuleProvider modules,
126 ecs::Ecs world,
127 SystemEvents& events) -> std::unique_ptr<NcGraphics>;
128} // 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
Graphics module interface.
Definition: NcGraphics.h:47
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 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 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
Clear all environment data (currently only the skybox).
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