[osg-users] adding Texture State

Robert Osfield robert.osfield at gmail.com
Fri Jul 18 02:33:46 PDT 2008


Hi Ming,

The value is null, its 0, its a size, null terminology is used for
pointers.  It simply means that the texture object hasn't been
allocated yet so it doesn't have a size.  Only once the OpenGL texture
object is compiled by the graphics context will its size be set.

Robert.

On Fri, Jul 18, 2008 at 10:08 AM, ka Ming <ming_ka at yahoo.de> wrote:
> Hi Robert,
> I read in a OSG file. After that I want to add new Textures to Objects. One
> object can have more than one Texture. If I cannot add a new Texture.
> Here is some Code:
>
> osg::Texture2D* osg_texture = new osg::Texture2D;
> osg_texture->setImage(tImg);
> std::cerr<<"Texture "<<osg_texture->getTextureHeight()<<std::endl; //this is
> null!! But the Image File isn't null
> stateSet->setTextureAttributeAndModes(myTextureNumber, osg_texture,
> osg::StateAttribute::TEXTURE);
>
> Some Ideas?
> Ming
>
> Hi Ming,
>
> What do you mean by the "image I set is null"?
>
> If you want examples of how textures
>  are set up have a look at the OSG
> examples - just do a search for texture2D.  For instance osggeometry
> has a textured quad.
>
> Robert.
>
> On Fri, Jul 18, 2008 at 9:43 AM, ka Ming <ming_ka at yahoo.de> wrote:
>
>> Hi,
>> I'am trying to add a texture attribute to a existing stateSet. If I try to
>> add the attribute with setTextureAttributeAndModes the list size increased
>> but the Image I set is null.
>> How do I correctly add a texture attribute??
>> Thanks
>> Ming
>>
>> ________________________________
>> Gesendet von Yahoo! Mail.
>> Dem pfiffigeren Posteingang.
>> _______________________________________________
>> osg-users mailing list
>> osg-users at lists.openscenegraph.org
>> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>>
>>
>
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
> ________________________________
> Gesendet von Yahoo! Mail.
> Dem pfiffigeren Posteingang.
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>



More information about the osg-users mailing list