SDL problem
SDL_BlitSurface
No problem.
No problem.
Code:
SDL_Surface *obrazek;
obrazek = IMG_Load("obrazek.jpg");
if(obrazek = NULL)
{
return 1;
}
obrazek = SDL_DisplayFormat(ekran);
SDL_FreeSurface(ekran);
SDL_Rect dest;
dest.x = 150;
dest.y = 200;
dest.w = obrazek->w;
dest.h = obrazek->h;
SDL_SetAlpha( obrazek, SDL_SRCALPHA, 255); // ustawiamy przeźroczystość
SDL_BlitSurface( obrazek, NULL, ekran, &dest); // FUNKCJA ODPOWIEDZIALANA ZA WSTAWIENIE OBRAZKA NA EKRANIE
SDL_Flip(ekran);this code responds for loading an image, but this image doesn't show up on the screen
Well, there are three glaring bugs which may be why your image is not be showing up on the screen:
That might be your problem.
Or that.
Or that.
N.b. also, depending on the version of SDL you are using, your call to SDL_SetAlpha() could be setting the surface alpha to transparent.
Code:
if(obrazek [b]=[/b] NULL)
{
return 1;
}That might be your problem.
Code:
obrazek = SDL_DisplayFormat([b]ekran[/b]);Code:
[b]SDL_FreeSurface(ekran);[/b]
[...]
[b]SDL_Flip(ekran);[/b]Or that.
N.b. also, depending on the version of SDL you are using, your call to SDL_SetAlpha() could be setting the surface alpha to transparent.
Mark Bishop

