I have a executable written in c. Therein I directly set the applications icon in SDL. (Call to SDL_SetWindowIcon()). The pixel data is hardcoded in an array.
Is there any way to overwrite the icon specified in the .desktop file in linux? Or am I obliged to specify the icon in the desktop entry, since you normally don't hardcode icons?
This is more of a general question whether this is possible.
SDL_Surface *surf;
uint32_t pixels[64 * 64] = {0x01ffffff, 0x01ffffff, 0x01ffffff, ... , 0x01ffffff, 0x01ffffff};
surf = SDL_CreateRGBSurfaceFrom(pixels, 64, 64, 32, 64 * 4,
0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
SDL_SetWindowIcon(window, surf);
SDL_FreeSurface(surf);
User contributions licensed under CC BY-SA 3.0