Hello

I have several SVG images which I want to use as textures in my application 
which uses both Qt and OpenSceneGraph. I want to do it using QSvgRenderer on 
QGLFramebufferObject. It allows to render SVG image directly on FBO and then 
use rendered image as texture like this:

QGLFramebufferObject * fbo = new QGLFramebufferObject(width, height);
QSvgRenderer renderer(QString("texture.svg"));
QPainter painter(fbo);
renderer.render(&painter);

After that I can use fbo->texture() to get OpenGL texture id and everything 
works perfectly in a simple test project (Qt + raw OpenGL). However I can't 
find any way to use this texture id with existing OSG classes.

I've googled for the ability to use existing OpenGL textures with OSG and 
looked breifly through the code of the osg::Texture and osg::Texture2D and it 
looks like I have to create a class derived from the osg::Texture which will 
wrap external texture. Is it the right way? Are there any good articles how to 
create your own texture class?

Sergey Vidyuk

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to