SDL_gfx icon indicating copy to clipboard operation
SDL_gfx copied to clipboard

Unnecesary call to SDL_RenderPresent() in texturedPolygonMT()

Open alicja-januszkiewicz opened this issue 5 years ago • 2 comments

Hi. I'm unsure if this is an issue or if I'm using it wrong, but there is a call to SDL_RenderPresent() at the end of texturedPolygonMT() (gfxPrimitives, latest Feb 2017 release). This makes it impossible to use, as the renderer will render the polygons drawn with this function one by one, rather than rendering the whole frame at once.

alicja-januszkiewicz avatar May 03 '20 06:05 alicja-januszkiewicz

Are you referring to line 3190 if the current SDL2_gfx codebase (https://sourceforge.net/p/sdl2gfx/code/HEAD/tree/trunk/SDL2_gfxPrimitives.c)? If so, I suspect this is by design as to force the textureAsTexture rendering to occur. This function was merely provided for backwards compatibility - not for anything performant.

ferzkopp avatar May 04 '20 22:05 ferzkopp

Yes, I meant the line 3190. I thought the actual rendering occurs in a call to _HLineTextured() at line 3186, which makes the SDL_RenderCopy() calls, and line 3190 just updates the screen? My issue is, this screen update call makes it so you can't use texturedPolygonMT() more than once per frame, and so I was wondering if you could possibly remove it? This would make it behave the same way as filledPolygonRGBAMT().

alicja-januszkiewicz avatar May 05 '20 01:05 alicja-januszkiewicz