Here is the tutorial in question: Lazy Foo' Productions - Color Keying
A renderer is created at one point and is set to NULL, this renderer is later passed as an arguement to the SDL_CreateSurfaceFromTexture function. At this point isn’t the created renderer still of NULL value?
newTexture = SDL_CreateTextureFromSurface( gRenderer, loadedSurface );
When I try this in my own code it does not work, I need to first create the renderer using SDL_CreateRenderer.
This is what I did, I put this line of code before the previous one and it works. However it only works when a single texture is loaded, when I try loading multiple textures with this method as the tutorial does it no longer works, which I guess has something to do with the renderer being ‘created’ again.
mainRenderer = SDL_CreateRenderer(mainWindow, -1, 0);
Apolagies as my problem might not be very clear from reading this, I would be happy to elaborate.