H3D::X3DTexture2DNode Class Reference
[Abstract nodes.]

This abstract node type is the base type for all node types which specify 2D sources for texture images. More...

#include <H3D/X3DTexture2DNode.h>

Inheritance diagram for H3D::X3DTexture2DNode:

Inheritance graph

List of all members.

Classes

class  SFImage
 A SFNode encapsulating an Image class. More...

Public Types

typedef DependentSFNode
< FieldRef< TextureProperties,
Field,&TextureProperties::propertyChanged > > 
SFTextureProperties
 The SFTextureProperties is dependent on the propertyChanged field of the contained TextureProperties.

Public Member Functions

 X3DTexture2DNode (Inst< DisplayList > _displayList=0, Inst< SFNode > _metadata=0, Inst< SFBool > _repeatS=0, Inst< SFBool > _repeatT=0, Inst< SFBool > _scaleToP2=0, Inst< SFImage > _image=0, Inst< SFTextureProperties > _textureProperties=0)
 Constructor.
 ~X3DTexture2DNode ()
 Destructor.
virtual void render ()
 Performs the OpenGL rendering required to install the image as a texture.
virtual void renderTextureProperties ()
 Render all OpenGL texture properties.
GLuint getTextureId ()
 Get the OpenGL texture id that is used for this texture.
GLuint getTextureUnit ()
 Get the OpenGL texture unit that is used for this texture.
virtual void enableTexturing ()
 Virtual function for making all OpenGL calls that are needed to enable texturing for the texture.
virtual void disableTexturing ()
 Virtual function for making all OpenGL calls that are needed to disable texturing for the texture.
virtual GLint glInternalFormat (Image *image)
 Returns the internal OpenGL format to use given an Image.
virtual void glTexImage (Image *image, GLenum texture_target, bool scale_to_power_of_two)
 Installs the given image as a OpenGL texture with a call to the glTexImage2D function.
virtual void renderSubImage (Image *image, GLenum texture_target, int xoffset, int yoffset, int width, int height)
 Replaces part of the current texture from an image.

Public Attributes

auto_ptr< SFBoolrepeatS
 If true the texture will repeat itself when the s texture coordinate is outside the range [0,1].
auto_ptr< SFBoolrepeatT
 If true the texture will repeat itself when the t texture coordinate is outside the range [0,1].
auto_ptr< SFBoolscaleToPowerOfTwo
 If true the image used will be scaled so that the dimensions are a power of two if they are not.
auto_ptr< SFTexturePropertiestextureProperties
 The textureProperties field contains a TextureProperties node which allows fine control over a texture's application.

Static Public Attributes

static H3DNodeDatabase database
 The H3DNodeDatabase for this node.

Protected Attributes

GLuint texture_id
 The OpenGL texture id of the installed texture, 0 if not installed.
GLint texture_unit
 The OpenGL texture unit that is used to render this texture.


Detailed Description

This abstract node type is the base type for all node types which specify 2D sources for texture images.

Internal routes:
X3DTexture2DNode.dot

Member Typedef Documentation

The SFTextureProperties is dependent on the propertyChanged field of the contained TextureProperties.


Member Function Documentation

void X3DTexture2DNode::glTexImage ( Image image,
GLenum  texture_target,
bool  scale_to_power_of_two 
) [virtual]

Installs the given image as a OpenGL texture with a call to the glTexImage2D function.

This function is used by renderImage () and uses the glInternalFormat (), glPixelFormat () and glPixelComponentType () functions to get the arguments to the glTexImage2D call.

Reimplemented from H3D::X3DTextureNode.

References H3DUtil::Image::bitsPerPixel(), H3D::TextureProperties::borderWidth, H3DUtil::Image::byteAlignment(), H3D::TextureProperties::generateMipMaps, H3DUtil::Image::getImageData(), H3DUtil::RefCountedClass::getName(), glInternalFormat(), H3D::X3DTextureNode::glPixelComponentType(), H3D::X3DTextureNode::glPixelFormat(), H3DMax(), H3DUtil::Image::height(), isPowerOfTwo(), nextPowerOfTwo(), textureProperties, and H3DUtil::Image::width().

Referenced by H3D::ComposedCubeMapTexture::render().

void X3DTexture2DNode::render (  )  [virtual]


Member Data Documentation

If true the texture will repeat itself when the s texture coordinate is outside the range [0,1].

If false the texture will be clamped if outside the same range.

Access type: inputOutput
Default value: TRUE

X3DTexture2DNode_repeatS.dot

Referenced by renderTextureProperties(), and X3DTexture2DNode().

If true the texture will repeat itself when the t texture coordinate is outside the range [0,1].

If false the texture will be clamped if outside the same range.

Access type: inputOutput
Default value: TRUE

X3DTexture2DNode_repeatT.dot

Referenced by renderTextureProperties(), and X3DTexture2DNode().

If true the image used will be scaled so that the dimensions are a power of two if they are not.

This will however take up more memory and might cause some unwanted strething effects on the texture. The new texture values will be linearly interpolated from the original ones.

Access type: inputOutput
Default value: TRUE

X3DTexture2DNode_image.dot

Referenced by render(), and X3DTexture2DNode().

The textureProperties field contains a TextureProperties node which allows fine control over a texture's application.

Access type: inputOutput

X3DTexture2DNode_textureProperties.dot

Referenced by glInternalFormat(), glTexImage(), renderTextureProperties(), and X3DTexture2DNode().


The documentation for this class was generated from the following files:

Generated on Fri Nov 7 10:31:32 2008 for H3D API by  doxygen 1.5.7