[Vala] Cogl binding bug?



Hi,

trying to use the Cogl.read_pixels to get a copy of the framebuffer 
like:

uint8 *data;
data = GLib.malloc (width * height * 4);
Cogl.read_pixels (0,
                  0,
                  width,                                     
                  height,                                    
                  Cogl.ReadPixelsFlags.BUFFER,               
                  Cogl.PixelFormat.ARGB_8888,                
                  (uchar) data);

I was runing into permanent segfaults due to out of bounds errors.
Looking into the vapi I realized, that the read_pixels method is stated
like this:

public static void read_pixels (int x, int y, int width, int height,
Cogl.ReadPixelsFlags source, Cogl.PixelFormat format, uchar pixels);

according to the C [1] documentation it should be rather:

public static void read_pixels (int x, int y, int width, int height,
Cogl.ReadPixelsFlags source, Cogl.PixelFormat format, uchar *pixels);

Is this a bug or am I missing something?

-- tomw

[1]
https://developer.gnome.org/cogl/stable/cogl-General-API.html#cogl-read-pixels
 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]