I have an initialized renderer in SDL2 that works fine.
I create some textures from images using
SDL_CreateTextureFromSurface and store them in a vector.
Afterwards, I create an empty texture so as to render to it a background texture and some text:
SDL_Texture * container = SDL_CreateTexture(Renderer,SDL_PIXELFORMAT_RGBA8888,SDL_TEXTUREACCESS_TARGET,size.first,size.second);
The problem is that the returned memory address in
container is the address of the first texture that was created with renderer as shown in the image below.
Textures is a vector< SDL_Texture * > ,
container is the pointer above.
textures field is a field in the renderer thatI presume is set to the address of the last texture created. Before running the command above, it pointed to the last texture created (
After the call, the texture in the vector is of course overwritten, which is a problem. There are no errors from SDL_GetError().
What's going on?