First post, by emendelson
I'm trying to modify a Windows-only project based on DOSBox, and the code that I started with uses SDL_NOFRAME (in the SDL_SetVideoMode statement) so that it didn't create a titlebar, border, or icon at the upper-left corner.
I put back the titlebar and border by removing SDL_NOFRAME, but the window now displays a blank icon, despite the fact that I've got a known-good dosbox_log.h in the gui directory and this code near the top of sdlmain.cpp:
static unsigned char logo[32*32*4]= {
#include "dosbox_logo.h"
};
static void GFX_SetIcon() {
#if WORDS_BIGENDIAN
SDL_Surface* logos= SDL_CreateRGBSurfaceFrom((void*)logo,32,32,32,128,0xff000000,0x00ff0000,0x0000ff00,0);
#else
SDL_Surface* logos= SDL_CreateRGBSurfaceFrom((void*)logo,32,32,32,128,0x000000ff,0x0000ff00,0x00ff0000,0);
#endif
SDL_WM_SetIcon(logos,NULL);
}
What am I doing wrong that prevents the icon from appearing in the title bar?
The icon referenced in winres.rc correctly appears as the application icon in Explorer and the taskbar. I'd be happy if I could get it into the titlebar too.
Thanks for any help with this.
EDIT: In the source code of winres.rc I've tried both "#include windows.h" and "#include afxres.h" with no effect on the titlebar icon. I'm using Visual C++ 2010 Professional.