sdl 2 - How create Surface from memory? [SDL] -
i found interesting function https://wiki.libsdl.org/sdl_rwfrommem
how can using it? need simple program. read image disc, creating in memory surface, , storing in file. next can read file , create texture.
if use sdl_image, function img_load() returns sdl_surface * ready use.
edit: if want read memory instead reading file, use sdl_creatergbsurfacefrom().
then, use sdl_createtexturefromsurface() bind surface texture.
Comments
Post a Comment