I'm writing a geometry drawing tool in pySDL2 with as little reliance on other libraries as possible. I'm trying to use the built-in primitive drawing functions to achieve this, but I'm running into strange behavior when the input values grow to a certain size. For circleColor(), at least, it looks like a radius of 1024 seems to be the point where things get weird.
For example,
import sys
import sdl2
import sdl2.sdlgfx
import sdl2.ext
def run():
sdl2.ext.init()
window = sdl2.ext.Window("circle test", size=(1700, 900))
window.show()
if "-hardware" in sys.argv:
renderflags = sdl2.render.SDL_RENDERER_ACCELERATED | sdl2.render.SDL_RENDERER_PRESENTVSYNC
else:
renderflags = sdl2.render.SDL_RENDERER_SOFTWARE
context = sdl2.ext.Renderer(window, flags=renderflags)
color = 0xFFFFFFFF
x, y = -400, 450
r = 1023
sdl2.sdlgfx.circleColor(context.sdlrenderer, x, y, r, color)
x, y = 0, 450
r = 1024
sdl2.sdlgfx.circleColor(context.sdlrenderer, x, y, r, color)
context.present()
running = True
while running:
events = sdl2.ext.get_events()
for event in events:
if event.type == sdl2.SDL_QUIT:
running = False
break
sdl2.ext.quit()
return 0
if __name__ == "__main__":
sys.exit(run())
Anyone know what could be the cause?