MQEngine
载入中...
搜索中...
未找到
engine.h
浏览该文件的文档.
1/*
2 *@file engine.h
3 */
4
5#ifndef ENGINE_H
6#define ENGINE_H
8#include "application.h"
9#include "systemmanager.h"
10#include "layout.h"
11#include "../data/DataManager.h"
18#include "./EngineGlobal.h"
19#include "Tech.h"
20
21namespace FCT
22{
23 class Layout;
24}
25
26#include "UniformSlots.h"
27
28namespace MQEngine {
29 class EngineScope;
31 {
32 public:
33 Engine(const Engine&) = delete;
34 Engine& operator=(const Engine&) = delete;
35 void loop();
36 static Engine& getInstance();
37 friend class EngineScope;
38
39
40 private:
41 void init(Application* application);
42 void term();
43 void settingUpEnv();
44 void settingUpTechs();
45 void settingUpPass();
46 void settingUpResources();
47 void settingUpSync();
49 void initUniformValue();
50 void logicTick();
51 Engine() = default;
52 ~Engine() = default;
55 FCT::Runtime m_rt;
57 FCT::Window* m_wnd;
58 FCT::Context* m_ctx;
59 FCT::VertexLayout vertexLayout = {
60 FCT::VertexElement{FCT::VtxType::Color4f,"color"},
61 FCT::VertexElement{FCT::VtxType::Position4f,"position"},
62 FCT::VertexElement{FCT::VtxType::TexCoord2f,"texCoord"},
63 FCT::VertexElement{FCT::VtxType::Normal3f,"normal"},
64 };
65 FCT::PixelLayout pixelLayout = {
66 FCT::VertexElement{FCT::VtxType::Custom,"srcpos",FCT::Format::R32G32B32A32_SFLOAT},
67 FCT::VertexElement{FCT::VtxType::Custom,"shadowPos",FCT::Format::R32G32B32A32_SFLOAT},
69 };
70 FCT::Sampler* m_shadowSampler;
71 FCT::ShaderRef m_vs;
72 FCT::ShaderRef m_ps;
73 FCT::ShaderRef m_vsShadow;
74 FCT::RHI::RasterizationPipeline* m_pipeline;
75 FCT::UniformBuffer* m_uniform;
76 FCT::RHI::ConstBuffer* m_constBuffer;
77 FCT::AutoViewport* m_autoViewport;
78
79 FCT::Layout* m_layout;
80 FCT::Layout* m_shadowLayout;
82 FCT::UniquePtr<CameraSystem> m_cameraSystem;
83 FCT::UniquePtr<MeshCacheSystem> m_meshRenderSystem;
84 FCT::UniquePtr<ScriptSystem> m_scriptSystem;
85 FCT::UniquePtr<MatrixCacheSystem> m_matrixCacheSystem;
86 FCT::UniquePtr<LightingSystem> m_lightingSystem;
87 FCT::UniquePtr<TextureCacheSystem> m_textureRenderSystem;
88 FCT::UniquePtr<TechManager> m_techManager;
89 FCT::Uniform m_floorModelUniform;
90
91 // OutputInfo for passes
92 FCT::OutputInfo m_shadowPassOutputInfo;
93 FCT::OutputInfo m_objectPassOutputInfo;
94 FCT::NodeEnvironment* m_nodeEnv;
95 };
96
99 ENGINE_API const char* getEngineVersion();
105 ENGINE_API std::vector<FCT::_fct_object_t*> GetDebugObject();
106}
107#endif //ENGINE_H
A header file containing third party libraries and macros for platform
#define ENGINE_API
定义 EnginePCH.h:14
定义 application.h:35
定义 DataManager.h:58
定义 engine.h:31
FCT::Runtime m_rt
定义 engine.h:55
SystemManager m_systemManager
定义 engine.h:56
void settingUpTechs()
定义 engine.cpp:58
FCT::ShaderRef m_vs
定义 engine.h:71
DataManager * m_dataManager
定义 engine.h:81
Engine()=default
FCT::NodeEnvironment * m_nodeEnv
定义 engine.h:94
FCT::UniquePtr< TextureCacheSystem > m_textureRenderSystem
定义 engine.h:87
void settingUpResources()
定义 engine.cpp:218
void settingUpSync()
定义 engine.cpp:229
void term()
定义 engine.cpp:315
friend class EngineScope
定义 engine.h:37
Engine & operator=(const Engine &)=delete
FCT::Layout * m_layout
定义 engine.h:79
FCT::PixelLayout pixelLayout
定义 engine.h:65
FCT::Layout * m_shadowLayout
定义 engine.h:80
FCT::ShaderRef m_vsShadow
定义 engine.h:73
FCT::UniquePtr< MeshCacheSystem > m_meshRenderSystem
定义 engine.h:83
FCT::VertexLayout vertexLayout
定义 engine.h:59
FCT::OutputInfo m_shadowPassOutputInfo
定义 engine.h:92
void loop()
定义 engine.cpp:307
FCT::Window * m_wnd
定义 engine.h:57
void initUniformValue()
定义 engine.cpp:266
void logicTick()
定义 engine.cpp:273
FCT::UniquePtr< CameraSystem > m_cameraSystem
定义 engine.h:82
FCT::UniquePtr< LightingSystem > m_lightingSystem
定义 engine.h:86
FCT::OutputInfo m_objectPassOutputInfo
定义 engine.h:93
void settingUpPass()
定义 engine.cpp:169
static Engine * s_instance
定义 engine.h:53
FCT::RHI::RasterizationPipeline * m_pipeline
定义 engine.h:74
static Engine & getInstance()
定义 engine.cpp:325
~Engine()=default
void init(Application *application)
定义 engine.cpp:291
FCT::ShaderRef m_ps
定义 engine.h:72
FCT::AutoViewport * m_autoViewport
定义 engine.h:77
FCT::Sampler * m_shadowSampler
定义 engine.h:70
Engine(const Engine &)=delete
FCT::UniquePtr< TechManager > m_techManager
定义 engine.h:88
void settingUpEnv()
定义 engine.cpp:22
FCT::UniquePtr< MatrixCacheSystem > m_matrixCacheSystem
定义 engine.h:85
Application * m_application
定义 engine.h:54
FCT::Context * m_ctx
定义 engine.h:58
FCT::UniquePtr< ScriptSystem > m_scriptSystem
定义 engine.h:84
FCT::Uniform m_floorModelUniform
定义 engine.h:89
FCT::UniformBuffer * m_uniform
定义 engine.h:75
FCT::RHI::ConstBuffer * m_constBuffer
定义 engine.h:76
void settingUpSubmitTicker()
定义 engine.cpp:239
定义 enginescope.h:9
定义 systemmanager.h:8
定义 engine.cpp:11
定义 application.h:5
ENGINE_API const char * getEngineVersion()
定义 Tutorial.cpp:8
ENGINE_API Engine & getEngine()
定义 Tutorial.cpp:12
ENGINE_API std::vector< FCT::_fct_object_t * > GetDebugObject()
定义 Tutorial.cpp:21
ENGINE_API void OutputDebugObject()
定义 Tutorial.cpp:16
class header for start and stop system