This commit is contained in:
2025-08-19 17:12:45 +06:00
parent 2f62ffd59c
commit 2cf37f4e0a
10 changed files with 255 additions and 141 deletions

View File

@@ -2226,18 +2226,23 @@ void Vulkan::gui_MainMenu() {
void Vulkan::gui_ConnectedToServer() {
if(Game.Session) {
if(!ImGui::Begin("MainMenu", nullptr, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
return;
std::string text = std::to_string(ImGui::GetIO().Framerate);
ImGui::Text(text.c_str());
ImGui::End();
if(ImGui::Begin("MainMenu", nullptr, ImGuiWindowFlags_NoBackground | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoResize | ImGuiWindowFlags_NoMove))
{
std::string text = std::to_string(ImGui::GetIO().Framerate);
ImGui::Text(text.c_str());
if(ImGui::Button("Выйти")) {
Game.RSession->pushStage(EnumRenderStage::Shutdown);
Game.Session->shutdown(EnumDisconnect::ByInterface);
Game.RSession = nullptr;
Game.Session = nullptr;
}
ImGui::End();
}
if(Game.Session->isConnected())
return;
Game.RSession->pushStage(EnumRenderStage::Shutdown);
Game.RSession = nullptr;
Game.Session = nullptr;
Game.ImGuiInterfaces.pop_back();

View File

@@ -1266,7 +1266,7 @@ void VulkanRenderSession::pushStage(EnumRenderStage stage) {
VKCTX->ThreadVertexObj.join();
}
std::vector<VoxelVertexPoint> VulkanRenderSession::generateMeshForVoxelChunks(const std::vector<VoxelCube> cubes) {
std::vector<VoxelVertexPoint> VulkanRenderSession::generateMeshForVoxelChunks(const std::vector<VoxelCube>& cubes) {
std::vector<VoxelVertexPoint> out;
out.reserve(cubes.size()*6);

View File

@@ -120,8 +120,7 @@ class VulkanRenderSession : public IRenderSession, public IVulkanDependent {
}
~ThreadVertexObj_t() {
State.lock()->Stage = EnumRenderStage::Shutdown;
Thread.join();
assert(!Thread.joinable());
if(CMDPool)
vkDestroyCommandPool(VkInst->Graphics.Device, CMDPool, nullptr);
@@ -355,7 +354,7 @@ public:
void drawWorld(GlobalTime gTime, float dTime, VkCommandBuffer drawCmd);
void pushStage(EnumRenderStage stage);
static std::vector<VoxelVertexPoint> generateMeshForVoxelChunks(const std::vector<VoxelCube> cubes);
static std::vector<VoxelVertexPoint> generateMeshForVoxelChunks(const std::vector<VoxelCube>& cubes);
static std::vector<NodeVertexStatic> generateMeshForNodeChunks(const Node* nodes);
private: