include/SDL_hints.h
branchSDL-ryan-batching-renderer
changeset 12211 0d8f33ad5fbb
parent 12163 dd056c76593a
child 12381 dc9108cd4340
     1.1 --- a/include/SDL_hints.h	Thu Sep 20 15:41:57 2018 -0400
     1.2 +++ b/include/SDL_hints.h	Thu Sep 20 15:46:02 2018 -0400
     1.3 @@ -1030,6 +1030,31 @@
     1.4  #define SDL_HINT_AUDIO_CATEGORY   "SDL_AUDIO_CATEGORY"
     1.5  
     1.6  /**
     1.7 + *  \brief  A variable controlling whether the 2D render API is compatible or efficient.
     1.8 + *
     1.9 + *  This variable can be set to the following values:
    1.10 + *
    1.11 + *    "0"     - Don't use batching to make rendering more efficient.
    1.12 + *    "1"     - Use batching, but might cause problems if app makes its own direct OpenGL calls.
    1.13 + *
    1.14 + *  Up to SDL 2.0.9, the render API would draw immediately when requested. Now
    1.15 + *  it batches up draw requests and sends them all to the GPU only when forced
    1.16 + *  to (during SDL_RenderPresent, when changing render targets, by updating a
    1.17 + *  texture that the batch needs, etc). This is significantly more efficient,
    1.18 + *  but it can cause problems for apps that expect to render on top of the
    1.19 + *  render API's output. As such, SDL will disable batching if a specific
    1.20 + *  render backend is requested (since this might indicate that the app is
    1.21 + *  planning to use the underlying graphics API directly). This hint can
    1.22 + *  be used to explicitly request batching in this instance. It is a contract
    1.23 + *  that you will either never use the underlying graphics API directly, or
    1.24 + *  if you do, you will call SDL_RenderFlush() before you do so any current
    1.25 + *  batch goes to the GPU before your work begins. Not following this contract
    1.26 + *  will result in undefined behavior.
    1.27 + */
    1.28 +#define SDL_HINT_RENDER_BATCHING  "SDL_RENDER_BATCHING"
    1.29 +
    1.30 +
    1.31 +/**
    1.32   *  \brief  An enumeration of hint priorities
    1.33   */
    1.34  typedef enum