OpenGL中用FreeImage
FreeImage is an Open Source library project for developers who would like to support popular graphics image formats like PNG, BMP, JPEG, TIFF and others as needed by today's multimedia applications. FreeImage is easy to use, fast, multithreading safe, compatible with all 32-bit versions of Windows, and cross-platform (works both with Linux and Mac OS X).
测试过png,bmp,jpg,tga。
TextureManager.h
//
**********************************************
//
Singleton Texture Manager class
//
Written by Ben English
//
[email protected]
//
//
For use with OpenGL and the FreeImage library
//
**********************************************
#ifndef TextureManager_H
#define
TextureManager_H
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
#include
<
gl
/
glew.h
>
#include
"
FreeImage.h
"
#include
<
map
>
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
class
TextureManager
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
public:
static TextureManager* Inst();
virtual ~TextureManager();
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//load a texture an make it the current texture
//if texID is already in use, it will be unloaded and replaced with this texture
bool LoadTexture(const char* filename, //where to load the file from
const unsigned int texID, //arbitrary id you will reference the texture by
//does not have to be generated with glGenTextures
GLenum image_format = GL_RGB, //format the image is in
GLint internal_format = GL_RGB, //format to store the image in
GLint level = 0, //mipmapping level
GLint border = 0); //border size
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//free the memory for a texture
bool UnloadTexture(const unsigned int texID);
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//set the current texture
bool BindTexture(const unsigned int texID);
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//free all texture memory
void UnloadAllTextures();
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
protected:
TextureManager();
TextureManager(const TextureManager& tm);
TextureManager& operator=(const TextureManager& tm);
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
static TextureManager* m_inst;
std::map<unsigned int, GLuint> m_texID;
}
;
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
#endif
TextureManager.cpp
//
**********************************************
//
Singleton Texture Manager class
//
Written by Ben English
//
[email protected]
//
//
For use with OpenGL and the FreeImage library
//
**********************************************
#include
"
TextureManager.h
"
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
TextureManager
*
TextureManager::m_inst(
0
);
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
TextureManager
*
TextureManager::Inst()
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
if(!m_inst)
m_inst = new TextureManager();
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
return m_inst;
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
TextureManager::TextureManager()
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
// call this ONLY when linking with FreeImage as a static library
#ifdef FREEIMAGE_LIB
FreeImage_Initialise();
#endif
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
//
these should never be called
//
TextureManager::TextureManager(const TextureManager& tm){}
//
TextureManager& TextureManager::operator=(const TextureManager& tm){}
TextureManager::
~
TextureManager()
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
// call this ONLY when linking with FreeImage as a static library
#ifdef FREEIMAGE_LIB
FreeImage_DeInitialise();
#endif
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
UnloadAllTextures();
m_inst = 0;
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
bool
TextureManager::LoadTexture(
const
char
*
filename,
const
unsigned
int
texID, GLenum image_format, GLint internal_format, GLint level, GLint border)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
//image format
FREE_IMAGE_FORMAT fif = FIF_UNKNOWN;
//pointer to the image, once loaded
FIBITMAP *dib(0);
//pointer to the image data
BYTE* bits(0);
//image width and height
unsigned int width(0), height(0);
//OpenGL's image ID to map to
GLuint gl_texID;
//check the file signature and deduce its format
fif = FreeImage_GetFileType(filename, 0);
//if still unknown, try to guess the file format from the file extension
if(fif == FIF_UNKNOWN)
fif = FreeImage_GetFIFFromFilename(filename);
//if still unkown, return failure
if(fif == FIF_UNKNOWN)
return false;
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//check that the plugin has reading capabilities and load the file
if(FreeImage_FIFSupportsReading(fif))
dib = FreeImage_Load(fif, filename);
//if the image failed to load, return failure
if(!dib)
return false;
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//retrieve the image data
bits = FreeImage_GetBits(dib);
//get the image width and height
width = FreeImage_GetWidth(dib);
height = FreeImage_GetHeight(dib);
//if this somehow one of these failed (they shouldn't), return failure
if((bits == 0) || (width == 0) || (height == 0))
return false;
//if this texture ID is in use, unload the current texture
if(m_texID.find(texID) != m_texID.end())
glDeleteTextures(1, &(m_texID[texID]));
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//generate an OpenGL texture ID for this texture
glGenTextures(1, &gl_texID);
//store the texture ID mapping
m_texID[texID] = gl_texID;
//bind to the new texture ID
glBindTexture(GL_TEXTURE_2D, gl_texID);
//store the texture data for OpenGL use
glTexImage2D(GL_TEXTURE_2D, level, internal_format, width, height,
border, image_format, GL_UNSIGNED_BYTE, bits);
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//Free FreeImage's copy of the data
FreeImage_Unload(dib);
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//return success
return true;
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
bool
TextureManager::UnloadTexture(
const
unsigned
int
texID)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
bool result(true);
//if this texture ID mapped, unload it's texture, and remove it from the map
if(m_texID.find(texID) != m_texID.end())
![](http://img.e-com-net.com/image/product/16676c75a1f24c2286f9cfe3320175c2.gif)
{
glDeleteTextures(1, &(m_texID[texID]));
m_texID.erase(texID);
}
//otherwise, unload failed
else
![](http://img.e-com-net.com/image/product/16676c75a1f24c2286f9cfe3320175c2.gif)
{
result = false;
}
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
return result;
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
bool
TextureManager::BindTexture(
const
unsigned
int
texID)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
bool result(true);
//if this texture ID mapped, bind it's texture as current
if(m_texID.find(texID) != m_texID.end())
glBindTexture(GL_TEXTURE_2D, m_texID[texID]);
//otherwise, binding failed
else
result = false;
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
return result;
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
void
TextureManager::UnloadAllTextures()
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
//start at the begginning of the texture map
std::map<unsigned int, GLuint>::iterator i = m_texID.begin();
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//Unload the textures untill the end of the texture map is found
while(i != m_texID.end())
UnloadTexture(i->first);
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//clear the texture map
m_texID.clear();
}
Main.cpp
/**/
/************************************************************************/
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
/**/
/*Brief: Test all kinds of Textures in OpenGL */
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
/**/
/*Author: tiny */
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
/**/
/*Date: 09/29/2008 */
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
/**/
/************************************************************************/
#include
"
TextureManager.h
"
#include
<
gl
/
glew.h
>
#include
<
gl
/
glut.h
>
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
//
全局贴图ID
GLuint texture[
1
];
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
void
init()
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
//将2D贴图状态打开
glEnable( GL_TEXTURE_2D );
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//单件贴图管理
//如果加载带路径的文件最好选用.\\
这样的格式
TextureManager::Inst()->LoadTexture( "OpenGL_his.jpg", texture[0] );
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//线性过滤一定要放到加载纹理的后面
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,GL_LINEAR); // 线性滤波
glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,GL_LINEAR); // 线性滤波
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
glClearColor( 0.5, 0.5, 0.5, 0.5 );
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
void
display()
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//绑定纹理
TextureManager::Inst()->BindTexture( texture[0] );
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
//渲染
glBegin( GL_QUADS );
glTexCoord2d( 0, 0 ); glVertex3f( -5.0f, -5.0f, 0.0f );
glTexCoord2d( 0, 1 ); glVertex3f( -5.0f, 5.0f, 0.0f );
glTexCoord2d( 1, 1 ); glVertex3f( 5.0f, 5.0f, 0.0f );
glTexCoord2d( 1, 0 ); glVertex3f( 5.0f, -5.0f, 0.0f );
glEnd();
glFlush();
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
glutSwapBuffers();
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
void
reshape(
int
w,
int
h )
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
glViewport( 0, 0, GLsizei( w ), GLsizei( h ) );
glMatrixMode( GL_PROJECTION );
glLoadIdentity();
gluPerspective( 45, ( GLdouble ) w / ( GLdouble ) h, 1.0f, 1000.0f );
glMatrixMode( GL_MODELVIEW );
glLoadIdentity();
gluLookAt( 0, 0, 20, 0, 0, 0, 0, 1, 0 );
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
void
keyboard( unsigned
char
key,
int
x,
int
y )
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
if ( key == 27 )
![](http://img.e-com-net.com/image/product/16676c75a1f24c2286f9cfe3320175c2.gif)
{
//释放掉贴图,防止内存泄露
TextureManager::Inst()->UnloadTexture( texture[0] );
exit( 0 );
}
}
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
int
main(
int
argc,
char
*
argv[] )
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
{
glutInit( &argc, argv );
glutInitDisplayMode( GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH );
glutInitWindowPosition( 300, 300 );
glutInitWindowSize( 400, 300 );
glutCreateWindow( "OpenGL Texture Test" );
init();
glutReshapeFunc( reshape );
glutKeyboardFunc( keyboard );
glutDisplayFunc( display );
glutMainLoop();
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
return 0;
}
bmp效果图:
tga效果图:
jpg效果图:
png效果图:
有的图的效果不是想要的,可能和RGB的顺序有关。
测试过png,bmp,jpg,tga。
TextureManager.h
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
TextureManager.cpp
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/16676c75a1f24c2286f9cfe3320175c2.gif)
![](http://img.e-com-net.com/image/product/d81fe41b31c2438aa82734253e0a4bcc.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4407806dd42e464c873774a6e93bb38f.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/16676c75a1f24c2286f9cfe3320175c2.gif)
![](http://img.e-com-net.com/image/product/d81fe41b31c2438aa82734253e0a4bcc.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4407806dd42e464c873774a6e93bb38f.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
Main.cpp
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/16676c75a1f24c2286f9cfe3320175c2.gif)
![](http://img.e-com-net.com/image/product/d81fe41b31c2438aa82734253e0a4bcc.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4407806dd42e464c873774a6e93bb38f.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/696412be261e44caa983ccc5cd2a1540.gif)
![](http://img.e-com-net.com/image/product/44df1c303f404ee184fdd8904c682a7f.gif)
![](http://img.e-com-net.com/image/product/f6242890d71a40ab957c0cf10b55aac8.gif)
![](http://img.e-com-net.com/image/product/02d0904de3cc460eae11f6902a7115a2.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/58b5517de74d4214832479bcb515bf73.gif)
![](http://img.e-com-net.com/image/product/4b8a34bc3c4948718086824535908452.gif)
![OpenGL中用FreeImage_第1张图片](http://img.e-com-net.com/image/product/aeea6d56fc81400cbfbd1790500dcc1d.jpg)
tga效果图:
![OpenGL中用FreeImage_第2张图片](http://img.e-com-net.com/image/product/2a0586d122dc40c1b0cd853adafd69ef.jpg)
jpg效果图:
![OpenGL中用FreeImage_第3张图片](http://img.e-com-net.com/image/product/f8e917c0e8644b3fa3a05a232ab8fa9a.jpg)
png效果图:
![OpenGL中用FreeImage_第4张图片](http://img.e-com-net.com/image/product/993c9fa4b3fe49e381348bd99b25925a.jpg)
有的图的效果不是想要的,可能和RGB的顺序有关。