Thanks for the response Robert. So what is going on is I am trying to incorporate CEGUI into OpenSceneGraph. So CEGUI is a GUI system that is meant to be used as a menu system that is always displayed 2d on the screen and not embedded in 3d space. What I am trying to do is utilize CEGUI's tools for quickly creating a functional GUI. The original example I found was in the OSG 3 cookbook, and for my application I want to be able to embed it in 3d space and have the user be able to interact with it.
So what I have accomplished so far is used an osg::Drawable to give CEGUI a context to render and then CEGUI provides a function to return its OpenGL textureId which I then was able to just use glBindTexture with that and do basic texture mapping to a quad using OpenGL calls. I was then able to setup the GUI to dymically update as well as follow me through the scene. But, I would now like to be able to actually use OpenSceneGraph's osg::Geometry to draw this quad. To do this texture mapping, I am just following the example in the OSG 3.0 beginner's guide, with the image coming from the Drawable that is holding all the CEGUI stuff.
So what I have is an OpenGL texture Id to work with, and I need use that to map that texture to a quad. I know my texture mapping is correct as I have just tried loading an image with osgDB and mapping that, and that works. But when I am trying to grab the image from my drawable, what gets mapped to the quad is the last texture that was used. I have tried using Image::setImage as well as Image::readImageFromCurrentTexture after calling glBindTexture, but neither have worked for me.
tl;dr, given an OpenGL texture ID, how can I map the texture associated with that ID to a quad using osg::Geometry?