mirror of
https://github.com/AlexandreRouma/SDRPlusPlus.git
synced 2025-06-29 05:47:50 +02:00
Fixed loading screen
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
#include <gui/dialogs/credits.h>
|
||||
#include <imgui.h>
|
||||
#include <gui/icons.h>
|
||||
#include <gui/style.h>
|
||||
#include <config.h>
|
||||
|
||||
namespace credits {
|
||||
ImFont* bigFont;
|
||||
|
||||
void init() {
|
||||
// TODO: Have a font manager instead
|
||||
bigFont = ImGui::GetIO().Fonts->AddFontFromFileTTF(((std::string)(ROOT_DIR "/res/fonts/Roboto-Medium.ttf")).c_str(), 128.0f);
|
||||
|
||||
}
|
||||
|
||||
void show() {
|
||||
@ -16,7 +16,7 @@ namespace credits {
|
||||
ImGui::OpenPopup("Credits");
|
||||
ImGui::BeginPopupModal("Credits", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove);
|
||||
|
||||
ImGui::PushFont(bigFont);
|
||||
ImGui::PushFont(style::hugeFont);
|
||||
ImGui::Text("SDR++ ");
|
||||
ImGui::PopFont();
|
||||
ImGui::SameLine();
|
||||
|
91
core/src/gui/dialogs/loading_screen.cpp
Normal file
91
core/src/gui/dialogs/loading_screen.cpp
Normal file
@ -0,0 +1,91 @@
|
||||
#include <GL/glew.h>
|
||||
#include <gui/dialogs/loading_screen.h>
|
||||
#include <gui/main_window.h>
|
||||
#include <imgui.h>
|
||||
#include "imgui_impl_glfw.h"
|
||||
#include "imgui_impl_opengl3.h"
|
||||
#include <gui/icons.h>
|
||||
#include <gui/style.h>
|
||||
|
||||
namespace LoadingScreen {
|
||||
GLFWwindow* _win;
|
||||
|
||||
void setWindow(GLFWwindow* win) {
|
||||
_win = win;
|
||||
}
|
||||
|
||||
void show(std::string msg) {
|
||||
glfwPollEvents();
|
||||
ImGui_ImplOpenGL3_NewFrame();
|
||||
ImGui_ImplGlfw_NewFrame();
|
||||
|
||||
ImGui::NewFrame();
|
||||
ImGui::Begin("Main", NULL, WINDOW_FLAGS);
|
||||
|
||||
|
||||
ImGui::PushStyleVar(ImGuiStyleVar_WindowPadding, ImVec2(20.0f, 20.0f));
|
||||
ImGui::OpenPopup("Credits");
|
||||
ImGui::PushStyleColor(ImGuiCol_ModalWindowDarkening, ImVec4(0.0f, 0.0f, 0.0f, 0.0f));
|
||||
ImGui::BeginPopupModal("Credits", NULL, ImGuiWindowFlags_AlwaysAutoResize | ImGuiWindowFlags_NoTitleBar | ImGuiWindowFlags_NoMove | ImGuiWindowFlags_NoBackground);
|
||||
|
||||
ImGui::PushFont(style::hugeFont);
|
||||
ImGui::Text("SDR++ ");
|
||||
ImGui::PopFont();
|
||||
ImGui::SameLine();
|
||||
ImGui::Image(icons::LOGO, ImVec2(128, 128));
|
||||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
|
||||
ImGui::Text("This software is brought to you by\n\n");
|
||||
|
||||
ImGui::Columns(3, "CreditColumns", true);
|
||||
|
||||
// Contributors
|
||||
ImGui::Text("Contributors");
|
||||
ImGui::BulletText("Ryzerth (Creator)");
|
||||
ImGui::BulletText("aosync");
|
||||
ImGui::BulletText("Benjamin Kyd");
|
||||
ImGui::BulletText("Tobias Mädel");
|
||||
ImGui::BulletText("Raov");
|
||||
ImGui::BulletText("Howard0su");
|
||||
|
||||
// Libraries
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text("Libraries");
|
||||
ImGui::BulletText("SoapySDR (PothosWare)");
|
||||
ImGui::BulletText("Dear ImGui (ocornut)");
|
||||
ImGui::BulletText("spdlog (gabime)");
|
||||
ImGui::BulletText("json (nlohmann)");
|
||||
ImGui::BulletText("portaudio (PA Comm.)");
|
||||
|
||||
// Patrons
|
||||
ImGui::NextColumn();
|
||||
ImGui::Text("Patrons");
|
||||
ImGui::BulletText("SignalsEverywhere");
|
||||
ImGui::BulletText("Lee Donaghy");
|
||||
|
||||
ImGui::Columns(1, "CreditColumnsEnd", true);
|
||||
|
||||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
ImGui::Spacing();
|
||||
ImGui::Text(msg.c_str());
|
||||
|
||||
ImGui::EndPopup();
|
||||
ImGui::PopStyleVar(1);
|
||||
ImGui::PopStyleColor(1);
|
||||
|
||||
ImGui::End();
|
||||
|
||||
ImGui::Render();
|
||||
int display_w, display_h;
|
||||
glfwGetFramebufferSize(_win, &display_w, &display_h);
|
||||
glViewport(0, 0, display_w, display_h);
|
||||
glClearColor(0.0666f, 0.0666f, 0.0666f, 1.0f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
ImGui_ImplOpenGL3_RenderDrawData(ImGui::GetDrawData());
|
||||
|
||||
glfwSwapBuffers(_win);
|
||||
}
|
||||
}
|
10
core/src/gui/dialogs/loading_screen.h
Normal file
10
core/src/gui/dialogs/loading_screen.h
Normal file
@ -0,0 +1,10 @@
|
||||
#pragma once
|
||||
#include <thread>
|
||||
#include <string>
|
||||
#include <mutex>
|
||||
#include <GLFW/glfw3.h>
|
||||
|
||||
namespace LoadingScreen {
|
||||
void setWindow(GLFWwindow* win);
|
||||
void show(std::string msg);
|
||||
};
|
Reference in New Issue
Block a user