osg.Texture2D

class osg.Texture2D
Represents:c++ class
Wraps:osg::Texture2D
Bases:osg.Texture

Encapsulates OpenGL 2D texture functionality. Doesn’t support cube maps, so ignore face parameters.

Constructors:

osg.Texture2D()

osg.Texture2D(osg.Image image)

Parameters:image (osg.Image) –

Methods:

:setNumMipmapLevels(unsigned num)

Helper function. Sets the number of mipmap levels created for this texture. Should only be called within an osg.Texture.apply(), or during a custom OpenGL texture load.

Parameters:num (unsigned) –
:getNumMipmapLevels()

Gets the number of mipmap levels created.

Return type:unsigned
:setImage(osg.Image image)

Sets the texture image.

Parameters:image (osg.Image) –
:setImage(int face, osg.Image image)

Sets the texture image, ignoring face.

Parameters:
:getImage()

Gets the texture image.

Return type:osg.Image
:getImage(int face)

Gets the texture image, ignoring face.

Parameters:face (int) –
Return type:osg.Image
:setTextureSize(int width, int height)

Sets the texture width and height. If width or height are zero, calculate the respective value from the source image size.

Parameters:
  • width (int) –
  • height (int) –
:setTextureWidth(int width)

Parameters:width (int) –
:setTextureHeight(int height)

Parameters:height (int) –