WinRT: utilized SDL_SetError's return value in the d3d11 renderer
authorDavid Ludwig <dludwig@pobox.com>
Wed, 25 Dec 2013 12:52:16 -0500
changeset 85569acb33672124
parent 8555 1e6d8983ea6e
child 8557 4e82337fea14
WinRT: utilized SDL_SetError's return value in the d3d11 renderer
src/render/direct3d11/SDL_render_d3d11.cpp
     1.1 --- a/src/render/direct3d11/SDL_render_d3d11.cpp	Wed Dec 25 12:48:47 2013 -0500
     1.2 +++ b/src/render/direct3d11/SDL_render_d3d11.cpp	Wed Dec 25 12:52:16 2013 -0500
     1.3 @@ -973,9 +973,8 @@
     1.4      HRESULT result;
     1.5      DXGI_FORMAT textureFormat = SDLPixelFormatToDXGIFormat(texture->format);
     1.6      if (textureFormat == SDL_PIXELFORMAT_UNKNOWN) {
     1.7 -        SDL_SetError("%s, An unsupported SDL pixel format (0x%x) was specified",
     1.8 +        return SDL_SetError("%s, An unsupported SDL pixel format (0x%x) was specified",
     1.9              __FUNCTION__, texture->format);
    1.10 -        return -1;
    1.11      }
    1.12  
    1.13      textureData = new D3D11_TextureData;
    1.14 @@ -1106,8 +1105,7 @@
    1.15          // An error is already set.  Attach some info to it, then return to
    1.16          // the caller.
    1.17          std::string errorMessage = string(__FUNCTION__ ", Lock Texture Failed: ") + SDL_GetError();
    1.18 -        SDL_SetError(errorMessage.c_str());
    1.19 -        return -1;
    1.20 +        return SDL_SetError(errorMessage.c_str());
    1.21      }
    1.22  
    1.23      // Copy pixel data to the locked texture's memory:
    1.24 @@ -1135,8 +1133,7 @@
    1.25      HRESULT result = S_OK;
    1.26  
    1.27      if (textureData->stagingTexture) {
    1.28 -        SDL_SetError("texture is already locked");
    1.29 -        return -1;
    1.30 +        return SDL_SetError("texture is already locked");
    1.31      }
    1.32      
    1.33      // Create a 'staging' texture, which will be used to write to a portion
    1.34 @@ -1228,8 +1225,7 @@
    1.35  
    1.36      if (!textureData->mainTextureRenderTargetView) {
    1.37          std::string errorMessage = string(__FUNCTION__) + ": specified texture is not a render target";
    1.38 -        SDL_SetError(errorMessage.c_str());
    1.39 -        return -1;
    1.40 +        return SDL_SetError(errorMessage.c_str());
    1.41      }
    1.42  
    1.43      rendererData->currentOffscreenRenderTargetView = textureData->mainTextureRenderTargetView;
    1.44 @@ -1268,8 +1264,7 @@
    1.45              XMStoreFloat4x4(&data->vertexShaderConstantsData.projection, XMMatrixRotationZ(-XM_PIDIV2));
    1.46              break;
    1.47          default:
    1.48 -            SDL_SetError("An unknown DisplayOrientation is being used");
    1.49 -            return -1;
    1.50 +            return SDL_SetError("An unknown DisplayOrientation is being used");
    1.51      }
    1.52  
    1.53      //
    1.54 @@ -1892,8 +1887,7 @@
    1.55          // When SDL_ConvertPixels fails, it'll have already set the format.
    1.56          // Get the error message, and attach some extra data to it.
    1.57          std::string errorMessage = string(__FUNCTION__ ", Convert Pixels failed: ") + SDL_GetError();
    1.58 -        SDL_SetError(errorMessage.c_str());
    1.59 -        return -1;
    1.60 +        return SDL_SetError(errorMessage.c_str());
    1.61      }
    1.62  
    1.63      // Unmap the texture: