• Advertisement

Archived

This topic is now archived and is closed to further replies.

Storing stuff in the EXE or externally? HELP!

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

Share this post


Link to post
Share on other sites
Advertisement
OK if I include my .bmp''s in my resource script (MSVC++6), how do I load them onto DDSURFACE7''s?

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
I am using ddutil.cpp and ddutil.h. It won''t load up the resource using that code though.

Share this post


Link to post
Share on other sites
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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

  • Advertisement