JustinDaniel's guess is likely incorrect. SDL_BlitSurface accepts NULL as the final parameter, and will act as if you had passed it a rectangle encompassing the whole destination surface.
What is likely happening is that the image is failing to load. SDL will help you determine why: use SDL_GetError() to get a human-readable description of the problem. Currently you have no error checking, handling or reporting. This is what your program should look like:
#include <iostream>
#include <cstdlib>
#include "SDL.h"
int main( int argc, char* args[] )
{
if(SDL_Init( SDL_INIT_EVERYTHING ) < 0)
{
std::cerr << "Failed to initialise SDL: " << SDL_GetError() << '\n';
return 1;
}
std::atexit(&SDL_Quit);
SDL_Surface *screen = SDL_SetVideoMode( 640, 480, 32, SDL_SWSURFACE );
if(!screen)
{
std::cerr << "Failed to set video mode: " << SDL_GetError() << '\n';
return 1;
}
const char *filename = "block.bmp";
SDL_Surface *hello = SDL_LoadBMP(filename);
if(!hello)
{
std::cerr << "Failed to load \'" << filename << "\': " << SDL_GetError() << '\n';
return 1;
}
if(SDL_BlitSurface(hello,NULL,screen,NULL) < 0)
{
std::cerr << "Failed to blit surface to screen: " << SDL_GetError() << '\n';
return 1;
}
if(SDL_Flip(screen) < 0)
{
std::cerr << "Failed to flip screen: " << SDL_GetError() << '\n';
return 1;
}
SDL_Delay(2000);
SDL_FreeSurface( hello );
return 0;
}
Note that almost every SDL call can return an error. You should check for and handle or report these errors. I've simply logged them to stderr here.
Running this program on my computer, which has no "block.bmp", gives the following error:
Failed to load 'block.bmp': Couldn't open block.bmp
[/quote]
Try running this program using your original image, and see what the output is.
My guess is that your image should not be in the Debug folder, but rather in the project root, which is where the "working" directory is typically set by an IDE. Running the executable directly from the file system is different, of course. To diagnose this kind of error, try to see if the file loads using an absolute path (C:\path\to\project\block.bmp). If the smaller image loads correctly, then the problem is that the working directory isn't where you expect it to be.