Добавил shared_from_this как основной способ создать умный указатель на "себя". Добавил пример работы с ним

This commit is contained in:
Jiga228
2026-06-28 15:44:58 +07:00
parent 311772cca4
commit ad881a97a9
13 changed files with 77 additions and 47 deletions
@@ -1,8 +1,6 @@
#include "UwURenderEngine.hpp"
#include <array>
#include <stdexcept>
#include <fstream>
#include <chrono>
#include <glm/gtc/matrix_transform.hpp>
@@ -15,7 +13,6 @@
#include "Game/World/World.hpp"
#include "../Game/Actors/Mesh/Mesh.hpp"
#include "DeviceFunctions/DeviceFunctions.hpp"
#include "Log/Log.hpp"
RENDER_ENGINE_FACTORY_GENERATE(UwURenderEngine)
@@ -407,7 +404,7 @@ UwURenderEngine::~UwURenderEngine()
void UwURenderEngine::start()
{
World* world = core_.GetGameInstance()->GetWorld();
std::shared_ptr<World> world = core_.GetGameInstance()->GetWorld();
std::vector<std::weak_ptr<Mesh>> meshes = world->GetActorsByClass<Mesh>();
for (auto& i : meshes)
{
@@ -4,11 +4,10 @@
#include "ModelManager.hpp"
#include <vector>
#include <string>
#include <memory>
#include <mutex>
#define GLM_FORCE_RADIANS
#include <mutex>
#include <glm/glm.hpp>
#include "VkObjects/DescriptorSetLayout.hpp"