diff options
author | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-07-26 22:05:24 -0700 |
---|---|---|
committer | Corbin Simpson <MostAwesomeDude@gmail.com> | 2010-07-26 22:05:24 -0700 |
commit | 1f473294b58f3dcf79f1a943976aad81ad561092 (patch) | |
tree | 3e0d7c9f848582ecf3e6232c5243d65c668cae3f | |
parent | e7fcd759f33c9f5c63d39b7fa7eef9ebfa77e820 (diff) |
Start Context.
-rw-r--r-- | pylladium.pyx | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/pylladium.pyx b/pylladium.pyx index ad1c784..4b30e70 100644 --- a/pylladium.pyx +++ b/pylladium.pyx @@ -94,12 +94,28 @@ cdef class Screen: return self.screen.get_vendor(self.screen) def is_format_supported(self, format, target, bindings, geom_flags): - return bool(self.screen.is_format_supported(self.screen, - format, target, bindings.value, geom_flags.value)) + return self.screen.is_format_supported(self.screen, + format, target, bindings.value, geom_flags.value) -class pipe_context(Structure): - pass +cdef extern from "gallium/pipe/p_context.h": + cdef struct pipe_context: + # ... + void destroy(pipe_context*) + # ... + +cdef class Context: + cdef pipe_context *context + def __init__(self, int context): + self.context = <pipe_context*>context + + def __del__(self): + self.destroy() + + def destroy(self): + self.context.destroy(self.context) + +""" pipe_context._fields_ = [ ("winsys", c_void_p), ("screen", c_void_p), @@ -195,6 +211,7 @@ pipe_context._fields_ = [ ("transfer_unmap", c_void_p), ("transfer_inline_write", c_void_p), ] +""" def parse_enums(f): handle = open(f, "r") |