Implemented OpenGL anisotropic filtering
This commit is contained in:
parent
d84cb0e629
commit
d81f8ce729
|
@ -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"
|
||||
>
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()
|
||||
{
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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
|
||||
|
|
1616
src/win32/resource.h
1616
src/win32/resource.h
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue