Jump to content
  • Advertisement
Sign in to follow this  
eflatmajor

Loading textures without a stand alone file.

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

Im trying to find a way to load textures into a Directx program that doesnt require me to have png or bmp etc, files sitting in the program folder where they can be easily accessed or modified by anyone i give the application to with mspaint. How can I do this?

Share this post


Link to post
Share on other sites
Advertisement
The easiest way would be to embed your images as resources in your exe. The images are simply appended to the file. I don't remember the actual steps involved, but this should get you started. The downside is that your exe can grow very large.

Another option is to put all your assets in a zip file, rename it to something else, and read from that. Crude, not very safe, but it is easy to do. This is what Id Software does with the their engines: pk3 is basicly just a zip file without compression.

Share this post


Link to post
Share on other sites
For some reason when i go to add resource from the project folder resource is greyed out and i cant click it and if i try to add a new item there is no Resource File (.rc) file to choose

Share this post


Link to post
Share on other sites
If you're using an Express version of Visual Studio, the resource editor is not included, if I remember correctly. You can buy the full version (a good investment) or google for a stand alone resource compiler.

Share this post


Link to post
Share on other sites
Ok thank you ive figured out how to use resources now, I dont like the idea of my application being too large so i might look into the crude zip file method some time.

If anyone has any more ideas i'd be happy to hear them

Share this post


Link to post
Share on other sites
Sure, try reading this gamedev.net article. It's really straight forward, and if you'd rather not use the .zip format which anyone can easily access, it's a good alternative. But beware, if you need file compression, you'll have to do it yourself (RLE is a basic compression method and easy to implement once you understand how it works).

http://www.gamedev.net/reference/programming/features/pak/

Hope it helps.

Shogun.

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!