Archived

This topic is now archived and is closed to further replies.

hollowMedia

Resource vs Non-resource loading

Recommended Posts

Guest Anonymous Poster
I have a related question.
Is it possible to compile your resources (i.e. bitmaps) into a separate file from the EXE? For example, could I make graphics.dll which is just the resources, and link to it at run-time to get my game graphics?

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Yes, a resource dll is possible, but it sounds messy. Why not use a wad file or something similar instead?

Share this post


Link to post
Share on other sites
quote:
Original post by Anonymous Poster
Yes, a resource dll is possible, but it sounds messy. Why not use a wad file or something similar instead?


Yep. You could also add a simple compression scheme (like LZ77) and save diskspace by the way. This also protects your resources from users messing around with them...


Edited by - darookie on December 19, 2001 12:40:48 PM

Share this post


Link to post
Share on other sites
Making a resource .dll is easy, not messy. Just create a new project (.dll), and add a resource script to it with all of your resources. Compile and voila! Resource .dll.

You might have to have an empty DllMain() if the compiler complains that there is no entry point.

Then in your code, you load the .dll using LoadLibrary(), and then use the HMODULE returned in your calls to the resource functions (in place of the hInstance for your app).

For windows resources (like cursors, etc) I would use resources. That what resources are designed for. For game assets (graphics, sounds, levels, etc), use the .wad/.pak/.zip file concept. Windows resources aren''t really designed for general purpose storage.


-Brannon

Share this post


Link to post
Share on other sites