Jump to content
  • Advertisement

Archived

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

TheBartman

Simple C++ directory navigation question...

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

Hello everyone, I have been working on a C++ project for some time now, and I have run across this problem that should be simple, but has me stumped. The problem is, I want to store the data for my program in a seperate directory than the programs executable. In this case, the /data subdirectory. But no matter what, I can''t get the code to navigate to that directory. I had originally thought it would be ./data/textures/filename.bmp, but that did not work. If you can help me out, I would be grateful. Also, if you need more information from me I can provide more information about the problem. Thankyou, Michael Bartman Dark Omen Studios

Share this post


Link to post
Share on other sites
Advertisement
Try leaving off the ''./'' at the beginning of the path. Changing the path to "data/textures/filename.bmp" should do the trick for you.

Share this post


Link to post
Share on other sites
*edit*Turns out it didn't like the bitmap file for some reason and I was right the very first time I tried it, the way sysOp said Thank you

Nope That didn't work. I will show you how I am loading the file :

...
lpddsOffscreen = bitmap_surface("Data\\textures\\grass.bmp");
...
LPDIRECTDRAWSURFACE7 bitmap_surface(LPCSTR filename)
{
...
hBitmap = (HBITMAP)LoadImage(NULL, filename, IMAGE_BITMAP, 0, 0,
LR_DEFAULTSIZE | LR_LOADFROMFILE);
...
}

Thankyou,
Michael Bartman
Dark Omen Studios

edit: By the way, that is a little bit of Win32 GDI and DirectDraw7 mixed up

[edited by - TheBartman on October 21, 2002 10:26:09 PM]

[edited by - TheBartman on October 21, 2002 10:49:33 PM]

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!