where texturedata is NULL, hence the SIGSEGV. The code could easily test texturedata but it’s in a void function SetCopyState() so there’s no easy way to return ‘fail’, and anyway it’s quite deep in the call stack:
Why would rotation between portrait and landscape affect texture creation? And why is a texture being created anyway (my code doesn’t recreate the target texture unless a SDL_RENDER_TARGETS_RESET event is received, which shouldn’t happen as a result of rotation).
even if it works, it doesn’t seem correct …
it strange that the Texturedata is null…
I would log the texture create/destroy (SDL_render_gles.c)
maybe it needs a flush renderer…
because setcopystate seems to execute a command from an old destroyed texture
But what texture is being created/destroyed? Evidently it’s not my render target texture, because if that was destroyed, or not created correctly, my app wouldn’t work (most likely I’d get a black screen) and that would be obvious.
I also note that in GLES_SetRenderTarget()texturedata is dereferenced, so it’s obviously not NULL at that point:
The change you are suggesting I make is in GLES_CreateTexture(). I am not creating any textures in my app around the time that the crash occurs, I am simply using the render target texture that was created when the app was started.
I can’t see how any changes to CreateTexture() could be helpful, unless textures are being created ‘behind the scenes’, which I wouldn’t have expected.
actually, something similar is applied also for gles1…
but the patch looks differents in behavior
see the texture/texturing compared to the other patch
there may be some texture creation underneath ? maybe a reference to a very old texture deleted,
you can also trace all “cmd” the renderer use to see what get pushed …