2 #include "SDLVideoOut.h"
7 SDLVideoOut::SDLVideoOut( int width
, int height
, int bpp
, Uint32 flags
)
9 this->screen
= SDL_SetVideoMode( width
, height
, bpp
, flags
);
11 assert(this->screen
); //Abort when no screen could be allocated.
15 Uint32
SDLVideoOut::MapRGBA( Uint8 r
, Uint8 g
, Uint8 b
, Uint8 a
)
17 return SDL_MapRGBA( screen
->format
, r
, g
, b
, a
);
20 Uint32
SDLVideoOut::MapRGB( Uint8 r
, Uint8 g
, Uint8 b
)
22 return SDL_MapRGB( screen
->format
, r
, g
, b
);
25 void SDLVideoOut::Clear( Uint32 color
)
27 SDL_FillRect( this->screen
, 0, color
);
30 void SDLVideoOut::Flip( )
32 SDL_Flip( this->screen
);
36 void SDLVideoOut::Blit( SDL_Surface
*src
, Sint16 x
, Sint16 y
)
44 SDL_BlitSurface( src
, 0, this->screen
, &dstRect
);
47 void SDLVideoOut::Blit( SDL_Surface
*src
, SDL_Rect
*srcRect
, Sint16 x
, Sint16 y
)
52 dstRect
.w
= srcRect
->w
;
53 dstRect
.h
= srcRect
->h
;
55 SDL_BlitSurface( src
, srcRect
, this->screen
, &dstRect
);
59 void SDLVideoOut::DrawString( const char *string
, Sint16 x
, Sint16 y
, Uint8 r
, Uint8 g
, Uint8 b
, Uint8 a
)
61 //stringColor( this->screen, x, y, string, color );
62 stringRGBA( this->screen
, x
, y
, string
, r
,g
,b
,a
);
66 int SDLVideoOut::GetWidth()
71 int SDLVideoOut::GetHeight()