namco
Member
I want to be able to use 1 set of paths to a folder with the images to load into SDL surfaces via the load bitmap function, however, when I use:
CODE
SDL_Surface *test_expensesList = SDL_LoadBMP("graphics/expenseslist.bmp");
SDL segfaults as I'm not specifying:
CODE
SDL_Surface *test_expensesList = SDL_LoadBMP("/mnt/sd/retest/graphics/expensesList.bmp");
I know I could just do:
CODE
#ifndef WIN32
SDL_Surface *test_expensesList = SDL_LoadBMP("graphics/expenseslist.bmp");
// rest of win32 style code
#endif
#ifndef GP2X
SDL_Surface *test_expensesList = SDL_LoadBMP("/mnt/sd/retest/graphics/expensesList.bmp");
// rest of gp2x style code
#endif
and this would not compile the currently defined code. But I just want to be able to use a portable path for cross compiling purposes (i.e. windows and gp2x), without having to write out more code. How do I achieve this?
Thanks.
CODE
SDL_Surface *test_expensesList = SDL_LoadBMP("graphics/expenseslist.bmp");
SDL segfaults as I'm not specifying:
CODE
SDL_Surface *test_expensesList = SDL_LoadBMP("/mnt/sd/retest/graphics/expensesList.bmp");
I know I could just do:
CODE
#ifndef WIN32
SDL_Surface *test_expensesList = SDL_LoadBMP("graphics/expenseslist.bmp");
// rest of win32 style code
#endif
#ifndef GP2X
SDL_Surface *test_expensesList = SDL_LoadBMP("/mnt/sd/retest/graphics/expensesList.bmp");
// rest of gp2x style code
#endif
and this would not compile the currently defined code. But I just want to be able to use a portable path for cross compiling purposes (i.e. windows and gp2x), without having to write out more code. How do I achieve this?
Thanks.
Last edited by a moderator: