Trying to create an SDL texture, just get blank screen

Btw, I now realize that you’re attempting to execute SDL-specific functions before SDL is initialized. You need to initialize SDL before doing any SDL-specific operations and before executing any SDL-specific functions.

So my recommendation is that, at the startup of the program, create everything in the following order:

  1. Initialize SDL by exeuting SDL_Init();
  2. Create the SDL window by executing SDL_CreateWindow();
  3. Create the SDL renderer by executing SDL_CreateRenderer();
  4. Create the texture(s) and other data.

Don’t forget to do error checking when creating stuff. SDL_GetError(); will help you a lot.

Note: when pasting code into a post here on the forum, you need to highlight all your code and then embed it into a code block by pressing the </> button. By doing this, the whole code is embedded into a code block and will be much easier to read.