- program test;
- uses
- SysUtils,
- SDL,
- SDLUtils,
- SDL_Image;
- var
- screen: PSDL_Surface; // screen
- player: PSDL_Surface; // player
- car: PSDL_Surface; // enemie
- SourceSurface: PSDL_Surface; //sourcesurface
- done: Boolean = false;
- player_rect: TSDL_Rect; //player_rect
- car_rect: TSDL_Rect; //car_rect
- event: TSDL_Event;
- begin
- // Initalisierung
- if (SDL_Init(SDL_INIT_VIDEO) < 0 ) then
- begin
- Write('VIDEO ERROR!');
- end;
- //----------------------------------------//
- screen := SDL_SetVideoMode(640,480,32, SDL_FULLSCREEN);
- //----------------Surfaces Player---------------------//
- player := IMG_Load('media/player.png');
- car := IMG_Load('media/car.png');
- SourceSurface := SDL_DisplayFormat( player );
- player_rect.x := 10;
- player_rect.y := 40;
- player_rect.h := 100;
- player_rect.w := 100;
- car_rect.x := 400;
- car_rect.y := 300;
- //---------------------------------------------------//
- while SDL_PollEvent(@event)= 1 do
- begin
- case event.type_ of
- SDL_KeyDown:
- begin
- write('Taste gedrückt');
- end;
- end;
- end;
- SDL_BlitSurface(car, nil, screen, @car_rect);
- SDL_BlitSurface(player, nil, screen, @player_rect);
- end.