Mercurial > sdl-ios-xcode
comparison src/video/win32/SDL_d3drender.c @ 4929:aa8888658021
Use the enumerated type for blend and scale mode instead of int
Renamed SDL_TextureScaleMode to SDL_ScaleMode
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Sun, 12 Dec 2010 15:19:05 -0800 |
parents | e1664f94f026 |
children |
comparison
equal
deleted
inserted
replaced
4927:d716dff4b13e | 4929:aa8888658021 |
---|---|
148 SDL_RENDERER_ACCELERATED), | 148 SDL_RENDERER_ACCELERATED), |
149 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR | | 149 (SDL_TEXTUREMODULATE_NONE | SDL_TEXTUREMODULATE_COLOR | |
150 SDL_TEXTUREMODULATE_ALPHA), | 150 SDL_TEXTUREMODULATE_ALPHA), |
151 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | | 151 (SDL_BLENDMODE_NONE | SDL_BLENDMODE_MASK | |
152 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), | 152 SDL_BLENDMODE_BLEND | SDL_BLENDMODE_ADD | SDL_BLENDMODE_MOD), |
153 (SDL_TEXTURESCALEMODE_NONE | SDL_TEXTURESCALEMODE_FAST | | 153 (SDL_SCALEMODE_NONE | SDL_SCALEMODE_FAST | |
154 SDL_TEXTURESCALEMODE_SLOW | SDL_TEXTURESCALEMODE_BEST), | 154 SDL_SCALEMODE_SLOW | SDL_SCALEMODE_BEST), |
155 0, | 155 0, |
156 {0}, | 156 {0}, |
157 0, | 157 0, |
158 0} | 158 0} |
159 }; | 159 }; |
805 | 805 |
806 static int | 806 static int |
807 D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) | 807 D3D_SetTextureScaleMode(SDL_Renderer * renderer, SDL_Texture * texture) |
808 { | 808 { |
809 switch (texture->scaleMode) { | 809 switch (texture->scaleMode) { |
810 case SDL_TEXTURESCALEMODE_NONE: | 810 case SDL_SCALEMODE_NONE: |
811 case SDL_TEXTURESCALEMODE_FAST: | 811 case SDL_SCALEMODE_FAST: |
812 case SDL_TEXTURESCALEMODE_SLOW: | 812 case SDL_SCALEMODE_SLOW: |
813 case SDL_TEXTURESCALEMODE_BEST: | 813 case SDL_SCALEMODE_BEST: |
814 return 0; | 814 return 0; |
815 default: | 815 default: |
816 SDL_Unsupported(); | 816 SDL_Unsupported(); |
817 texture->scaleMode = SDL_TEXTURESCALEMODE_NONE; | 817 texture->scaleMode = SDL_SCALEMODE_NONE; |
818 return -1; | 818 return -1; |
819 } | 819 } |
820 return 0; | 820 return 0; |
821 } | 821 } |
822 | 822 |
1341 if (texture->blendMode == SDL_BLENDMODE_MASK) { | 1341 if (texture->blendMode == SDL_BLENDMODE_MASK) { |
1342 shader = data->ps_mask; | 1342 shader = data->ps_mask; |
1343 } | 1343 } |
1344 | 1344 |
1345 switch (texture->scaleMode) { | 1345 switch (texture->scaleMode) { |
1346 case SDL_TEXTURESCALEMODE_NONE: | 1346 case SDL_SCALEMODE_NONE: |
1347 case SDL_TEXTURESCALEMODE_FAST: | 1347 case SDL_SCALEMODE_FAST: |
1348 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, | 1348 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, |
1349 D3DTEXF_POINT); | 1349 D3DTEXF_POINT); |
1350 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, | 1350 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, |
1351 D3DTEXF_POINT); | 1351 D3DTEXF_POINT); |
1352 break; | 1352 break; |
1353 case SDL_TEXTURESCALEMODE_SLOW: | 1353 case SDL_SCALEMODE_SLOW: |
1354 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, | 1354 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, |
1355 D3DTEXF_LINEAR); | 1355 D3DTEXF_LINEAR); |
1356 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, | 1356 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, |
1357 D3DTEXF_LINEAR); | 1357 D3DTEXF_LINEAR); |
1358 break; | 1358 break; |
1359 case SDL_TEXTURESCALEMODE_BEST: | 1359 case SDL_SCALEMODE_BEST: |
1360 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, | 1360 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MINFILTER, |
1361 D3DTEXF_GAUSSIANQUAD); | 1361 D3DTEXF_GAUSSIANQUAD); |
1362 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, | 1362 IDirect3DDevice9_SetSamplerState(data->device, 0, D3DSAMP_MAGFILTER, |
1363 D3DTEXF_GAUSSIANQUAD); | 1363 D3DTEXF_GAUSSIANQUAD); |
1364 break; | 1364 break; |