This repository has been archived on 2024-07-04. You can view files and clone it, but cannot push or open issues or pull requests.
2007-02-23 18:10:32 +01:00
|
|
|
#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);
|
|
|
|
}
|
|
|
|
|
2007-03-14 18:02:22 +01:00
|
|
|
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);
|
|
|
|
}
|
|
|
|
|
2007-02-23 18:10:32 +01:00
|
|
|
Camera::~Camera( void )
|
|
|
|
{
|
|
|
|
SDL_FreeSurface(pixels);
|
|
|
|
}
|