On Tue, 2013-12-10 at 21:22 +0100, tomw wrote:
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?
It's a bug, and I just pushed a fix. Thanks for reporting it, but in the future please submit bug reports to https://bugzilla.gnome.org/browse.cgi?product=vala -Evan
Attachment:
signature.asc
Description: This is a digitally signed message part