Added icon to non-windows build

This commit is contained in:
rxi 2020-05-06 19:49:34 +01:00
parent 201c8ffe9f
commit e551052e91
2 changed files with 1386 additions and 0 deletions

1369
icon.inl Normal file

File diff suppressed because it is too large Load diff

View file

@ -53,6 +53,22 @@ static void get_exe_dir(char *buf, int sz) {
} }
static void init_window_icon(void) {
#ifndef _WIN32
#include "../icon.inl"
(void) icon_rgba_len; /* unused */
SDL_Surface *surf = SDL_CreateRGBSurfaceFrom(
icon_rgba, 64, 64,
32, 64 * 4,
0x000000ff,
0x0000ff00,
0x00ff0000,
0xff000000);
SDL_SetWindowIcon(window, surf);
SDL_FreeSurface(surf);
#endif
}
int main(int argc, char **argv) { int main(int argc, char **argv) {
#ifdef _WIN32 #ifdef _WIN32
@ -75,6 +91,7 @@ int main(int argc, char **argv) {
window = SDL_CreateWindow( window = SDL_CreateWindow(
"", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED, "", SDL_WINDOWPOS_UNDEFINED, SDL_WINDOWPOS_UNDEFINED,
dm.w * 0.8, dm.h * 0.8, SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI); dm.w * 0.8, dm.h * 0.8, SDL_WINDOW_RESIZABLE | SDL_WINDOW_ALLOW_HIGHDPI);
init_window_icon();
ren_init(window); ren_init(window);