Implemented scaling in the D3D renderer

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401962
This commit is contained in:
Sam Lantinga 2006-07-19 05:45:42 +00:00
parent 9eea51e280
commit cfe0a80302
2 changed files with 49 additions and 9 deletions

View file

@ -653,6 +653,28 @@ D3D_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture,
break;
}
switch (scaleMode) {
case SDL_TextureScaleMode_None:
case SDL_TextureScaleMode_Fast:
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
D3DTEXF_POINT);
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
D3DTEXF_POINT);
break;
case SDL_TextureScaleMode_Slow:
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
D3DTEXF_LINEAR);
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
D3DTEXF_LINEAR);
break;
case SDL_TextureScaleMode_Best:
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER,
D3DTEXF_GAUSSIANQUAD);
IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER,
D3DTEXF_GAUSSIANQUAD);
break;
}
result =
IDirect3DDevice9_SetTexture(data->device, 0,
(IDirect3DBaseTexture9 *) texturedata->