| DrawProcedureStatusCode Draw Procedure status codes
| |||||||||||
| BufferPixelFormat Specify the pixel format of the current buffer
| |||||||||||
| CallLocation Draw Procedure call locations | |||||||||||
| GeometricShape Default geometry shapes | |||||||||||
| theRenderer () | |||||||||||
| backEndString () const | |||||||||||
| addDrawProcedure ( const MString & backEndString , MDrawProcedureBase *drawProcedureptr, CallLocation location) | |||||||||||
| removeDrawProcedure ( const MString & backEndString , MDrawProcedureBase *drawProcedureptr, CallLocation location ) | |||||||||||
| insertDrawProcedure ( const MString & backEndString , MDrawProcedureBase *drawProcedurePtr, CallLocation location, unsigned int listIndex, bool moveExistingItem = false) | |||||||||||
| getDrawProcedureCount ( const MString & backEndString , CallLocation location, unsigned int &count ) const | |||||||||||
| getDrawProcedureListNames ( const MString & backEndString , CallLocation location, MStringArray &namesOfProcs ) const | |||||||||||
| findDrawProcedure ( const MString & backEndString , CallLocation location, const MString &procName ) const | |||||||||||
| makeResourceContextCurrent (const MString & backEndString ) | |||||||||||
| getBufferSize ( const MString & backEndString , unsigned int &width, unsigned int &height ) const | |||||||||||
| getColorBufferPixelFormat ( const MString & backEndString , BufferPixelFormat &fmt ) const | |||||||||||
| getDepthBufferPixelFormat ( const MString & backEndString , BufferPixelFormat &fmt ) const | |||||||||||
| getCurrentExposureNumber ( const MString & backEndString , unsigned int &number ) const | |||||||||||
| getTotalExposureCount ( const MString & backEndString , unsigned int &number ) const | |||||||||||
| restoreCurrent (const MString & backEndString ) const | |||||||||||
| makeSwatchContextCurrent ( const MString & backEndString , unsigned int & width, unsigned int & height ) | |||||||||||
| readSwatchContextPixels ( const MString & backEndString , MImage & image ) | |||||||||||
| referenceDefaultGeometry ( MHardwareRenderer::GeometricShape geomShape, unsigned int & numberOfData, unsigned int* & pIndexing, unsigned int & indexLength) | |||||||||||
| dereferenceGeometry ( MGeometryData * pGeomData, unsigned int numberOfData) | |||||||||||
| getSwatchOrthoCameraSetting ( double& l, double& r, double& b, double& t, double& n, double& f ) const | |||||||||||
| getSwatchPerspectiveCameraSetting ( double& l, double& r, double& b, double& t, double& n, double& f ) const | |||||||||||
| getSwatchPerspectiveCameraTranslation ( float& x, float& y, float& z, float& w ) const | |||||||||||
| getSwatchLightDirection ( float& x, float& y, float& z, float& w ) const | |||||||||||
| drawSwatchBackGroundQuads ( const MColor & quadColor = kDefaultQuadColor, bool textured = false, unsigned int numberOfRepeats = 8) const | |||||||||||
| glFunctionTable () const |
{
unsigned int numberOfData = 0; // Attribute count
unsigned int *pIndexing = 0; // Attribute indexing
unsigned int indexCount = 0; // Length of indexing array
// Geometry shape to obtain
unsigned int mGeometryShape = <user input>;
MHardwareRenderer::GeometricShape gshape = MHardwareRenderer::kDefaultSphere;
if (mGeometryShape == 2)
{
gshape = MHardwareRenderer::kDefaultCube;
}
else if (mGeometryShape == 3)
{
gshape = MHardwareRenderer::kDefaultPlane;
}
// *** Obtain data references
MGeometryData * pGeomData =
pRenderer->referenceDefaultGeometry( gshape, numberOfData, pIndexing, indexCount);
// Draw default data
if (pGeomData)
{
glPushClientAttrib ( GL_CLIENT_VERTEX_ARRAY_BIT );
float *vertexData = (float *)( pGeomData[0].data() );
if (vertexData)
{
glEnableClientState( GL_VERTEX_ARRAY );
glVertexPointer ( 3, GL_FLOAT, 0, vertexData );
}
float *normalData = (float *)( pGeomData[1].data() );
if (normalData)
{
glEnableClientState( GL_NORMAL_ARRAY );
glNormalPointer ( GL_FLOAT, 0, normalData );
}
if (vertexData && normalData && pIndexing )
glDrawElements ( GL_TRIANGLES, indexCount, GL_UNSIGNED_INT, pIndexing );
glPopClientAttrib();
// *** Release data references after usage.
pRenderer->dereferenceGeometry( pGeomData, numberOfData );
}
}
Arguments | Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. | doc++ Copyright |