title: How can I create Direct3d 11 renderer using SDL 2.0.9
body: <p>In my project I must use <code>SDL_BLENDOPERATION_MAXIMUM</code> via <code>SDL_ComposeCustomBlendMode()</code> which is supported in SDL 2.0.9 by direct3d11 renderer only. I have Windows 8.1 and GeForce GTX750 Ti with updated drivers.  My system should support DirectX 11 renderending.</p>
  
  <p>Changing defines in <code>SDL_config.h</code> or <code>SDL_config_windows.h</code> (<code>SDL_VIDEO_RENDER_D3D11</code> to 1 and <code>SDL_VIDEO_RENDER_D3D</code> to 0) doesn't help. 
  I tried to fill preprocessor difinitions with defines SDL_VIDEO_RENDER_D3D11 or WINRT according to SDL source code. But it doesn't help.</p>
  
  <p>What should I do to activate direct3d11 renderer so I can use blend mode max?</p>
  
  <p>My test code:</p>
  
  <pre><code>#include "SDL.h"
  #include "SDL_image.h"
  #include &lt;string&gt;
  
  using namespace std;
  
  int main( int argc, char *argv[] ) {
      SDL_Init( SDL_INIT_VIDEO );
      IMG_Init( IMG_INIT_PNG );
      SDL_SetHintWithPriority( SDL_HINT_RENDER_DRIVER, "direct3d11", SDL_HINT_OVERRIDE );
      SDL_Window *window = SDL_CreateWindow( "Testing", SDL_WINDOWPOS_CENTERED, SDL_WINDOWPOS_CENTERED,
                                               1200, 600, SDL_WINDOW_RESIZABLE );
      SDL_Renderer *renderer = SDL_CreateRenderer( window, -1, SDL_RENDERER_ACCELERATED );
      SDL_RendererInfo *rendererInfo = new SDL_RendererInfo();
      SDL_RendererInfo *driverInfo = new SDL_RendererInfo();
      SDL_GetRendererInfo( renderer, rendererInfo );
      int drivers = SDL_GetNumRenderDrivers();
      string availableDrivers = " (";
      for ( int i = 0; i &lt; drivers; ++i ) {
          SDL_GetRenderDriverInfo( i, driverInfo );
          string driverName = driverInfo-&gt;name;
          if ( i == drivers - 1 ) {
              availableDrivers += driverName;
          }
          else {
              availableDrivers += driverName + ", ";
          }
      }
      availableDrivers += ")";
      string path = SDL_GetBasePath();
      SDL_Surface *surfRed = IMG_Load( (path + "\\Red.png").c_str() );
      SDL_Texture *textRed = SDL_CreateTextureFromSurface( renderer, surfRed );
      SDL_FreeSurface( surfRed );
      SDL_Surface *surfBlue = IMG_Load( ( path + "\\Blue.png" ).c_str() );
      SDL_Texture *textBlue = SDL_CreateTextureFromSurface( renderer, surfBlue );
      SDL_FreeSurface( surfBlue );
      SDL_Rect destRed, destBlue;
      destRed.x = 128;
      destRed.y = 128;
      destBlue.x = 196;
      destBlue.y = 196;
      SDL_QueryTexture( textRed, NULL, NULL, &amp;destRed.w, &amp;destRed.h );
      SDL_QueryTexture( textBlue, NULL, NULL, &amp;destBlue.w, &amp;destBlue.h );
      SDL_BlendMode blendMode = SDL_ComposeCustomBlendMode( SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_MAXIMUM,
          SDL_BLENDFACTOR_ONE, SDL_BLENDFACTOR_ONE, SDL_BLENDOPERATION_MAXIMUM );         
      SDL_SetTextureBlendMode( textRed, blendMode );
      SDL_SetTextureBlendMode( textBlue, blendMode );
  //  SDL_SetRenderDrawBlendMode( renderer, blendMode );
      string info = rendererInfo-&gt;name + availableDrivers + " " + SDL_GetError();
      SDL_SetWindowTitle( window, info.c_str() );
      SDL_SetRenderDrawColor( renderer, 0, 0, 0, 255 );
      SDL_Event event;
      bool isRunning = true;
      while ( isRunning ) {
          if ( SDL_PollEvent( &amp;event ) ) {
              if ( event.type == SDL_QUIT ) {
                  isRunning = false;
              }
          }
          SDL_RenderClear( renderer );
          SDL_RenderCopy( renderer, textRed, NULL, &amp;destRed );
          SDL_RenderCopy( renderer, textBlue, NULL, &amp;destBlue );
          SDL_RenderPresent( renderer );
      }
      delete driverInfo;
      delete rendererInfo;
      SDL_DestroyTexture( textRed );
      SDL_DestroyTexture( textBlue );
      SDL_DestroyRenderer( renderer );
      SDL_DestroyWindow( window );
      IMG_Quit();
      SDL_Quit();
      return 0;
  }
  </code></pre>
  
  <p>Window title is "direct3d (direct3d, opengl, opengles2, software) This operration is not supported". It works fine when I change to SDL_BLENDOPERATION_ADD, but it's not what I want. If I uncomment renderer blend mode it doesn't help too.</p>