Ah, yes. that would do it. I am not creating a graphics context at all, just
using the code I showed above.  I can do that (all though it seems
unfortunate.)  Is there a utility already in OSG that provides this
functionality?
Thanks,
-- Rick

On Wed, Mar 19, 2008 at 3:33 PM, Robert Osfield <[EMAIL PROTECTED]>
wrote:

> HI Rick,
>
> The scale image function uses glu which requires a valid graphics
> context to be current in the thread you are calling from.  Could this
> be the problem?
>
> Robert.
>
> On Wed, Mar 19, 2008 at 6:41 PM,  <[EMAIL PROTECTED]> wrote:
> > Hello All,
> >
> > I wrote a little application that simply takes as a command line param
> the
> > name of an image, a new res, and a new filename.  The program then reads
> in
> > the image with osgDB, resizes it, then writes it back out with osgDB.
>  (Now
> > that I think of it, is there already a quick utility to do this?)
> >
> > Anyway, I keep getting and error from the resize that says "out of
> memory".
> > My original image is 2048^2.  The resized image is 1024^2.  The code
> (w/o
> > error handling) looks like:
> >
> >
> >
> >
> >
> > osg::ref_ptr<osg::Image> image = osgDB::readImageFile(argv[1]);
> >
> > int newRes = atoi(argv[2]);
> >
> > image->scaleImage(newRes, newRes, image->r());
> >
> > osgDB::writeImageFile(*(image.get()), argv[3]);
> >
> >
> >
> >
> >
> > Am I doing something wrong?  Is there another utility to do this?
> >
> > Thanks
> >
> > --Rick
> > _______________________________________________
> >  osg-users mailing list
> >  [email protected]
> >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> >
> >
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
Check us out at http://fringe-online.com/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to