Sign in to follow this  
RedKMan

Where to put the application resources

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

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this