added game_object_pool_size as Engine constructor argument
This commit is contained in:
parent
851e1ee122
commit
8fd6cee223
@ -3,12 +3,9 @@
|
||||
|
||||
namespace ougge {
|
||||
|
||||
Engine::Engine()
|
||||
: gameObjectPool(GAMEOBJECTPOOL_SIZE), textures(&resourceManager)
|
||||
Engine::Engine(u32 game_object_pool_size)
|
||||
: gameObjectPool(game_object_pool_size), textures(&resourceManager)
|
||||
{
|
||||
}
|
||||
|
||||
void Engine::init(){
|
||||
engineManagedAssembly = mono.loadAssembly("Ougge.dll");
|
||||
gameObjectClass = engineManagedAssembly->getClass("Ougge", "GameObject");
|
||||
gameObjectCtor = Mono::Method<void(u64, u32)>(gameObjectClass, ".ctor");
|
||||
|
||||
@ -8,8 +8,6 @@
|
||||
|
||||
namespace ougge {
|
||||
|
||||
#define GAMEOBJECTPOOL_SIZE 64*1024
|
||||
|
||||
using UpdateFunc_t = function_shared_ptr<void(f64)>;
|
||||
|
||||
class Engine {
|
||||
@ -32,8 +30,8 @@ public:
|
||||
resources::ResourceManager resourceManager;
|
||||
resources::CacheStorage<resources::Texture> textures;
|
||||
|
||||
Engine();
|
||||
void init();
|
||||
Engine(u32 game_object_pool_size = 64*1024);
|
||||
|
||||
void openMainWindow(const std::string& window_title);
|
||||
// start game loop on the current thread
|
||||
void startLoop();
|
||||
|
||||
@ -22,12 +22,9 @@ void drawTutel(Engine& engine){
|
||||
|
||||
int main(int argc, const char** argv){
|
||||
try {
|
||||
std::cout<<"initialized resource loader"<<std::endl;
|
||||
|
||||
std::cout<<"initializing game engine... ";
|
||||
Engine engine;
|
||||
std::cout<<"initialized mono jit runtime"<<std::endl;
|
||||
engine.init();
|
||||
std::cout<<"initialized game engine"<<std::endl;
|
||||
std::cout<<"done"<<std::endl;
|
||||
|
||||
game::GameObject& exampleObj = engine.createGameObject();
|
||||
std::string componentClassName = "Ougge.ExampleComponent";
|
||||
|
||||
Loading…
Reference in New Issue
Block a user