This is my first time writing, so I apologize in advance for possible errors, repetitions or incorrect formatting....
First of all, using JOGL I created a texture and loaded it inside an OpenGL context.
So, I passed the context id and the texture id to OSG.
osg::ref_ptr<osg::Texture2D> texture = new osg::Texture2D();
osg::ref_ptr<osg::Texture::TextureObject> textureObject = new osg::Texture::TextureObject(texture.get(), (GLuint)handle, GL_TEXTURE_2D);
textureObject->setAllocated(true);
texture->setTextureObject(ID, textureObject.get());
So, first of all I thought the right thing was: take the handle of the OpenGL context and from that, get the texture knowing its ID.
The problem is that, if I print the size of the texture, this is zero. Knowing the size of the texture (Java side), which means that the procedure is not correct.
Can you tell me what is the correct procedure to take the texture knowing the OpenGL context id?