1. Python CFFI
  2. Untitled project
  3. cffi
  4. Issues
Issue #23 resolved

Unable to create bindings to SDL Events

Leonard Ritter
created an issue

CFFI's current limitation of not being able to pass unions as arguments to functions makes it impossible to create bindings for SDL. A core aspect of the library is event handling, and its absence renders SDL worthless.

See here for the offending headers: http://www.libsdl.org/tmp/SDL-1.3-docs/SDL__events_8h-source.html

the union in question is SDL_Event, which is passed to a handful of core functions, of which SDL_PollEvent() is the most important one, because it is needed to write message loops (see http://www.cs.clemson.edu/~malloy/courses/3dgames-2007/tutor/web/sdl_setup/sdl_setup.html for an example).

the exception is raised during verify(), and reads as such:


File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/api.py", line 269, in verify return self.verifier.load_library() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/verifier.py", line 55, in load_library self.compile_module() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/verifier.py", line 42, in compile_module self._write_source() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/verifier.py", line 95, in _write_source self._vengine.write_source_to_f() File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/vengine_gen.py", line 35, in write_source_to_f self._generate('decl') File "/home/lritter/devel/pypy/site-packages/cffi-0.3-py2.7.egg/cffi/vengine_gen.py", line 70, in _generate "not implemented in verify(): %r" % name) VerificationError: not implemented in verify(): 'union SDL_Event' }}}

Comments (2)

  1. Log in to comment