Advertisement

TGA files etc.

Started by March 08, 2001 01:35 PM
3 comments, last by Professor 23 years, 8 months ago
I tried to use Nate''s TGA loader, which comes with this tutorial: http://nate.scuzzy.net/gltut/texture.zip with Nehe''s Lesson 05. I tried to draw a quad and texture it but MSVC complains about loadTGA: Configuration: lesson5 - Win32 Debug Linking... lesson5.obj : error LNK2001: unresolved external symbol "int __cdecl loadTGA(char *,int)" (?loadTGA@@YAHPADH@Z) Debug/lesson5.exe : fatal error LNK1120: 1 unresolved externals Error executing link.exe. lesson5.exe - 2 error(s), 0 warning(s) Any idea what I''m doing wrong? It has to be something in MSVC settings... BTW Those TGA files take a huge amount of space! A 512x512 texture with alpha channel takes a meg. Should I learn to use OpenIL and use jpg:s, or what? Professor
You can''t mix .c and .cpp files without adding some stuff to headers. If you want C++ TGA code go here http://nate.scuzzy.net/common.html
Advertisement
Use OpenIL. ;-)
Denton Woods, aka DooMWizDeveloper's Image Library (DevIL) @ http://www.imagelib.org .
Thanks a lot for the info, but how do I use these gltga.cpp and gltga.h? The code looks very strange :D
Do I also have to have tga.cpp, tga.h, utility.cpp and utility.h?

I''d just like to load a texture to some id, and then use the id to assign the texture to a quad. And it would be nice to be able to use alpha channels too.

Professor
OK, I used OpenIL to load a TGA file with an alpha channel and the parts that are black in the alpha channel are fully transparent but the parts that are white are also like 50% transparent.

Should I use something else than:
glBlendFunc(GL_SRC_ALPHA,GL_ONE);

Professor

This topic is closed to new replies.

Advertisement