add icon for window

This commit is contained in:
Rubbit 2024-04-27 12:53:05 +08:00
parent 1b2cc2d1c1
commit 3b6eb8b5f0
2 changed files with 7 additions and 2 deletions

BIN
res/icon.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -36,6 +36,7 @@ void scroll_callback(GLFWwindow *window, double xoffset, double yoffset);
void focus_callback(GLFWwindow *window, int focused);
void processInput(GLFWwindow *window);
void glfwDump(GLFWwindow *window);
bool running = true;
bool pausing = false;
@ -70,8 +71,7 @@ int curr_y;
int monitor_count;
// GLFWmonitor **monitors;
// fps control
// int fps = 120;
GLFWimage icon;
int main()
{
@ -121,6 +121,9 @@ int main()
return -1;
}
icon.pixels = stbi_load("./icon.png", &icon.width, &icon.height, 0, STBI_rgb_alpha);
glfwSetWindowIcon(window, 1, &icon);
// configure global opengl state
// -----------------------------
// glEnable(GL_DEPTH_TEST);
@ -193,6 +196,8 @@ int main()
glEnable(GL_DEPTH_TEST);
glDepthFunc(GL_LESS);
glfwDump(window);
// glfwSetCursorPos(window, curr_x + curr_width / 2, curr_y + curr_height / 2);
// render loop
// -----------