#include <xsi_ogltexture.h>
The OGLTexture object represents the OGL texture properties of a material object.
OGLTexture objects are read-only. OGLTexture can be created with Material.OGLTexture.
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() );
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 |
| OGLTexture | ( | ) |
Default constructor.
| ~OGLTexture | ( | ) |
Default destructor.
| OGLTexture | ( | const CRef & | in_ref | ) |
Constructor.
| in_ref | constant reference object. |
| OGLTexture | ( | const OGLTexture & | in_obj | ) |
Copy constructor.
| in_obj | constant class object. |
| bool IsA | ( | siClassID | in_ClassID | ) | const [virtual] |
Returns true if a given class type is compatible with this API class.
| in_ClassID | class type. |
Reimplemented from CBase.
| siClassID GetClassID | ( | ) | const [virtual] |
| 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.
| in_obj | constant class 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.
| in_ref | constant class object. |
| short GetWidth | ( | ) | const |
Returns the width of this texture's image in pixels.
| short GetHeight | ( | ) | const |
Returns the height of this texture's image in pixels.
| CString GetFullName | ( | ) | const |
Returns this texture's image file path name.