[osg-users] See images

Brian bpdavis at knology.net
Thu Jan 3 10:26:59 PST 2008


Is your image returning a valid pointer?  If not, then either the TIFF file is corrupt, or your application cannot find the necessary plugin (osgdb_tiff.dll or osgdb_tiffd.dll) to read the format.  An easy way to test is to rewrite your code slightly. 


osg::ref_ptr<osg::Image> image = osgDB::readImageFile("porton.tif");
osg::ref_ptr<osg::Texture2D> tex;

if (image != NULL)
{
  tex = new osg::Texture2D;
  tex->setImage(image.get());
}
else
{
  // handle error condition
}



-Brian

----- Original Message ----- 
From: Pedro José Muñoz Martínez 
To: osg-users at lists.openscenegraph.org 
Sent: Thursday, January 03, 2008 1:37 AM
Subject: [osg-users] See images


Thanks Brian,
You were rigth. I am using a guide to introduce in OSG, and trying 

osg::ref_ptr<osg::Image> image = osgDB::readImageFile("porton.tif");
    osg::ref_ptr<osg::Texture2D> tex = new osg::Texture2D;
    tex->setImage(image.get());


I can´t see the image. What else I need to see the image?
Thanks in advance




-- 
I am using the free version of SPAMfighter for private users.
It has removed 428 spam emails to date.
Paying users do not have this message in their emails.
Get the free SPAMfighter here: http://www.spamfighter.com/len
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20080103/c1cd96da/attachment.htm 


More information about the osg-users mailing list