#include <stdlib.h>
#include <SDL.h>


#include <ctype.h>
#include <iostream>
#include <map>

#include <stdio.h>

int main(int argc, char *argv[])
{
    SDL_Surface *screen, *image;
    SDL_Event event;
    bool done = false;
    if(SDL_Init(SDL_INIT_VIDEO) == -1)
    {
        printf("Can't init SDL:  %s\n", SDL_GetError());
        exit(1);
    }
    atexit(SDL_Quit); 
    screen = SDL_SetVideoMode(640, 480, 16,SDL_RESIZABLE);
    
    if(screen == NULL)
    {
        printf("Can't set video mode: %s\n", SDL_GetError());
        exit(1);
    }
    
    
    SDL_WM_SetCaption("SDL Test", "SDL Test");
    
    
    image = SDL_LoadBMP("hello.bmp");
    if(image == NULL)
    {
        printf("Can't load image of tux: %s\n", SDL_GetError());
        exit(1);
    }
    SDL_BlitSurface(image, NULL, screen, NULL);
    SDL_FreeSurface(image);
    SDL_UpdateRect(screen, 0, 0, 0, 0);
    while(!done)
    {
        while(SDL_PollEvent(&event))
        {
            switch(event.type)
            {
                case SDL_QUIT:
                done = true;
                break;
            }
        }
    }
    return 0;
}    


