Original Post
Hi all, I'm using SDL and SDL_gfx for primitives like fillRectangle etc. I have a problem, I want to draw a rectangle in a SDL_surface and after display the content of this surface in the screen (the main SDL_surface). I'm doing this:
SDL_Surface* test;
test = new SDL_Surface();
//test->h=300;
//test->w=300;
boxRGBA(test,22,33,44,100,144,2,3,122);
CSurface::OnDraw(Surf_Display,test,1,1);
with:
bool CSurface::OnDraw(SDL_Surface* Surf_Dest, SDL_Surface* Surf_Src, int X, int Y) {
if(Surf_Dest == NULL || Surf_Src == NULL) {
return false;
}
SDL_Rect DestR;
DestR.x = X;
DestR.y = Y;
SDL_BlitSurface(Surf_Src, NULL, Surf_Dest, &DestR);
return true;
}
I get that test has all the fields undefined and I have not got it why.. Thanks in advance!