27 lines
652 B
C++
27 lines
652 B
C++
#include "camera.h"
|
|
#include <SDL/SDL.h>
|
|
|
|
#define DEPTH 32
|
|
|
|
Camera::Camera(int width, int height)
|
|
{
|
|
//SDL_Surface *SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
|
|
pixels = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, DEPTH, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
|
}
|
|
|
|
Camera::Camera( void )
|
|
: pixels(0)
|
|
{
|
|
//does not initialize anything
|
|
}
|
|
|
|
void Camera::init(int width, int height)
|
|
{
|
|
pixels = SDL_CreateRGBSurface(SDL_SWSURFACE, width, height, DEPTH, 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000);
|
|
}
|
|
|
|
Camera::~Camera( void )
|
|
{
|
|
SDL_FreeSurface(pixels);
|
|
}
|