title: How to use SDL_CreateTexture
body: <p><strong>I would like to know ho to use <a href="https://wiki.libsdl.org/SDL_CreateTexture?highlight=%28%5CbCategoryAPI%5Cb%29%7C%28SDLFunctionTemplate%29" rel="noreferrer">SDL_CreateTexture</a> function.</strong> <br>
  I just want to create texture, give it a color and draw it somewhere on the screen. I dont wanna load any picture into it.<br>
  I thought I can use <code>SDL_CreateTexture, SDL_SetTextureColorMod, SDL_RenderCopy, SDL_RenderPresent</code> in that order, but <strong>I always get just a black rectangle instead of red one</strong>.<br><br></p>
  
  <pre><code>#include &lt;SDL.h&gt;
  
  int main(int argc, char* argv[]) {
  
      SDL_Init(SDL_INIT_EVERYTHING);
  
      SDL_Window *MainWindow = SDL_CreateWindow("My Game Window",
                                    SDL_WINDOWPOS_CENTERED,
                                    SDL_WINDOWPOS_CENTERED,
                                    1024, 768,
                                    SDL_WINDOW_SHOWN
                                    );
  
      SDL_Renderer *renderer = SDL_CreateRenderer(MainWindow, -1, 0);
  
      SDL_SetRenderDrawColor(renderer, 255, 255, 255, 255);
  
      SDL_RenderClear(renderer);
  
  
      SDL_Texture *Tile = SDL_CreateTexture(renderer,SDL_PIXELFORMAT_RGBA8888,SDL_TEXTUREACCESS_TARGET,8,8);
  
      //I want my texture to be red
      SDL_SetTextureColorMod(Tile,255,0,0);
  
      //I just try this i dont know if I have to do that
      SDL_SetTextureAlphaMod(Tile,255);
  
      SDL_Rect destination = {320,240,8,8};
      SDL_RenderCopy(renderer,Tile,NULL,&amp;destination);
      SDL_RenderPresent(renderer);
      SDL_Delay(3000);
  
      //Clean up
      SDL_DestroyTexture(Tile);
      SDL_DestroyWindow(MainWindow);
      SDL_Quit();
  
      return 0;
  }
  </code></pre>
  
  <p><br>
  I also dont know if I am using right format (<a href="https://wiki.libsdl.org/SDL_PixelFormatEnum" rel="noreferrer">SDL_PixelFormatEnum</a>) value in SDL_CreateTexture. There is a lot of them and I dont understand what they mean. <strong>Which one can I use form this purpose?</strong> </p>