0

Trying to load images for textures using SOIL, but it can be loaded only from program's directory, any other variants doesnt work(((( This code doesnt work:

mage = SOIL_load_image("C:\\Codes\\Instinct\\March\\V 0.5\\3. UI\\bin\\Debug\\1\\3.jpg", &width, &height, 0, SOIL_LOAD_RGB);

This code works:

image = SOIL_load_image("3.jpg", &width, &height, 0, SOIL_LOAD_RGB);

Any ideas how to fix it?

  • Why are there spaces in your absolute path? `..\\V 0.5\\3. UI\\..`. This might be the reason why it does not work. You probably just copied the path from a terminal, which sometimes prints path's that are not valid when used somewhere else. Create and try an extreme simple path like `"C:\\temp\\3.jpg`. If that works, rename your directories or figure out how the valid pathname has to look like. – wychmaster Mar 13 '20 at 07:30
  • @wychmaster spaces or other path doesnt seem to work, Ive tried all possible variants like "C:\\test\\3.jpg" or so, doesnt work still. Im thinking that there is a problem in SOIL itself, gonna take a look into the source. Thank you for your attention anyway. – TonyMortician Mar 13 '20 at 09:22

0 Answers0