MQEngine
载入中...
搜索中...
未找到
engine.h
浏览该文件的文档.
1/*
2 *@file engine.h
3 */
4
5#ifndef ENGINE_H
6#define ENGINE_H
7#include "CreateApplication.h"
17#include "./EngineGlobal.h"
18#include "Tech.h"
19#include "VertexLayouts.h"
20#include "application.h"
21#include "layout.h"
22#include "systemmanager.h"
23
24namespace FCT
25{
26 class Layout;
27}
28
29#include "UniformSlots.h"
30
31namespace MQEngine {
33 {
34 public:
35 Engine();
36 ~Engine();
37 Engine(const Engine&) = delete;
38 Engine& operator=(const Engine&) = delete;
39 void init(Application* application);
40 void term();
41 void loop();
42 static Engine& getInstance();
44
46 private:
47 void settingUpEnv();
48 void settingUpTechs();
49 void settingUpPass();
50 void settingUpResources();
51 void settingUpSync();
53 void initUniformValue();
54 void logicTick();
56 FCT::Runtime m_rt;
58 FCT::Window* m_wnd;
59 FCT::Context* m_ctx;
61 FCT::PixelLayout pixelLayout = {
62 FCT::VertexElement{FCT::VtxType::Custom,"srcpos",FCT::Format::R32G32B32A32_SFLOAT},
63 FCT::VertexElement{FCT::VtxType::Custom,"shadowPos",FCT::Format::R32G32B32A32_SFLOAT},
65 };
66 FCT::Sampler* m_shadowSampler;
67 FCT::Sampler* m_diffuseSampler;
68 FCT::ShaderRef m_vs;
69 FCT::ShaderRef m_ps;
70 FCT::ShaderRef m_vsShadow;
71 FCT::RHI::RasterizationPipeline* m_pipeline;
72 FCT::UniformBuffer* m_uniform;
73 FCT::RHI::ConstBuffer* m_constBuffer;
74 FCT::AutoViewport* m_autoViewport;
75
76 FCT::Layout* m_layout;
77 FCT::Layout* m_shadowLayout;
79 FCT::UniquePtr<CameraSystem> m_cameraSystem;
80 FCT::UniquePtr<MeshCacheSystem> m_meshRenderSystem;
81 FCT::UniquePtr<ScriptSystem> m_scriptSystem;
82 FCT::UniquePtr<MatrixCacheSystem> m_matrixCacheSystem;
83 FCT::UniquePtr<LightingSystem> m_lightingSystem;
84 FCT::UniquePtr<TextureCacheSystem> m_textureRenderSystem;
85 FCT::UniquePtr<ShininessSystem> m_shininessSystem;
86 FCT::UniquePtr<TechManager> m_techManager;
87 FCT::Uniform m_floorModelUniform;
88
89 // OutputInfo for passes
90 FCT::OutputInfo m_shadowPassOutputInfo;
91 FCT::OutputInfo m_objectPassOutputInfo;
92 FCT::NodeEnvironment* m_nodeEnv;
93 };
94
97 ENGINE_API const char* getEngineVersion();
103#ifdef FCT_DEBUG
104 ENGINE_API std::vector<FCT::_fct_object_t*> GetDebugObject();
105#endif // DEBUG
106}
107#endif //ENGINE_H
A header file containing third party libraries and macros for platform
#define ENGINE_API
定义 EnginePCH.h:14
定义 application.h:38
定义 DataManager.h:58
定义 engine.h:33
FCT::Runtime m_rt
定义 engine.h:56
SystemManager m_systemManager
定义 engine.h:57
void settingUpTechs()
定义 engine.cpp:69
FCT::UniquePtr< ShininessSystem > m_shininessSystem
定义 engine.h:85
FCT::ShaderRef m_vs
定义 engine.h:68
DataManager * m_dataManager
定义 engine.h:78
FCT::NodeEnvironment * m_nodeEnv
定义 engine.h:92
FCT::UniquePtr< TextureCacheSystem > m_textureRenderSystem
定义 engine.h:84
void settingUpResources()
定义 engine.cpp:294
void settingUpSync()
定义 engine.cpp:307
void term()
定义 engine.cpp:396
Engine & operator=(const Engine &)=delete
FCT::Layout * m_layout
定义 engine.h:76
FCT::PixelLayout pixelLayout
定义 engine.h:61
FCT::Layout * m_shadowLayout
定义 engine.h:77
FCT::ShaderRef m_vsShadow
定义 engine.h:70
FCT::UniquePtr< MeshCacheSystem > m_meshRenderSystem
定义 engine.h:80
FCT::VertexLayout vertexLayout
定义 engine.h:60
FCT::OutputInfo m_shadowPassOutputInfo
定义 engine.h:90
void loop()
定义 engine.cpp:388
FCT::Window * m_wnd
定义 engine.h:58
void initUniformValue()
定义 engine.cpp:346
void logicTick()
定义 engine.cpp:351
FCT::UniquePtr< CameraSystem > m_cameraSystem
定义 engine.h:79
FCT::UniquePtr< LightingSystem > m_lightingSystem
定义 engine.h:83
FCT::OutputInfo m_objectPassOutputInfo
定义 engine.h:91
void settingUpPass()
定义 engine.cpp:245
static Engine * s_instance
定义 engine.h:45
FCT::RHI::RasterizationPipeline * m_pipeline
定义 engine.h:71
static Engine & getInstance()
定义 engine.cpp:413
void init(Application *application)
定义 engine.cpp:370
FCT::ShaderRef m_ps
定义 engine.h:69
FCT::Sampler * m_diffuseSampler
定义 engine.h:67
FCT::AutoViewport * m_autoViewport
定义 engine.h:74
FCT::Sampler * m_shadowSampler
定义 engine.h:66
Engine(const Engine &)=delete
FCT::UniquePtr< TechManager > m_techManager
定义 engine.h:86
void settingUpEnv()
定义 engine.cpp:30
static void RegisterApplicationFactory(CreateApplicationFn fn)
定义 engine.cpp:425
FCT::UniquePtr< MatrixCacheSystem > m_matrixCacheSystem
定义 engine.h:82
Application * m_application
定义 engine.h:55
FCT::Context * m_ctx
定义 engine.h:59
Engine()
定义 engine.cpp:417
FCT::UniquePtr< ScriptSystem > m_scriptSystem
定义 engine.h:81
FCT::Uniform m_floorModelUniform
定义 engine.h:87
FCT::UniformBuffer * m_uniform
定义 engine.h:72
FCT::RHI::ConstBuffer * m_constBuffer
定义 engine.h:73
void settingUpSubmitTicker()
定义 engine.cpp:317
定义 systemmanager.h:8
定义 engine.cpp:21
Entrypoint for the program.
定义 application.h:5
ENGINE_API const char * getEngineVersion()
定义 Tutorial.cpp:9
constexpr FCT::VertexLayout StandardMeshVertexLayout
定义 VertexLayouts.h:8
ENGINE_API void OutputDebugObject()
ENGINE_API Engine & getEngine()
定义 Tutorial.cpp:13
Application *(*)() CreateApplicationFn
定义 CreateApplication.h:8
class header for start and stop system