Add classes Mesh and StaticMesh

This commit is contained in:
Jiga228
2025-10-10 19:39:30 +07:00
parent 2b2ed1f050
commit fedffa7634
14 changed files with 118 additions and 20 deletions
+1 -1
View File
@@ -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_; }
};
+9
View File
@@ -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();