Best Texture Method
Can somebody point me to, or give me, code for what they consider the best way of using textures with SDL/OpenGL?
Check out the NeHe tutorials - there is a TGA loader (which is what most people use) tutorial there. http://nehe.gamedev.net
When porting for neheX, I also wrote an SDL_image based texture loader, dl here.
(Note that due to a minor undocumented feature in SDL, you'll have to run it in millions of colours, or artifacts will start being introduced into the textures; the fix is literally one line, but I just haven't had the time to upload yet
)
(Note that due to a minor undocumented feature in SDL, you'll have to run it in millions of colours, or artifacts will start being introduced into the textures; the fix is literally one line, but I just haven't had the time to upload yet
)
Mark Bishop
Does anybody know of a PNG loader for OpenGL (run through SDL)?
like sealfin said, you want sdl_image. It will load several common image types into an SDL surface with a single function call.
SDL_image page
SDL_image page
Ok thanks.
How do I install it? I ran ./configure in the terminal but was told that I needed SDL Version 1.2.4 and I have 1.2.7. Is there another way to take care of installing SDL_image?
SimReality/Nick Wrote:How do I install it? I ran ./configure in the terminal but was told that I needed SDL Version 1.2.4 and I have 1.2.7. Is there another way to take care of installing SDL_image?
Download the development .pkg of it for OS X from the SDL_Image site, then install it. Then add to your project the SDL_Image framework from ~/Library/Frameworks/. Next you need to compile it into your project like the other forum posts show (same as compiling SDL in). Then in your files do '#include <SDL_image/SDL_image.h>'
compile it into my project? i'm not sure i've done that with anything yet.
SimReality/Nick Wrote:compile it into my project? i'm not sure i've done that with anything yet.
Add a new "Copy Build Phase" to your project, click on the main project file to show all the files, then drag the SDL_image framework into "Target->YourTarget->Copy Files"

