- int DrawImage( SDL_Surface *surface, char *image_path, int x_pos, int y_pos )
- {
- SDL_Surface *image = IMG_Load ( image_path );
- if ( !image )
- {
- printf ( "IMG_Load: %s\n", IMG_GetError () );
- return 1;
- }
- // Draws the image on the screen:
- SDL_Rect rcDest = { x_pos, y_pos, 0, 0 };
- SDL_BlitSurface ( image, NULL, surface, &rcDest );
- SDL_FreeSurface ( image );
- return 0;
- }