In SDL: Allocate a custom-size SDL_Surface

Hello,

How could I create an SDL_Surface of tailored width and height? I assume it's CreateRGBSurface, but I'm not positive as I seemed to have trouble with it.

The purpose, is to allocate an SDL_Surface area, of which I would manipulate it's ->pixels array manually, but the width/height is not necessarily always the same/known at build-time.

Thanks!
closed account (Dy7SLyTq)
do you mean change the size of the surface? i use sdl_resize personally
I'm not sure what the problem is. SDL_CreateRGBSurface() takes as explicit arguments the width and height of the new surface.
http://wiki.libsdl.org/moin.fcg/SDL_CreateRGBSurface
The documentation even gives a couple of examples of using it.
Topic archived. No new replies allowed.