# OGLTexture Class Reference

Related Scripting Object: OGLTexture

The OGLTexture object represents the OGL texture properties of a material object. More...

`#include <xsi_ogltexture.h>`

Inheritance diagram for OGLTexture:

List of all members.

## Public Member Functions
| OGLTexture ()
| ~OGLTexture ()
| OGLTexture (const CRef &in_ref)
| OGLTexture (const OGLTexture &in_obj)
bool | IsA (siClassID in_ClassID) const
siClassID | GetClassID () const
OGLTexture & | operator= (const OGLTexture &in_obj)
OGLTexture & | operator= (const CRef &in_ref)
short | GetWidth () const
short | GetHeight () const
CString | GetFullName () const

## Detailed Description

The OGLTexture object represents the OGL texture properties of a material object.

OGLTexture objects are read-only. OGLTexture can be created with Material.OGLTexture.

See also:
  Material

Example:

              using namespace XSI;
              Application app;
              Model root = app.GetActiveSceneRoot();

              X3DObject myGrid;
              root.AddGeometry( L"Grid", L"MeshSurface", L"", myGrid );

              CValueArray args(4);
              args[0] = CValue( CString(L"Image") );
              args[1] = CValue(myGrid.GetRef());
              args[2] = CValue((short)1);
              args[3] = CValue(false);

              CStatus st;
              CValue outArg;
              st = app.ExecuteCommand( L"BlendInPresets", args, outArg );
              if ( st.GetCode() != CStatus::OK )
              {
                  app.LogMessage( L"BlendInPresets failed" );
                  return;
              }

              OGLTexture myOGLTexture = myGrid.GetMaterial().GetOGLTexture();

              app.LogMessage( L"Texture's width: " +
                  CValue(myOGLTexture.GetWidth()).GetAsText() );
              app.LogMessage( L"Texture's height: " +
                  CValue(myOGLTexture.GetHeight()).GetAsText() );

## Constructor & Destructor Documentation

OGLTexture | ( |  | ) |

Default constructor.

~OGLTexture | ( |  | ) |

Default destructor.

OGLTexture | ( | const CRef & | in_ref | ) |

Constructor.

Parameters:

  | in_ref | constant reference object.

OGLTexture | ( | const OGLTexture & | in_obj | ) |

Copy constructor.

Parameters:

  | in_obj | constant class object.

## Member Function Documentation

bool IsA | ( | siClassID | in_ClassID | ) | const`[virtual]`

Returns true if a given class type is compatible with this API class.

Parameters:

  | in_ClassID | class type.

Returns:
  true if the class is compatible, false otherwise.

Reimplemented from CBase.

siClassID GetClassID | ( |  | ) | const`[virtual]`

Returns the type of the API class.

Returns:
  The class type.

Implements CBase.

OGLTexture& operator= | ( | const OGLTexture & | in_obj | ) |

Creates an object from another object. The newly created object is set to empty if the input object is not compatible.

Parameters:

  | in_obj | constant class object.

Returns:
  The new OGLTexture object.

OGLTexture& operator= | ( | const CRef & | in_ref | ) |

Creates an object from a reference object. The newly created object is set to empty if the input reference object is not compatible.

Parameters:

  | in_ref | constant class object.

Returns:
  The new OGLTexture object.

short GetWidth | ( |  | ) | const

Returns the width of this texture's image in pixels.

Returns:
  The width of this texture's image in pixels.

short GetHeight | ( |  | ) | const

Returns the height of this texture's image in pixels.

Returns:
  height of this texture's image in pixels.

CString GetFullName | ( |  | ) | const

Returns this texture's image file path name.

Returns:
  The texture image file path name.

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

- xsi_ogltexture.h