[racket] Creating OpenGL textures from bitmaps

From: Tomi Neste (tomi.neste at gmail.com)
Date: Wed Mar 28 09:57:00 EDT 2012

On Wed, Mar 28, 2012 at 3:15 AM, Matthew Flatt <mflatt at cs.utah.edu> wrote:
> At Mon, 26 Mar 2012 17:23:51 +0300, Tomi Neste wrote:
>> So, is there a way to get a foreign pointer to the bitmap data
>
> As of the latest in the git repo, `bitmap%' has a `get-handle' method'.
> The result is a cpointer for a Cairo surface: a `cairo_surface_t'. In
> the case of a bitmap created with `make-bitmap', the handle
> specifically refers to an image surface, so you could use
> cairo_image_surface_get_data() to get the image's raw bytes; I think
> it's BGRA on a little-endian machine and ARGB on a big-endian machine.
>

Great! That's just what I needed.

-- 
tomppa

Posted on the users mailing list.