Here is a very simplified version of main() without the clutter.. if you think you need to see the rest of the source code, just ask :)
using namespace std;
int main (int argc, char* argv)
BackgroundSprite = LoadImage("Resources//Background.png");
The function LoadImage is in Image_Utilities.h and is shown below..
SDL_Surface LoadImage( std::string S_FileName )
//The image that's loaded
SDL_Surface SS_LoadedImage = NULL;
//The optimized surface that will be used
SDL_Surface* SS_OptimizedImage = NULL;
//Load the image
SS_LoadedImage = IMG_Load( S_FileName.c_str() );
//If the image loaded
if( SS_LoadedImage != NULL )
//Create an optimized surface
SS_OptimizedImage = SDL_DisplayFormat( SS_LoadedImage );
//Free the old surface
SDL_FreeSurface( SS_LoadedImage );
//If the surface was optimized
if( SS_OptimizedImage != NULL )
//Color key surface
SDL_SetColorKey( SS_OptimizedImage, SDL_SRCCOLORKEY, SDL_MapRGB( SS_OptimizedImage->format, 0, 0xFF, 0xFF ) );
//Return the optimized surface
But when I compile, I get this error:
In function int SDL_main(int, char**)':
cannot convertconst char' to HINSTANCE__*' for argument1' to `void LoadImageA(HINSTANCE__, const CHAR, UINT, int, int, UINT)'
int SDL_main(int, char**)':
HINSTANCE__*' for argument
Something about LoadImageA? I dont have a LoadImageA... I played around with namespaces.. trying to get it to use my userdefined namespace but it threw up errors about not finding LoadImageA, any help will be much appeciated!
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.