Thread: SDL_LoadBMP file path...

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    55

    SDL_LoadBMP file path...

    I have an application that as soon as it starts, opens a Windows Open File dialog letting the user browse for a video to open. When a video is selected, it starts playing. I want to do a setIcon on the video window. To do that, I'm using SDL_WM_SetIcon. I have to create an SDL_Surface from a bmp on disk, so I use SDL_LoadBMP...

    Now, I have to tell the path of the icon... I could give the full path, but that would mean it would only work on my PC. My idea was not to give any path, just the name of the image... But, the "default path" it seems to be using is the one where the video file is, no the one where the application executed... What can I do?

  2. #2
    Dr Dipshi++ mike_g's Avatar
    Join Date
    Oct 2006
    Location
    On me hyperplane
    Posts
    1,218
    I'm not sure here, but would just using the filename not use relative addressing? Something like:
    Code:
    message = load_image( "hello_world.bmp" );
    [edit] If its using the path from the video it seems you would have to navigate from there. So say your icon was in a directory called icons. the path would be "icons\hello_world.bmp", and you use full stops to go to the parent directory like: ".\hello_world.bmp". I think thats right.[/edit]
    Last edited by mike_g; 04-25-2007 at 01:07 PM.

  3. #3
    Registered User
    Join Date
    Apr 2007
    Posts
    55
    The problem is that the video may be anywhere... It may even be on a CD, to give you an example. The user has it wherever he wants...

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. opening empty file causes access violation
    By trevordunstan in forum C Programming
    Replies: 10
    Last Post: 10-21-2008, 11:19 PM
  2. Formatting a text file...
    By dagorsul in forum C Programming
    Replies: 12
    Last Post: 05-02-2008, 03:53 AM
  3. Formatting the contents of a text file
    By dagorsul in forum C++ Programming
    Replies: 2
    Last Post: 04-29-2008, 12:36 PM
  4. Can we have vector of vector?
    By ketu1 in forum C++ Programming
    Replies: 24
    Last Post: 01-03-2008, 05:02 AM
  5. System
    By drdroid in forum C++ Programming
    Replies: 3
    Last Post: 06-28-2002, 10:12 PM