hi,
I have lots of prob with the fonction SDL_CreateRGBSurface
there , my code
#include
#include <SDL/SDL.h>
#include <SDL/SDL_image.h>
using namespace std;
const int WI = 800;
const int HI = 600;
unsigned rmask = 0x000000ff;
unsigned gmask = 0x0000ff00;
unsigned bmask = 0x00ff0000;
unsigned amask = 0xff000000;
SDL_Surface* Ecran;
SDL_Surface* Play;
main()
{
SDL_Init(SDL_INIT_VIDEO|SDL_INIT_AUDIO);
Ecran = SDL_SetVideoMode(WI,HI,0,
SDL_ANYFORMAT|SDL_DOUBLEBUF);
if (Ecran == NULL) {cout << SDL_GetError() << endl;
exit(0);}
int BPP = Ecran->format->BitsPerPixel;
SDL_Surface * Background = IMG_Load("./img/background.jpg");
Background = SDL_DisplayFormat(Background);
Play = SDL_CreateRGBSurface(SDL_HWSURFACE,WI/2
-80,100,BPP,rmask,gmask,bmask, amask);
SDL_BlitSurface(Play,0,Ecran,0);
SDL_Flip(Ecran);
sleep(2);
}
I just wanna create some simple white rect but nothing 's happen
(I just have a black screen)
thanks
a+++
PS :: kostas, in fact I had putted a Flip but he stay in my copy
paste mouse