- set the color key for the icon

This commit is contained in:
Mark Vejvoda
2012-01-06 23:04:59 +00:00
parent ce8698c1b4
commit 89f06a76be

View File

@@ -113,6 +113,7 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,
icon = SDL_LoadBMP(mg_icon_file.c_str());
}
else {
//printf("Loadng png icon\n");
Texture2D *texture2D = GraphicsInterface::getInstance().getFactory()->newTexture2D();
texture2D->load(mg_icon_file);
icon = texture2D->CreateSDLSurface(true);
@@ -139,6 +140,7 @@ void PlatformContextGl::init(int colorBits, int depthBits, int stencilBits,
//uint32 colorkey = SDL_MapRGB(icon->format, 255, 0, 255);
//SDL_SetColorKey(icon, SDL_SRCCOLORKEY, colorkey);
SDL_SetColorKey(icon, SDL_SRCCOLORKEY, SDL_MapRGB(icon->format, 255, 0, 255));
SDL_WM_SetIcon(icon, NULL);
}