[osg-users] Texturing with GLBeginEndAdapter

Aaron Andersen aaron at fosslib.net
Wed Dec 28 15:32:01 PST 2016


Hello,

There is some code in a library which I want to adapt for OSG. The  
code is pretty old and uses the old style OpenGL. I don't have the  
time it would take to rewrite this code so I would like to use the  
GLBeginEndAdapter to make this code work with OSG.

Looking at the GLBeginEndAdapter there isn't much documentation so I  
was hoping someone could help me out. Please keep in mind my OpenGL  
skills are lacking (which I why enjoy using a rendering engine like  
OSG :-).

I've created a subclass to the Drawable class called "MyDrawable". In  
the drawImplementation function I'm have a couple  
gl.Begin(GL_QUADS)/gl.End() calls to draw 3 simple rectangles. I'm  
unsure of how to apply 3 separate textures to these 3 rectangles. From  
reading the ShapeDrawable class it looks like the state of the  
Drawable applies the texture to everything you draw.

So how can I apply many different textures to my drawing, with 1  
texture per shape I draw with GL_QUADS?

Thank you for any insight you can provide.
Aaron





More information about the osg-users mailing list