sdl2.ext.Renderer.fill() error when argument is an iterable(list)

Issue #52 resolved
Former user created an issue

OS: Windows Vista (64-bit) Python: Python 3.3 (32-bit)

Error when passing a list of tuples to the sdl2.ext.Renderer.fill() function, as descibed in the 0.9.0 documentation. Example: rectangles = [(100,100,50,50), (200,150, 50,50)] window_renderer = sdl2.ext.Renderer(window) window_renderer.fill(rectangles)

The error is: window_renderer.fill(rectangles) File "C:\Python33\lib\site-packages\sdl2\ext\", line 247, in fill ptr = cast(rlist, SDL_Rect) File "C:\Python33\lib\", line 490, return _cast(obj, obj, typ) OSError: exception: access violation reading 0x00000004

Also tried a tuple of tuples, like: rectangles = ((100,100,50,50), (200,150, 50,50)) but got the the same error.

The error is in "sdl2/ext/" line 247: ptr = cast(rlist, SDL_Rect) I didn't know you could actually write code so similar to C, like it is in the "else" branch of the "fill" function?

Passing only one tuple like "(100,100,50,50)" works and doesn't give this error.

If you need any more info, tell me. Matic

Comments (1)

  1. Marcus von Appen repo owner
    • fixed issue #52: pass the correct arguments to the internals of sdl2.ext.Renderer.fill(), sdl2.ext.Renderer.draw_rects() and sdl2.ext.Renderer.draw_points()

    → <<cset 4aab605c0465>>

  2. Log in to comment