title: SDL: Fullscreen translucent background
body: <p>I'm trying to write a program that has a translucent background covering the whole screen. After some research it appeared that SDL would be the way to go.</p>
  
  <p>I've written the code to create a full screen window with a background whose alpha is equal to 100 (out of 255), but for some reason it just draws the solid colour. What have I done wrong?</p>
  
  <pre><code>// Initialise SDL
  if (SDL_Init(SDL_INIT_EVERYTHING) != 0) {
          this-&gt;throwSDLError("SDL_Init Error");
  }
  
  // Create the window and renderer
  if (SDL_CreateWindowAndRenderer(0, 0, SDL_WINDOW_FULLSCREEN_DESKTOP, &amp;(this-&gt;window), &amp;(this-&gt;renderer)) != 0) {
          this-&gt;throwSDLError("Could not create the window and renderer");
  }
  
  // Set the blend mode to specify how the alpha channel is used
  if (SDL_SetRenderDrawBlendMode(this-&gt;renderer, SDL_BLENDMODE_BLEND) != 0) {
          this-&gt;throwSDLError("Could not set render draw blend mode");
  }
  
  // Set the colour to draw
  if (SDL_SetRenderDrawColor(this-&gt;renderer, 200, 200, 200, 100) != 0) {
          this-&gt;throwSDLError("Could not set the drawing colour");
  }
  
  // Clear the screen using the colour
  if (SDL_RenderClear(this-&gt;renderer) != 0) {
          this-&gt;throwSDLError("Could not render the screen");
  }
  
  // Present the rendered screen
  SDL_RenderPresent(this-&gt;renderer);
  </code></pre>