20 lines
388 B
C++
20 lines
388 B
C++
|
#include "staticcam.h"
|
||
|
|
||
|
StaticCam::StaticCam(char *filename)
|
||
|
: Camera()
|
||
|
{
|
||
|
loaded = SDL_LoadBMP(filename);
|
||
|
init(loaded->w, loaded->h);
|
||
|
SDL_CreateRGBSurface(SDL_SWSURFACE, loaded->w, loaded->h, 8, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
||
|
}
|
||
|
|
||
|
StaticCam::~StaticCam( void )
|
||
|
{
|
||
|
SDL_FreeSurface(loaded);
|
||
|
}
|
||
|
|
||
|
void StaticCam::update( void )
|
||
|
{
|
||
|
SDL_BlitSurface(loaded, 0, pixels, 0);
|
||
|
}
|