mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-04 11:35:06 +03:00
51 lines
1.3 KiB
C++
51 lines
1.3 KiB
C++
#include "LoadingSplash.h"
|
|
|
|
#include "../Misc/InterfaceFonts.h"
|
|
|
|
#include <Nuake/Core/Maths.h>
|
|
#include "Nuake/Window.h"
|
|
|
|
|
|
#include <imgui/imgui.h>
|
|
|
|
#include <Nuake/Rendering/Textures/TextureManager.h>
|
|
#include <Nuake/Rendering/Vulkan/VulkanImage/VulkanImage.h>
|
|
|
|
using namespace Nuake;
|
|
|
|
LoadingSplash::LoadingSplash()
|
|
{
|
|
_NuakeLogo = Nuake::TextureManager::Get()->GetTexture2(NUAKE_LOGO_PATH);
|
|
|
|
Nuake::Window::Get()->SetDecorated(false);
|
|
Nuake::Window::Get()->SetSize({ 640, 480 });
|
|
Nuake::Window::Get()->Center();
|
|
}
|
|
|
|
void LoadingSplash::Draw()
|
|
{
|
|
|
|
// Make viewport fullscreen
|
|
ImGuiViewport* viewport = ImGui::GetMainViewport();
|
|
ImGui::SetNextWindowPos(viewport->Pos);
|
|
ImGui::SetNextWindowSize(viewport->Size);
|
|
ImGui::SetNextWindowViewport(viewport->ID);
|
|
|
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowRounding, 0.0f);
|
|
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(32.0f, 32.0f));
|
|
ImGui::Begin("Welcome Screen", 0, ImGuiWindowFlags_NoDecoration | ImGuiWindowFlags_NoResize);
|
|
{
|
|
// Draw Nuake logo
|
|
{
|
|
const Vector2 logoSize = _NuakeLogo->GetSize();
|
|
const ImVec2 imguiSize = ImVec2(logoSize.x, logoSize.y);
|
|
ImGui::Image((ImTextureID)_NuakeLogo->GetImGuiDescriptorSet(), imguiSize);
|
|
}
|
|
|
|
ImGui::Text("LOADING SCENE...");
|
|
}
|
|
|
|
ImGui::End();
|
|
ImGui::PopStyleVar();
|
|
ImGui::PopStyleVar();
|
|
} |