Hi Aurelien,

thanks for the hints. I was also suggested by someone else to either
subclass or do what you have done, but I found it working with this
Texture::TextureObject trick, and it works well, so I am not to leave this
method only was curious if there is something else to be set to get rid of
the warning. Thanks again

Nick


On Tue, Oct 8, 2013 at 4:30 PM, Aurelien Albert <aurelien.alb...@alyotech.fr
> wrote:

> Hi,
>
> I've done the same a few weeks ago :
>
> - a customer low-level OpenGL API is creating some ressources (like
> textures)
> - my OSG applicatino have to use these ressources
>
> So I created a "MyTexture" class :
>
>
> Code:
>                 class MyTexture : public osg::StateAttribute
>                 {
>                 private:
>                         CustomerGL::Texture
>               p_CustomerTexture;
>
>                 public:
>                         Texture();
>                         Texture(CustomerGL::Texture* p_CustomerTexture);
>                         Texture(const MyTexture& texture,const
> osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
>
>                         virtual osg::Object*
>                      cloneType() const;
>                         virtual osg::Object*
>                      clone(const osg::CopyOp& copyop) const;
>                         virtual bool
>                              isSameKindAs(const osg::Object* pObj) const;
>                         virtual const char*
>                               libraryName() const;
>                         virtual const char*
>                               className() const;
>
>                 private:
>                         Texture &operator=(constMyTexture& other);  // No
> copy
>
>                 protected:
>                         virtual ~Texture();
>
>                 public:
>                         CustomerGL::Texture*
>                                      CustomerGLTexture() const;
>                         void
>                                      setCustomerGLTexture(CustomerGL*
> pGLBoxTexture);
>
>                         virtual osg::StateAttribute::Type
>               getType() const;
>                         virtual bool
>                              isTextureAttribute() const;
>                         virtual int
>                                       compare(const osg::StateAttribute&
> stateAttribute) const;
>                         virtual bool
>                              getModeUsage(osg::StateAttribute::ModeUsage&
> modeUsage) const;
>                         virtual void
>                              apply(osg::State& state) const;
>                         virtual void
>                              compileGLObjects(osg::State& state) const;
>                         virtual void
>                              resizeGLObjectBuffers(unsigned int maxSize);
>                         virtual void
>                              releaseGLObjects(osg::State* pState=NULL)
> const;
>                 };
>
>
>
>
> The virtual methods are pretty simple to implement : have a look to
> osg::Texture2D implementations.
> By subclassing "osg::StateAttribute" and not "osg::Texture", I'm sure that
> all OSG algorithms (such as texture resizing) will not be applied to
> MyTexture class.
>
>
> Cheers,
> Aurelien
>
> ------------------
> Read this topic online here:
> http://forum.openscenegraph.org/viewtopic.php?p=56673#56673
>
>
>
>
>
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>



-- 
trajce nikolov nick
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to