DXGL r382 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r381‎ | r382 | r383 >
Date:21:37, 9 June 2013
Author:admin
Status:new
Tags:
Comment:
Use EXT_direct_state_access to set texture filters.
Allow IDirectDraw7::EnumDisplayModes to omit lpDDSurfaceDesc2
Modified paths:
  • /ddraw/glDirectDraw.cpp (modified) (history)
  • /ddraw/glDirectDrawSurface.cpp (modified) (history)

Diff [purge]

Index: ddraw/glDirectDraw.cpp
@@ -856,7 +856,6 @@
857857 {
858858 TRACE_ENTER(5,14,this,9,dwFlags,14,lpDDSurfaceDesc2,14,lpContext,14,lpEnumModesCallback);
859859 if(!this) TRACE_RET(HRESULT,23,DDERR_INVALIDOBJECT);
860 - if(!lpDDSurfaceDesc2) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
861860 if(!lpEnumModesCallback) TRACE_RET(HRESULT,23,DDERR_INVALIDPARAMS);
862861 HRESULT ret = ::EnumDisplayModes(dwFlags,lpDDSurfaceDesc2,lpContext,lpEnumModesCallback);
863862 TRACE_EXIT(23,ret);
Index: ddraw/glDirectDrawSurface.cpp
@@ -1409,18 +1409,19 @@
14101410 min = GL_LINEAR_MIPMAP_LINEAR;
14111411 break;
14121412 }
1413 - //if((magfilter != mag) || (minfilter != min))
1414 - ::SetTexture(level,texture);
1415 - //if(magfilter != mag)
1416 - //{
 1413+ if(GLEXT_EXT_direct_state_access)
 1414+ {
 1415+ glTextureParameteriEXT(texture->id,GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,mag);
 1416+ glTextureParameteriEXT(texture->id,GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,min);
 1417+ }
 1418+ else
 1419+ {
 1420+ ::SetTexture(level,texture);
14171421 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER,mag);
1418 - magfilter = mag;
1419 - //}
1420 - //if(minfilter != min)
1421 - //{
14221422 glTexParameteri(GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER,min);
1423 - minfilter = min;
1424 - //}
 1423+ }
 1424+ magfilter = mag;
 1425+ minfilter = min;
14251426 TRACE_EXIT(0,0);
14261427 }
14271428