All of the changes are made in: COpenGLTexture.cpp
List of changes:
After:
Code: Select all
#include "glext.h"
Code: Select all
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
Code: Select all
void COpenGLTexture::copyTexture()
Code: Select all
//! copies the the texture into an open gl texture.
void COpenGLTexture::copyTexture()
{
glBindTexture(GL_TEXTURE_2D, TextureName);
if (testError())
os::Printer::log("Could not bind Texture", ELL_ERROR);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, ImageSize.Width,
ImageSize.Height, 0, GL_BGRA_EXT , GL_UNSIGNED_BYTE, ImageData);
if (testError())
os::Printer::log("Could not glTexImage2D", ELL_ERROR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
if (hasMipMaps)
{
s32 ret = 0;
#ifndef DISABLE_MIPMAPPING
ret = gluBuild2DMipmaps(GL_TEXTURE_2D, 4, ImageSize.Width, ImageSize.Height,
GL_BGRA_EXT, GL_UNSIGNED_BYTE, ImageData);
#endif
if (ret)
{
#ifndef DISABLE_MIPMAPPING
os::Printer::log("Could not create OpenGL texture mip maps.",
(c8*)gluErrorString(ret), ELL_ERROR);
#else
os::Printer::log("Did not create OpenGL texture mip maps.", ELL_ERROR);
#endif
}
else
{
if(!strstr((char*)glGetString(GL_EXTENSIONS), "GL_EXT_texture_filter_anisotropic"))
{
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
}
else
{
float maximumAnisotropy;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &maximumAnisotropy);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, maximumAnisotropy);
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_NEAREST );
//glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
}
}
}
}
Enjoy~ John DiSanti
________
ZX14 VS HAYABUSA