python: Tell swig how to index per-rendertarget blend state.
authorJosé Fonseca <jfonseca@vmware.com>
Sun, 14 Feb 2010 12:06:37 +0000 (12:06 +0000)
committerJosé Fonseca <jfonseca@vmware.com>
Sun, 14 Feb 2010 12:06:37 +0000 (12:06 +0000)
src/gallium/state_trackers/python/p_state.i

index 90f157e0ab0adcc24e2a5259974f8be478d35065..318fe1c46373e3fc7917c82919110414b8a9d2ff 100644 (file)
 %array_class(struct pipe_stencil_state, StencilArray);
 
 
+%extend pipe_rt_blend_state
+{
+   struct pipe_rt_blend_state *
+   __getitem__(int index) 
+   {
+      if(index < 0 || index >= PIPE_MAX_COLOR_BUFS)
+         SWIG_exception(SWIG_ValueError, "index out of bounds");
+      return $self + index;
+   fail:
+      return NULL;
+   };
+};
+
+
 %extend pipe_framebuffer_state {
    
    pipe_framebuffer_state(void) {