Mercurial > sdl-ios-xcode
diff src/video/windows/SDL_d3drender.c @ 5141:da10636e5eca
Making the API simpler, scaling is always defined as linear interpolation and should be supported as much as possible on all renderers.
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 31 Jan 2011 22:44:43 -0800 |
parents | e8916fe9cfc8 |
children | e743b9c3f6d6 |
line wrap: on
line diff
--- a/src/video/windows/SDL_d3drender.c Mon Jan 31 22:21:29 2011 -0800 +++ b/src/video/windows/SDL_d3drender.c Mon Jan 31 22:44:43 2011 -0800 @@ -107,8 +107,6 @@ SDL_Texture * texture); static int D3D_SetTextureBlendMode(SDL_Renderer * renderer, SDL_Texture * texture); -static int D3D_SetTextureScaleMode(SDL_Renderer * renderer, - SDL_Texture * texture); static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch); @@ -150,8 +148,6 @@ SDL_TEXTUREMODULATE_ALPHA), (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), - (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | - SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST), 0, {0}, 0, @@ -461,7 +457,6 @@ renderer->SetTextureColorMod = D3D_SetTextureColorMod; renderer->SetTextureAlphaMod = D3D_SetTextureAlphaMod; renderer->SetTextureBlendMode = D3D_SetTextureBlendMode; - renderer->SetTextureScaleMode = D3D_SetTextureScaleMode; renderer->UpdateTexture = D3D_UpdateTexture; renderer->LockTexture = D3D_LockTexture; renderer->UnlockTexture = D3D_UnlockTexture; @@ -804,23 +799,6 @@ } static int -D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) -{ - switch (texture->scaleMode) { - case SDL_SCALEMODE_NONE: - case SDL_SCALEMODE_FAST: - case SDL_SCALEMODE_SLOW: - case SDL_SCALEMODE_BEST: - return 0; - default: - SDL_Unsupported(); - texture->scaleMode = SDL_SCALEMODE_NONE; - return -1; - } - return 0; -} - -static int D3D_UpdateTexture(SDL_Renderer * renderer, SDL_Texture * texture, const SDL_Rect * rect, const void *pixels, int pitch) { @@ -1342,27 +1320,10 @@ shader = data->ps_mask; } - switch (texture->scaleMode) { - case SDL_SCALEMODE_NONE: - case SDL_SCALEMODE_FAST: - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, - D3DTEXF_POINT); - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, - D3DTEXF_POINT); - break; - case SDL_SCALEMODE_SLOW: - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, - D3DTEXF_LINEAR); - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, - D3DTEXF_LINEAR); - break; - case SDL_SCALEMODE_BEST: - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, - D3DTEXF_GAUSSIANQUAD); - IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, - D3DTEXF_GAUSSIANQUAD); - break; - } + IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, + D3DTEXF_LINEAR); + IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, + D3DTEXF_LINEAR); result = IDirect3DDevice9_SetTexture(data->device, 0, (IDirect3DBaseTexture9 *)