Hi Robert,

If you haven't reviewed yet, I'll send another version very soon. Else I'll do 
it later.

Sukender
PVLE - Lightweight cross-platform game engine - http://pvle.sourceforge.net/

----- "Sukender" <[email protected]> a écrit :

> Hi Robert,
> 
> I've written the image proxy feature we discussed a few days ago.
> Basically, osg::Image now accepts a callback that is called every time
> we access members if "_data" pointer is NULL. A few notes:
> - Code (especially writers) should then call "Image::valid()" instead
> of "Image::data() != NULL" if they want to test emptyness: first one
> tests without doing proxy loading, whereas the second DOES proxy
> loading. And after all, it seems more logical to call the specific
> valid() method...
> - Model writers can write proxy images as if they were loaded by
> simply adding a osgDB::WriteFileCallback that uses
> Image::getFileName() (see attached code: EmptyImagesWriteFileCallback
> in ImageProxy_helpers.cpp), or by really loading them (slower of
> course).
> - You can easily deactivate the loading of images by providing a
> osgDB::ReadFileCallback (as before), as well as you can make images be
> loaded only when accessed (see attached code:
> NoTextureReadFileCallback and DelayedTextureReadFileCallback in
> ImageProxy_helpers.cpp).
> 
> I didn't write more than that. Especially I did not write anything
> that will tell the Texture if it should unref the image or not, since
> I'm not very sure the discussed proposal is clean enough. This could
> (and will certainly) be done later. Of course if a texture unrefs its
> image, then you'll loose the whole image data, its filename and its
> callback. You then won't be able to write the texture as expected when
> exporting the scene, except if you create a new Image and get data
> back into it.
> 
> Also included in this submission are 2 minor MSVC9 warning fixes, and
> a minor fix for 3DS plugin (it added useless intermediate groups). I
> don't 3DS fix as a separate patch because I've got modifications
> caused by the image proxy (I removed useless code about "noTexture"
> option).
> 
> The "ImageProxy_helpers.cpp" file contains code that may be useful in
> osgDB... Feel free to include it (somewhere in OSG) or not.
> Code is against trunk rev. 10857.
> 
> Thank yo for reviewing it.
> 
> Sukender
> PVLE - Lightweight cross-platform game engine -
> http://pvle.sourceforge.net/
> 
> _______________________________________________
> osg-submissions mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to