Jump to content
  • Advertisement

Archived

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

hollowMedia

Resource vs Non-resource loading

This topic is 6119 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

If I am using MS Visual C++ 6.0, is loading things like cursors, icons, and bitmaps through a linked resource the best idea? With portability aside, is it faster to load through a resource? Thanks!

Share this post


Link to post
Share on other sites
Advertisement
Well thigns like cursors and icons are so small anyways... But it should be slightly faster since it gets compiled with your executable.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
Resource loading is faster.

Share this post


Link to post
Share on other sites
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

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!