Post your questions, suggestions and experiences regarding game design, integration of external libraries here. For irrEdit, irrXML and irrKlang, see the
ambiera forums
JPulham
Posts: 320 Joined: Sat Nov 19, 2005 12:06 pm
Post
by JPulham » Fri Sep 28, 2007 11:50 am
If i have a file (image, sound, font) how can I link it into the executable or a module, and how can I load a pointer to the data afterwards?
EDIT: I'm trying to use platform independent C code rather than Win32 etc.
pushpork
hybrid
Admin
Posts: 14143 Joined: Wed Apr 19, 2006 9:20 pm
Location: Oldenburg(Oldb), Germany
Contact:
Post
by hybrid » Fri Sep 28, 2007 12:34 pm
Convert it to hex values, make a static byte array in C code and initalize it with those values (u8 data = {data...}) and create a memory read file from that.
FlyingIsFun1217
Posts: 219 Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:
Post
by FlyingIsFun1217 » Fri Sep 28, 2007 8:35 pm
For Hybrid: You can't put it's binary data into a container?
FlyingIsFun1217
sio2
Competition winner
Posts: 1003 Joined: Thu Sep 21, 2006 5:33 pm
Location: UK
Post
by sio2 » Fri Sep 28, 2007 10:05 pm
bin2h
JPulham
Posts: 320 Joined: Sat Nov 19, 2005 12:06 pm
Post
by JPulham » Sat Sep 29, 2007 12:09 pm
cheers
I thought I heard of a way using the linker... but thinking about it I think it was using Win32 resource files
pushpork