Add classes Mesh and StaticMesh
This commit is contained in:
@@ -44,7 +44,6 @@ class CoreInstance {
|
||||
RenderEngine* render_engine_;
|
||||
GameInstance* game_;
|
||||
|
||||
|
||||
bool is_ready = false;
|
||||
public:
|
||||
CoreInstance();
|
||||
@@ -58,4 +57,5 @@ public:
|
||||
double getMemorySize() const { return memorySize_; }
|
||||
const std::string& getBaseWorldName() const { return main_config_.base_world; }
|
||||
const std::string& getGameName() const { return main_config_.game_name; }
|
||||
GameInstance* GetGameInstance() const { return game_; }
|
||||
};
|
||||
|
||||
@@ -8,6 +8,10 @@
|
||||
#include "CoreInstance.h"
|
||||
#include "Log/Log.h"
|
||||
|
||||
#include "Game/GameInstance.h"
|
||||
#include "Game/World/World.h"
|
||||
#include "Game/Actors/Mesh/Mesh.hpp"
|
||||
|
||||
#include "GLFW/glfw3.h"
|
||||
|
||||
const std::vector<const char*> RenderEngine::deviceExtensions = {
|
||||
@@ -986,6 +990,11 @@ RenderEngine::~RenderEngine()
|
||||
|
||||
void RenderEngine::start()
|
||||
{
|
||||
World* world = core_.GetGameInstance()->GetWorld();
|
||||
std::vector<Mesh*> meshes = world->GetActorsByClass<Mesh>();
|
||||
for (auto& i : meshes)
|
||||
i->load_model(i->GetModelName());
|
||||
|
||||
while (!glfwWindowShouldClose(window_))
|
||||
{
|
||||
glfwPollEvents();
|
||||
|
||||
Reference in New Issue
Block a user