Sign in to follow this  
tiegudanxin

load pic from DLL

Recommended Posts

Hey guys I am programming a program with Direct3D I wanna load pices into my program and create texture from them,D3DXCreateTextureFromFile can do it.But it's necessarily that pic files are direct placed in the disc.but I wanna place pic file into a DLL now.How to load pic file into program from a DLL? Any help would be greatly appreciated.

Share this post


Link to post
Share on other sites
I wouldn't advise using a DLL, since it won't be much more "secure" than reading them from disk. I'd recommend using some sort of pack file.

If you do want to use DLLs though, you just shove all your textures into the DLL as resources in either RT_BITMAP or RT_RCDATA format (How you do that depends on your compiler / IDE), then use LoadLibrary() to load the DLL, then use D3DXCreateTextureFromResource instead of D3DXCreateTextureFromFile, passing the HMODULE obtained from LoadLibrary().

Share this post


Link to post
Share on other sites
Quote:
Original post by Evil Steve
I wouldn't advise using a DLL, since it won't be much more "secure" than reading them from disk. I'd recommend using some sort of pack file.


thanks for your help.
Can you help me on using pack file?

Share this post


Link to post
Share on other sites
Hey tiegudanxin,

This is the link for you.
For my Direct3D demos, I actually put the (zipped with zlib)resources in the executable itself, using the method described in the link above. If you have trouble getting it to work, let me know and I can paste some code here.
Cheers,
StratBoy61

Share this post


Link to post
Share on other sites
Quote:
Original post by StratBoy61
Hey tiegudanxin,

This is the link for you.
For my Direct3D demos, I actually put the (zipped with zlib)resources in the executable itself, using the method described in the link above. If you have trouble getting it to work, let me know and I can paste some code here.
Cheers,
StratBoy61


very good
That's a good idea.
thanks for your help!! much appreciated!

[Edited by - tiegudanxin on November 26, 2006 6:52:22 PM]

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