This is very strange. With SDL 2.0.4 and GLES 1 (Android), calling SDL_CreateTextureFromSurface breaks a subsequent SDL_RenderFillRect, despite the two calls being entirely unrelated - except for using the same renderer. To give a specific example, this code works correctly (it fills the render target with blue):
Code:
SDL_SetRenderDrawColor(myRenderer, 0, 0, 255, 255) ;
SDL_RenderFillRect(myRenderer, NULL) ;
But this code doesn’t work; the render target is not filled with blue (despite neither mySurface nor myTexture being used anywhere):
Code:
mySurface = SDL_CreateRGBSurface(SDL_SWSURFACE, 8, 8, 32,
0xFF000000, 0x00FF0000, 0x0000FF00, 0x000000FF) ;
myTexture = SDL_CreateTextureFromSurface(myRenderer, mySurface) ;
SDL_SetRenderDrawColor(myRenderer, 0, 0, 255, 255) ;
SDL_RenderFillRect(myRenderer, NULL) ;
I presume there must be some leakage of renderer state that is causing the two nominally unrelated calls to interact.
Can anybody suggest where I might look in the code of SDL to try to trace this bug? I’ve created a self-contained testcase which I can upload if anybody is interested. I have explained in earlier threads why I cannot use GLES 2, so please don’t suggest that as a solution.
Richard.