Logo thing!

This commit is contained in:
2025-12-15 01:14:52 +01:00
parent adaeaae53b
commit fd29b530c4

View File

@@ -1,6 +1,11 @@
#include "../../include/Window/Window.h" #include "../../include/Window/Window.h"
#include "../../include/ThirdParty/stb_image.h"
int width, height, channels;
GLFWwindow *Window::makeWindow() { GLFWwindow *Window::makeWindow() {
unsigned char *pixels = stbi_load("Resources/Engine-Root/Modu-Logo.png",
&width, &height, &channels, 4);
#if defined(__linux__) #if defined(__linux__)
setenv("XDG_SESSION_TYPE", "x11", 1); setenv("XDG_SESSION_TYPE", "x11", 1);
#endif #endif
@@ -14,7 +19,8 @@ GLFWwindow* Window::makeWindow() {
glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3); glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);
glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE); glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);
GLFWwindow* window = glfwCreateWindow(1000, 800, "Modularity", nullptr, nullptr); GLFWwindow *window =
glfwCreateWindow(1000, 800, "Modularity", nullptr, nullptr);
if (!window) { if (!window) {
std::cerr << "Failed to create GLFW window\n"; std::cerr << "Failed to create GLFW window\n";
glfwTerminate(); glfwTerminate();
@@ -30,5 +36,15 @@ GLFWwindow* Window::makeWindow() {
std::cout << "OpenGL: " << glGetString(GL_VERSION) << "\n"; std::cout << "OpenGL: " << glGetString(GL_VERSION) << "\n";
if (pixels) {
GLFWimage icon;
icon.width = width;
icon.height = height;
icon.pixels = pixels;
glfwSetWindowIcon(window, 1, &icon);
stbi_image_free(pixels);
}
return window; return window;
} }