Code: Select all
#include <sdl.h>
#include <iostream>
#include <string>
SDL_Surface *screen = NULL;
SDL_Surface *background = NULL;
bool running = true;
void apply_surface(int x, int y, SDL_Surface* source, SDL_Surface* destination)
{
SDL_Rect rect;
rect.y;
rect.x;
SDL_BlitSurface(source,NULL,destination,&rect);
}
int main(int argc, char* argv[])
{
SDL_Init(SDL_INIT_VIDEO);
screen = SDL_SetVideoMode(800,800,32,SDL_SWSURFACE);
SDL_WM_SetCaption("Blood Duel",NULL);
background = SDL_LoadBMP("background");
while (running == true)
{
SDL_Event event;
if(SDL_PollEvent(&event))
{
if (event.type == SDL_QUIT)
{
running = false;
}// end the quit if statement
}// End poll event
apply_surface(0,0,background,screen);
SDL_Flip(screen);
}//end running Loop
SDL_Quit();
return 0;
}//end main