Mike Greene wrote:
I have an example snippet that reads a jpeg image from a file and uses
it as a texture:
osg::Image* klnFace = osgDB::readImageFile("image2.jpg");
KLN89FaceTexture->setImage(klnFace);
How can I use an existing memory image of a jpeg (i.e., not have to
access the hardrive) to accomplish the same task?
i.e., something like:
osg::Image* klnFace = osgDB::readImageMemory(buffer);
KLN89FaceTexture->setImage(klnFace);
I'm not 100% sure, but I think I recall Farshid Lashkari rewrote many of the image
loader plugins a while ago to read from streams, allowing one to feed them with a custom
stream handler. I haven't done this myself, but perhaps it gives you enough to get going on.
Mike Greene
--
Chris 'Xenon' Hanson aka Eric Hammil | http://www.3DNature.com/ eric at logrus
"I set the wheels in motion, turn up all the machines, activate the programs,
and run behind the scenes. I set the clouds in motion, turn up light and
sound,
activate the window, and watch the world go 'round." -Prime Mover, Rush.
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/