I just started exploring SDl and I was wondering if anybody has an idea how to load a bitmap onto an SDL_Surface from a resource?
I just started exploring SDl and I was wondering if anybody has an idea how to load a bitmap onto an SDL_Surface from a resource?
Hi Paulis,Originally Posted by Paulius
You will need to Load the Resource into a stream ( check this article to find out how http://community.borland.com/article...,16081,00.html ) and then use JEDI-SDL's LoadSDLBMPFromStream function which exists in SDLStreams.pas and returns a PSDL_Surface.
Remember to free your PSDL_Surface when you finish with them, to avoid memory leaks.
Thanks for your help, but I wanted to put a bitmap into an executable to avoid space waste, because it's only 3k. I want to make the whole application under 32k so I'll have to pass on VCL units. I have seen people loading a bitmap from resource with LoadImage windows API call and bliting it onto DirectDraw surface (I think SDL uses DirectDraw in windows?) so there should be a way to do this without streams.
Bookmarks