[SDL] Trying to display a colored surface

Kylotan kylotan at kylotan.eidosnet.co.uk
Tue Jul 16 06:41:05 PDT 2002

citrouille at wanadoo.fr wrote:

> d.x = 150; file://position where I want to blit the 'test' square into
> the screen
> d.y = 150;
> SDL_BlitSurface(test,NULL,screen,&d); file://blits test into screen
> Conclusion = why still a black screen with no white square ?

Because you're not supplying a full destination rectangle? I think
someone already pointed this out. I don't think you can just set d.x and
d.y for the position. You also need to set d.w and d.h to make a full

(You should probably also check the return values of
SDL_CreateRGBSurface and SDL_SetVideoMode, although I doubt they're the
problem here.)


More information about the SDL mailing list