Confirm window.setIcon on Windows

This commit is contained in:
Joshua Granick
2014-12-28 11:54:10 -08:00
parent 353e2d9000
commit a12a27582e
3 changed files with 19 additions and 8 deletions

View File

@@ -307,7 +307,7 @@ namespace lime {
SDL_Event event;
event.type = -1;
if (active && (firstTime || SDL_WaitEvent (&event))) {
firstTime = false;

View File

@@ -55,9 +55,14 @@ namespace lime {
void SDLWindow::SetIcon (ImageBuffer *imageBuffer) {
SDL_Surface *surface = SDL_CreateRGBSurfaceFrom (imageBuffer->data->Bytes (), imageBuffer->width, imageBuffer->height, imageBuffer->bpp, imageBuffer->width * imageBuffer->bpp, 0x0f00, 0x00f0, 0x000f, 0xf000);
SDL_SetWindowIcon (sdlWindow, surface);
SDL_FreeSurface (surface);
SDL_Surface *surface = SDL_CreateRGBSurfaceFrom (imageBuffer->data->Bytes (), imageBuffer->width, imageBuffer->height, imageBuffer->bpp * 8, imageBuffer->width * imageBuffer->bpp, 0x00FF0000, 0x0000FF00, 0x000000FF, 0xFF000000);
if (surface) {
SDL_SetWindowIcon (sdlWindow, surface);
SDL_FreeSurface (surface);
}
}