Added icon to non-windows build
This commit is contained in:
parent
201c8ffe9f
commit
e551052e91
17
src/main.c
17
src/main.c
|
@ -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);
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue