Advertisement

Storing stuff in the EXE or externally? HELP!

Started by March 16, 2000 01:31 PM
7 comments, last by BeanDog 24 years, 9 months ago
I am creating a simple DX C++ game. I have the sounds loaded in as resources - this means they compile in with the EXE, right? Also, is there a way to do this easily with picture files? Or would it be simple (probably) to concatenate the files one onto the end of the last, and then read them in that way? Any good tutorials out there? Thanks -Ben Dilts
I think you should take a look at Resource Files Explained
Advertisement
OK if I include my .bmp''s in my resource script (MSVC++6), how do I load them onto DDSURFACE7''s?
You can import a custom resource.
This is added as binairy data.
For my latest applications I imported uncompressed TGA images. A bit large, but very easy to use!

Good luck,
Bas.
MAN!

Ok, I have a bitmap loaded in as "IDB_MapBack" into my Resources.rc file. I tried this line of code using MS''s example DX stuff:

MapPic = DDLoadBitmap(DDraw, "IDB_MapBack", 0,0);

ANYBODY HELP ME PLEASE?

-Frustrated

Ben Dilts
See the ddutil.cpp and ddutil.h files that come with the DirectX SDK -- use the Windows Find Files or Folders dialog to search for them. They''ve got functions for doing just that, or you can use them as a base to make your own.

Good Luck!


- null_pointer

Advertisement
I am using ddutil.cpp and ddutil.h. It won''t load up the resource using that code though.
You can load the bitmap from the resource with LoadBitmap(HINSTANCE, LPCTSTR). Take a look at the description in the MSDN library.

Then you should be able to use D3DXLoadTextureFromMemory() to convert the bitmap to a DDraw surface. I''m a bit rusty on getting the bitmap data from a HBITMAP handle (Haven''t had time to do any real programming for four month ) but I''m sure you can manage
my suggestion: keep graphics [files] and sounds [files] as external files, and load them in before the game starts. this will lower compilation times and make the EXE much smaller. also, a person can edit sounds and graphics, and the program will automatically adjust without compilation needed. there are many great books on programming if you don''t know exactly how to load graphics and sounds from files, and sounds are extrememly complex.

This topic is closed to new replies.

Advertisement