mirror of
https://github.com/barkeser2002/flower.git
synced 2026-09-25 12:05:57 +03:00
60 lines
1.1 KiB
C++
60 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#include "Core/Core.h"
|
|
#include "RuntimeModule.h"
|
|
#include "EngineTimer.h"
|
|
#include <irrKlang/irrKlang.h>
|
|
|
|
namespace Flower
|
|
{
|
|
constexpr size_t GMinRenderDim = 64;
|
|
constexpr size_t GMaxRenderDim = 3840;
|
|
constexpr size_t GBackBufferCount = 3;
|
|
|
|
constexpr size_t GLazyDestroyTime = GBackBufferCount + 1;
|
|
|
|
struct EnginePreInitInfo
|
|
{
|
|
GLFWwindow* window;
|
|
};
|
|
|
|
struct EngineTickData
|
|
{
|
|
int32_t windowWidth;
|
|
int32_t windowHeight;
|
|
|
|
bool bIsMinimized;
|
|
bool bLoseFocus;
|
|
};
|
|
|
|
class Engine final : private NonCopyable
|
|
{
|
|
private:
|
|
std::unique_ptr<ModuleManager> m_moduleManager{ nullptr };
|
|
|
|
EngineTimer m_timer;
|
|
irrklang::ISoundEngine* m_soundEngine;
|
|
|
|
public:
|
|
template <typename T>
|
|
T* getRuntimeModule() const
|
|
{
|
|
return m_moduleManager->getRuntimeModule<T>();
|
|
}
|
|
|
|
template<typename T>
|
|
void registerRuntimeModule()
|
|
{
|
|
m_moduleManager->registerRuntimeModule<T>();
|
|
}
|
|
|
|
void preInit(const EnginePreInitInfo& info);
|
|
void init();
|
|
bool tick(const EngineTickData& data);
|
|
void release();
|
|
|
|
auto* getSoundEngine() const { return m_soundEngine; }
|
|
};
|
|
|
|
extern Engine* GEngine;
|
|
} |