SDL_gfx
SDL_gfx copied to clipboard
Unnecesary call to SDL_RenderPresent() in texturedPolygonMT()
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.
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.
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().