For those of you who know what anisotropic filtering is, heres some code for you.
This code is from my Anisotropic Filtering DLL for DBPro. The DLL is open source too.
http://forum.thegamecreators.com/?m=forum_view&t=159383&b=5
And the code:
void EnableAnisotropicFiltering(unsigned long Anisotropy)
{
//Get D3D device
IDirect3DDevice9* Device;
Device=dbGetDirect3DDevice();
//Turn on anisotropic filtering
int i;
for(i=0;i<8;i++)
Device->SetSamplerState(i,D3DSAMP_MAXANISOTROPY,Anisotropy);
}
void SetObjectAnisotropicFilteringOn(unsigned long object)
{
//Variables
sObject* Object=dbGetObject(object);
int i;
unsigned long t;
//Loop through meshes and turn on anisotropic filtering
for(i=0;i<Object->iMeshCount;i++)
{
for(t=0;t<Object->ppMeshList[i]->dwTextureCount;t++)
{
Object->ppMeshList[i]->pTextures[t].dwMinState=D3DTEXF_ANISOTROPIC;
}
}
}
void SetObjectAnisotropicFilteringOff(unsigned long object)
{
//Variables
sObject* Object=dbGetObject(object);
int i;
unsigned long t;
//Loop through meshes and turn on anisotropic filtering
for(i=0;i<Object->iMeshCount;i++)
{
for(t=0;t<Object->ppMeshList[i]->dwTextureCount;t++)
{
Object->ppMeshList[i]->pTextures[t].dwMinState=D3DTEXF_LINEAR;
}
}
}
Screenshot:
Special thanks to roka. Screen shots from
Rush Team (FPS)