Open AltairPL opened 6 years ago
try GPU_FlushBlitBuffer()
after each single SDL_gpu
call
Tried both GPU_FlushBlitBuffer()
and GPU_Flip(target)
and it didn't solve the problem.
It's possible that the image in the middle was a result of either of them, but I can't check it out at the moment.
It is really hard to guess without a code simple
Heh, my code is all but simple, since I'm a noob at C and since functions I use are representation of Ruby methods. In a nutshell:
GPU_TriangleBatch()
internallyGPU_BlitRect()
internally, and in this particular case, blit target
is the target
of blit source image
.Using second image
for GPU_TriangleBatch()
and then blitting from it to the desired target
works.
Hope my explanations are good enough... I know I suck at explaining things in English.
Anyway, will try to make a simple project that can reproduce this behavior, but I'm kinda tied up at the moment.
Bummer, did a simple program to attempt to reproduce the issue, but it's working just fine. It would suggest that something I did is at fault, but why was it working as expected in (much) earlier version of SDL_gpu? Gonna leave this issue open in hopes that @grimfang4 will be able to shed some light on it. And in the meantime I still need to get over whole code of my game/engine, so maybe I'll find the cause. Anyway, thanks for trying to help @dhiahassen - much appreciated.
I'm not positive. If you can reproduce it, let's follow up.
Not sure if this is a bug or not, but since it was working in SDL_gpu some months ago, I'm posting this just in case. My usage case is probably borderline, because I need to retain compatibility with old engine (non SDL/SDL_gpu), but I think it could happen in more common uses as well. Anyway, I need to draw something on an image (first gauge line on example images) and then immediately blit it to other parts of the image (remaining gauge lines on example images). It works as intended in both old engine and older version of SDL_gpu, but in current SDL_gpu version, some blits are performed before the draw that should be first, which results in parts of the image retaining previous state.
Example images: should be: is (or rather was, since I only get next one now): is:
The only working workaround is to use separate image to draw the first line and then blit it to desired target image.
Please, let me know if you need any more info.