| | |
| | | return SDL_TRUE; |
| | | } |
| | | |
| | | static D3D11_FILTER |
| | | GetScaleQuality(void) |
| | | { |
| | | const char *hint = SDL_GetHint(SDL_HINT_RENDER_SCALE_QUALITY); |
| | | if (!hint || *hint == '0' || SDL_strcasecmp(hint, "nearest") == 0) { |
| | | return D3D11_FILTER_MIN_MAG_MIP_POINT; |
| | | } else /* if (*hint == '1' || SDL_strcasecmp(hint, "linear") == 0) */ { |
| | | return D3D11_FILTER_MIN_MAG_MIP_LINEAR; |
| | | } |
| | | } |
| | | |
| | | static int |
| | | D3D11_CreateTexture(SDL_Renderer * renderer, SDL_Texture * texture) |
| | | { |
| | |
| | | SDL_OutOfMemory(); |
| | | return -1; |
| | | } |
| | | textureData->scaleMode = GetScaleQuality(); |
| | | textureData->scaleMode = (texture->scaleMode == SDL_ScaleModeNearest) ? D3D11_FILTER_MIN_MAG_MIP_POINT : D3D11_FILTER_MIN_MAG_MIP_LINEAR; |
| | | |
| | | texture->driverdata = textureData; |
| | | |
| | |
| | | D3D11_RenderCopy(SDL_Renderer * renderer, SDL_Texture * texture, |
| | | const SDL_Rect * srcrect, const SDL_FRect * dstrect) |
| | | { |
| | | D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; |
| | | D3D11_TextureData *textureData = (D3D11_TextureData *) texture->driverdata; |
| | | float minu, maxu, minv, maxv; |
| | | Float4 color; |
| | | VertexPositionColor vertices[4]; |
| | |
| | | const SDL_Rect * srcrect, const SDL_FRect * dstrect, |
| | | const double angle, const SDL_FPoint * center, const SDL_RendererFlip flip) |
| | | { |
| | | D3D11_RenderData *rendererData = (D3D11_RenderData *) renderer->driverdata; |
| | | D3D11_TextureData *textureData = (D3D11_TextureData *) texture->driverdata; |
| | | float minu, maxu, minv, maxv; |
| | | Float4 color; |
| | | Float4X4 modelMatrix; |