After some hours of debugging and source-code reading
I found this problem in SDL.
the problem was that with a surface created with
SDL_CreateRGBSurfaceFrom(…)
I couldnt use any blitting or filling operations on it.
nothing changed on the surface.
the thing was that clip_rect was { 0,0,0,0 }
causing everything to get clipped.
checking the source for SDL_CreateRGBSurfaceFrom…
— snip ----
SDL_Surface * SDL_CreateRGBSurfaceFrom (void *pixels,
int width, int height, int depth, int pitch,
Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
{
SDL_Surface *surface;
surface = SDL_CreateRGBSurface(SDL_SWSURFACE, 0, 0, depth,
Rmask, Gmask, Bmask, Amask);
if ( surface != NULL ) {
surface->flags |= SDL_PREALLOC;
surface->pixels = pixels;
surface->w = width;
surface->h = height;
surface->pitch = pitch;
}
return(surface);
}
— snip —
then I noticed that clip_rect is set up in the call to SDL_CreateRGBSurface,
and with width and height set to 0.
is this correct behavior? or should clip_rect be { 0,0,w,h }?
/Lomax of Probe.