Re: [racket] Creating OpenGL textures from bitmaps

2012-03-28 Thread Tomi Neste
On Wed, Mar 28, 2012 at 3:15 AM, Matthew Flatt 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

Re: [racket] Creating OpenGL textures from bitmaps

2012-03-27 Thread Matthew Flatt
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 `ma

Re: [racket] Creating OpenGL textures from bitmaps

2012-03-27 Thread Stephan Houben
Hi Michael, Tomi, The ARGB order is what most hardware uses internally anyway. Therefore, modern wisdom is not to convert to rgba but rather use texture modes GL_BGRA with GL_UNSIGNED_INT_8_8_8_8_REV. But in my experience that turns out not to work on some implementations, even ones which adve

Re: [racket] Creating OpenGL textures from bitmaps

2012-03-26 Thread Michael W
I'd also love to know if there's a better way. A bitmap%->opengl-tex-handle function would be absolutely scrumptious. Part of the reason seems to be that Racket stores images as ARGB bytes, but OpenGL doesn't support that, hence the need for all the byte swizzling. For what it's worth, I have som