path of loading bitmaps in DX

This is a discussion on path of loading bitmaps in DX within the Game Programming forums, part of the General Programming Boards category; hello: Assmue that there is one bitmap named "player.bmp", if it is inside the folder pic1,so we load like this ...

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    173

    path of loading bitmaps in DX

    hello:

    Assmue that there is one bitmap named "player.bmp", if it is inside the folder pic1,so we load like this way:

    "pic1/player.bmp"
    and no problem for that.

    but if the pic1 folder is inside another fold let's say pic2, so I loaded like this way:

    "pic1/pic2/player.bmp"

    but it didn't work for me, what is the problem??

    Thank you
    Don't laugh at me,I am just a SuperNewbie.

  2. #2
    Registered User
    Join Date
    Dec 2001
    Posts
    421
    [i]"pic1/pic2/player.bmp"/[i]

    the paths are the wrong way round. if pic1 is in pic2 then it should be

    pic2/pic1/player.bmp

    U.
    Quidquid latine dictum sit, altum sonatur.
    Whatever is said in Latin sounds profound.

  3. #3
    Registered User
    Join Date
    Apr 2002
    Posts
    142
    yep and you should also append a '.'

    ie.

    "./pic2/pic1/player.bmp" or was it,
    "../pic2/pic1/player.bmp" ,

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    173
    thank you,guys, but if I have mutiple bitmaps like "player0.bmp", "player1.bmp", "player2.bmp" for the animation.and they are in the player folder which is inside pic folder.
    and the lpddsPlayer to load the bitmap.

    so I load like this:

    char buffer[10]; //which contains the file name
    for(int frame=0; frame<3;frame++)
    {
    sprintf(buffer,"../pic/player/player%d.BMP",frame);
    DDReLoadBitmap(lpddsPlayer,buffer);
    }

    then this wouldn't work. why???


    BTW, if I have only 1 bitmap, then either "../pic/player/player.bmp "or "pic/player/player.bmp"
    works fine,but cause the problem with loading mutiple bitmaps.

    Thanx again!!!!
    Don't laugh at me,I am just a SuperNewbie.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. added start menu crashes game
    By avgprogamerjoe in forum Game Programming
    Replies: 6
    Last Post: 08-29-2007, 02:30 PM
  2. Problem Loading Bitmaps in Allegro
    By LiNeAr in forum Game Programming
    Replies: 1
    Last Post: 08-15-2005, 05:12 PM
  3. Loading bitmaps with createfile() +CreateDIBSection
    By Stevo in forum Windows Programming
    Replies: 7
    Last Post: 05-13-2004, 10:22 PM
  4. Loading Bitmaps
    By Neandrake in forum Windows Programming
    Replies: 4
    Last Post: 12-17-2001, 01:50 AM
  5. My graphics library
    By stupid_mutt in forum C Programming
    Replies: 3
    Last Post: 11-26-2001, 06:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21