![]() |
|
SOIL_load_OGL_texture - failing to load texture - Printable Version +- iDevGames Forums (http://www.idevgames.com/forums) +-- Forum: Development Zone (/forum-3.html) +--- Forum: Graphics & Audio Programming (/forum-9.html) +--- Thread: SOIL_load_OGL_texture - failing to load texture (/thread-10281.html) |
SOIL_load_OGL_texture - failing to load texture - kropcke - Sep 4, 2012 01:56 PM Hi Everyone. In a previous post, AnotherJake helped me to fix an array of SOIL linker errors and warnings that I was getting (thanks again!!). Although I am no longer getting any errors or warnings, I've been unable to successfully load a texture. I'm using code that AnotherJake provided in a separate thread: Code: #include <stdlib.h>Things I have tried: 1. Using the png's provided by the original SOIL zip obtained at lonesock.net 2. Use my own png's, and tga's 3. Place SOIL_load_OGL_texture into a separate function 4. recreate my lib with the included makefile 5. drag SOIL.h and libSOIL.a into my project manually 6. commenting out "//exit(0);" results in an untextured, white square upon running the program 7. placing the png's/tga's into the same directory as my header, lib, and cpp But I continue to receive the same "failed to load texture" output as dictated by: Code: myTexture = SOIL_load_OGL_texture("myImage.png", 0, 1, SOIL_FLAG_POWER_OF_TWO | SOIL_FLAG_INVERT_Y);Do I fail to load the texture only b/c the texture isn't valid? Would I also get similar results if my library was screwy? Or the header? Just to reiterate: 1. I'm using the header provided in the original zip. 2. I created a mac-compatible lib using the makefile that came in the same zip. 3. I cleared out the obj directory every time I recreated my lib. The code AnotherJake provided is from 2009 (yup - I'm still using/searching old threads ). Is it possible there might be compatibility issues?I'm using xcode4.0.2, and am running OSX 10.6.8. GLUT | OpenGL | C++ I realize I've thrown a lot of questions out into the open, but mostly because I'm shooting blindly now trying to resolve this. At the root of my problem, "soil failed to load texture" - and I don't know why. If anyone could nudge me in the right direction, or share your wisdom, I would really appreciate it. Thank you again. Sincerely, kropcke RE: SOIL_load_OGL_texture - failing to load texture - backslash - Sep 5, 2012 06:17 AM It's probably the path. Giving just the filename "myImage.png" assumes that the file is in the working directory - is it. Do you know where the working directory for your application is? Try specifying the absolute path of the file and see if that works. RE: SOIL_load_OGL_texture - failing to load texture - OneSadCookie - Sep 5, 2012 08:39 AM Code: [[NSBundle mainBundle] pathForResource:ofType:inDirectory:]RE: SOIL_load_OGL_texture - failing to load texture - kropcke - Sep 5, 2012 10:08 AM Thank you so much for the replies backslash and OneSadCookie. Turns out that specifying the absolute path did the trick! Tested for both tga's and png's, and all's well ![]() Very, very happy for your replies, and I thank you again very much! Have a great day! ![]() -kropcke |