Implemented OpenGL anisotropic filtering

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@34 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
mudlord 2007-11-08 10:28:49 +00:00
parent 4e58ac922b
commit 3d9d44389e
7 changed files with 840 additions and 807 deletions

View File

@ -1164,6 +1164,10 @@
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
<File
RelativePath=".\src\win32\resource.h"
>
</File>
<Filter
Name="GB"
>

View File

@ -175,6 +175,8 @@ BEGIN_MESSAGE_MAP(MainWnd, CWnd)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST, OnUpdateOptionsVideoRenderoptionsGlnearest)
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnOptionsVideoRenderoptionsGlbilinear)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR, OnUpdateOptionsVideoRenderoptionsGlbilinear)
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLANISOTROPIC, OnOptionsVideoRenderoptionsGlanisotropic)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLANISOTROPIC, OnUpdateOptionsVideoRenderoptionsGlanisotropic)
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE, OnOptionsVideoRenderoptionsGltriangle)
ON_UPDATE_COMMAND_UI(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE, OnUpdateOptionsVideoRenderoptionsGltriangle)
ON_COMMAND(ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS, OnOptionsVideoRenderoptionsGlquads)

View File

@ -202,6 +202,9 @@ class MainWnd : public CWnd
afx_msg void OnUpdateOptionsVideoRenderoptionsGlnearest(CCmdUI* pCmdUI);
afx_msg void OnOptionsVideoRenderoptionsGlbilinear();
afx_msg void OnUpdateOptionsVideoRenderoptionsGlbilinear(CCmdUI* pCmdUI);
afx_msg void OnUpdateOptionsVideoRenderoptionsGlanisotropic(CCmdUI* pCmdUI);
afx_msg void OnOptionsVideoRenderoptionsGlanisotropic();
afx_msg void OnOptionsVideoRenderoptionsGltriangle();
afx_msg void OnUpdateOptionsVideoRenderoptionsGltriangle(CCmdUI* pCmdUI);
afx_msg void OnOptionsVideoRenderoptionsGlquads();

View File

@ -585,6 +585,20 @@ void MainWnd::OnUpdateOptionsVideoRenderoptionsGlbilinear(CCmdUI* pCmdUI)
pCmdUI->SetCheck(theApp.glFilter == 1);
}
void MainWnd::OnOptionsVideoRenderoptionsGlanisotropic()
{
theApp.glFilter = 2;
if( theApp.display ) {
theApp.display->setOption( _T("glFilter"), theApp.glFilter );
}
}
void MainWnd::OnUpdateOptionsVideoRenderoptionsGlanisotropic(CCmdUI* pCmdUI)
{
pCmdUI->SetCheck(theApp.glFilter == 2);
}
void MainWnd::OnOptionsVideoRenderoptionsGltriangle()
{

View File

@ -492,6 +492,13 @@ void OpenGLDisplay::updateFiltering( int value )
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
break;
case 2:
float largest_supported_anisotropy;
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT, &largest_supported_anisotropy);
glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAX_ANISOTROPY_EXT, largest_supported_anisotropy);
break;
}
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP );

View File

@ -1552,6 +1552,7 @@ BEGIN
MENUITEM "&OpenGL", ID_OPTIONS_VIDEO_RENDERMETHOD_OPENGL
MENUITEM " Filter: Nearest", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLNEAREST
MENUITEM " Filter: Bilinear", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLBILINEAR
MENUITEM " Filter: Anisotropic", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLANISOTROPIC
MENUITEM " Vertex: Triangle", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLTRIANGLE
MENUITEM " Vertex: Quads", ID_OPTIONS_VIDEO_RENDEROPTIONS_GLQUADS
MENUITEM SEPARATOR

File diff suppressed because it is too large Load Diff