withRenderer :: (SDL.Renderer -> IO ()) -> SDL.Window -> IO ()
withRenderer operation window = do
    _ <- setHint "SDL_RENDER_SCALE_QUALITY" "1" >>= logWarning
    renderer <- createRenderer window (-1) [SDL.SDL_RENDERER_ACCELERATED] >>= either throwSDLError return
    operation renderer
    SDL.destroyRenderer renderer
withRenderer :: (SDL.Renderer -> IO ()) -> SDL.Window -> IO ()
withRenderer operation window = do
    _ <- setHint "SDL_RENDER_SCALE_QUALITY" "1" >>= logWarning
    renderer <- createRenderer window (-1) [SDL.SDL_RENDERER_ACCELERATED] >>= either throwSDLError return
    operation renderer
    SDL.destroyRenderer renderer
withRenderer operation window = do
    _ <- setHint "SDL_RENDER_SCALE_QUALITY" "1" >>= logWarning
    renderer <- createRenderer window (-1) [SDL.SDL_RENDERER_ACCELERATED] >>= either throwSDLError return
    operation renderer
    SDL.destroyRenderer renderer