[Gambas-user] gb3: gb.opengl, how to bind a texture

Kevin Fishburne kevinfishburne at ...1887...
Fri Jul 29 05:12:03 CEST 2011


I'm using gb.sdl and gb.opengl. I load an image into RAM like this:

Public tTest As Image
tTest = Image.Load("test.png")

and want to upload it to video memory with this:

Gl.BindTexture(Gl.GL_TEXTURE_2D, id)

How do I obtain an ID (id) from the image loaded in RAM? From what I've 
read, you need to load the image as an SDL surface, then use a property 
of that surface to obtain the "handle" which is then passed to OpenGL 
via BindTexture. I don't think the current SDL implementation supports 
creating surfaces, and other than a pointer (tTest.Data) there appears 
to be no property that returns the number required byBindTexture.

So far the OpenGl tutorials I've been reading are pretty 
straightforward, but I can't get past this. tommyline, if you're out 
there please hook me up with your example apps which are dead on 
whiteislandsoftware.com. :/

-- 
Kevin Fishburne
Eight Virtues
www: http://sales.eightvirtues.com
e-mail: sales at ...1887...
phone: (770) 853-6271





More information about the User mailing list