Jump to content
  • Advertisement
Sign in to follow this  
RedKMan

Where to put the application resources

This topic is 4114 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

I'm designing a game engine and run into some confusion. My renderer which takes care of all the DX stuff is a DLL. My application which will use the engines DLL has all the window creation stuff. I need to add some resources to the window such as cursor, icon etc. My question is, where to put the resource header and .rc file. Does it go inside the DLL to keep it safe from the user using application. Or does it just go in the application project? I've run into some problems when putting the resources inside the DLL, IE. they cannot be found.

Share this post


Link to post
Share on other sites
Advertisement
Putting the resources in the DLL works, you just need to load them more explicitly. Look into the LoadResource function.

Share this post


Link to post
Share on other sites
You couldn't direct me to any working examples could you. I'm struggling eith the examples on MSDN. My DLL is loaded via a class in a static lib. I call the function which loads the DLL via a pointer to the class. The class in the static lib also contains the handle to the dll.

I've made an inline accessor function so I can access the dll handle from the application. The application has the window class. I am trying:-

wndclass.hIcon = LoadIcon( g_pRenderDLLManager->GrabRenderDLLHandle(), MAKEINTRESOURCE( IDI_MAIN_ICON ) );

The above fails to find the resource. If I use the LoadResource() function like below apparently I need the result of FindResourceEx() for the second parameter and thats were I get lost.

wndclass.hIcon = LoadResource( g_pRenderDLLManager->m_hRenderDLL, WHATGOESHERE )

How do most people creating engines do this, it seems to be a subject books (the ones I have) don't touch on. They seems happy using the windows standard icons and cursors.

Share this post


Link to post
Share on other sites
A lot of games will just put them in a folder called 'art' or 'objects' or some other familiar word to describe them.

The trick is to encrypt them or rename them, compress them, whatever, so the 'normal' game player doesn't mess up the game.

Is that what your asking? In a lot of installation packages you can setup the directory structure based on the location the program was installed.

So if the user installs the game on 'c:/mydocs' it will go through and add your folders under that location. Then in code you look for the resource in install_path//content//icons//pointer.ico

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • 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!