On Fri, Aug 21, 2009 at 04:10:03AM +0000, Gillian wrote: > Just wondering how textures are loaded in an AGAR OpenGL widget. When I > create a > new texture, nothing goes wrong. But in my rendering function, when I bind my > texture, the AGAR toolbar I've created doesn't render correctly, and renders > black instead of grey. I am using AG_SurfaceTexture to get my texture ID, so > it > shouldn't conflict right?
AG_SurfaceTexture() is a low-level function used mostly internally. The function you would normally use to create a new texture associated with a widget is AG_WidgetMapSurface(), which returns a surface handle. This handle is an index into the surfaces[], textures[] and texcoords[] arrays of AG_Widget. If you're doing some custom OpenGL rendering code and you want to bind to the texture, you can retrieve the GL texture ID from textures[], but typically you would just pass it as an argument to AG_WidgetBlitSurface(), as documented in: http://libagar.org/man3/AG_Widget#BLITTING_SURFACES _______________________________________________ Agar mailing list [email protected] http://libagar.org/lists.html
