Karl
Karl

Reputation: 1153

Creating an SDL2 window in C via Python3 ctypes

I want to create a small application using Python 3.3 and ctypes, in which the graphics and some other low level operations are done in a C shared library. I have some SDL2 code to create a simple window that works fine when run as a standalone executable, but not when called via ctypes as a shared library.

SDL doesn't produce any errors when called via ctypes, but the window is simply never displayed. I have to imagine this has something to do with threads or spawning processes, but searching hasn't netted me any results.

Upvotes: 0

Views: 629

Answers (1)

user2590587
user2590587

Reputation: 11

Your ctypes bindings might be wrong. Did you make sure that they correctly wrap the required functions of yours?

http://bitbucket.org/marcusva/py-sdl2 seems to contain ctypes-wrappers for SDL2, which you might use as reference for your own code.

Upvotes: 1

Related Questions