title: SDL2: Fast Pixel Manipulation
body: <p>I want to draw pixels on the monitor which change frequently after certain parameters. E.G. if a Red and Green Pixel collide, they would both vanish, etc.</p>
  
  <p>In every frame I have to manipulate about 100 - 1000 pixels. I have a multi-threaded approach here, which wont give me 30FPS (what I want). Currently I store a Pixel array in the RAM which contains all Pixels and have a <code>SDL_Surface</code>. When a pixel in the array changes, it gets changed in the Surface too and is then after all manipulation is done gets blitted to the screen. My current approach is too slow and I did a bit of thinking on how I could increase the Speed.</p>
  
  <p>My current thoughts are:</p>
  
  <ul>
  <li>Use OpenGL to do the pixel manipulation directly on the GPU, which some forums tells me that this is way slower than my current approach as "this is not how a GPU works"</li>
  <li>Don't store a pixel array, store a BMP in RAM directly, manipulate that and then move it to an <code>SDL_Surface</code> or <code>SDL_Texture</code></li>
  </ul>
  
  <p>Are there any other approaches on how I could manipulate Pixels in a fast manner?</p>