1
0
mirror of https://github.com/blupi-games/planetblupi synced 2024-12-30 10:15:36 +01:00

Add icon to the window

This commit is contained in:
Mathieu Schroeter 2017-02-26 17:46:49 +01:00
parent f7e4c2c4df
commit 102ea6734c
3 changed files with 6 additions and 0 deletions

View File

@ -141,6 +141,7 @@ install (DIRECTORY resources/image DESTINATION share/planetblupi)
install (DIRECTORY resources/movie DESTINATION share/planetblupi)
install (DIRECTORY resources/sound DESTINATION share/planetblupi)
install (DIRECTORY resources/music DESTINATION share/planetblupi)
install (FILES resources/icon/planetblupi.png DESTINATION share/planetblupi)
#########
## Deploy

Binary file not shown.

After

Width:  |  Height:  |  Size: 585 B

View File

@ -1,6 +1,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <SDL2/SDL_image.h>
#include "blupi.h"
#include "def.h"
@ -443,6 +444,10 @@ static bool DoInit (Sint32 argc, char *argv[])
return false;
}
auto icon = IMG_Load ((GetBaseDir () + "planetblupi.png").c_str ());
SDL_SetWindowIcon (g_window, icon);
SDL_FreeSurface (icon);
g_renderer = SDL_CreateRenderer (g_window, -1, g_rendererType | SDL_RENDERER_TARGETTEXTURE);
if (!g_renderer)
{