All pastes #902829 Raw Edit

tonkkis

public cpp v1 · immutable
·published 2008-02-13 19:53 UTC
rendered paste body
#include<iostream>#include<SDL/SDL.h>class Sprite{	private:		SDL_Surface *sprit;		int width;		int height;	public:		void Create(int,int,SDL_Surface*,Uint32);};void Sprite::Create(int width, int height,SDL_Surface* parent,Uint32 color){	sprit = SDL_CreateRGBSurface(SDL_SWSURFACE,width,height, 32,		parent->format->Rmask,		parent->format->Gmask,		parent->format->Bmask,		parent->format->Amask);	SDL_FillRect(sprit,NULL,color);	SDL_BlitSurface(sprit,NULL,parent,NULL);}int main(int *argc, char *argv[]){	Sprite pallo;	SDL_Surface *naytto;	naytto = SDL_SetVideoMode(800,600,32,SDL_HWSURFACE);	pallo.Create(10,10,naytto,0xff0000);	SDL_Flip(naytto);	SDL_Delay(1000);	SDL_Quit();	return 0;}