Skip to content

Commit

Permalink
added application icon
Browse files Browse the repository at this point in the history
  • Loading branch information
B-Bischoff committed May 2, 2023
1 parent b138e36 commit 7931ebc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
Binary file added icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions inc/include.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,7 @@
#include <GLFW/glfw3.h>

// GLM
//#include "glm/glm.hpp"
#include "../external/glm-0.9.9.8/glm/glm.hpp"
//#include "glm/gtc/matrix_transform.hpp"
#include "../external/glm-0.9.9.8/glm/gtc/matrix_transform.hpp"

#include "../src/vendor/imgui/imgui.h"
Expand All @@ -16,6 +14,8 @@
#include "../src/vendor/imgui/imfilebrowser.h"
#include "../src/vendor/imgui/imgui_color_gradient.h"

#include "../src/vendor/stb/stb_image.h"

#include "../external/kissfft/kiss_fftr.h"
#include "../external/kissfft/kiss_fft.h"

Expand Down
13 changes: 12 additions & 1 deletion src/Application.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Application::Application(const int& width, const int& height)

GLFWmonitor* monitor = glfwGetPrimaryMonitor();
const GLFWvidmode* mode = glfwGetVideoMode(monitor);

glfwWindowHint(GLFW_RED_BITS, mode->redBits);
glfwWindowHint(GLFW_GREEN_BITS, mode->greenBits);
glfwWindowHint(GLFW_BLUE_BITS, mode->blueBits);
Expand All @@ -49,6 +49,17 @@ Application::Application(const int& width, const int& height)
exit(1);
}

// Application icon
GLFWimage icons[1];
icons[0].pixels = stbi_load("./icon.png", &icons[0].width, &icons[0].height, 0, 4);
if (icons[0].pixels == NULL)
std::cout << "Failed to load icon" << std::endl;
else
{
glfwSetWindowIcon(_window, 1, icons);
stbi_image_free(icons[0].pixels);
}

loop();
}

Expand Down

0 comments on commit 7931ebc

Please sign in to comment.