*
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user