FixedFunctionMaterial/FixedFunctionMaterial.h

//**************************************************************************/
// Copyright (c) 2008 Autodesk, Inc.
// All rights reserved.
//
// Use of this software is subject to the terms of the Autodesk license
// agreement provided at the time of installation or download, or which
// otherwise accompanies this software in either electronic or hard copy form.
//
//**************************************************************************/
// DESCRIPTION:
// CREATED: October 2008
//**************************************************************************/

#if defined(JAMBUILD)
#include <Mudbox/mudbox.h>
#include <Mudbox/MudBoxGL.h>
#else
#include "../../include/Mudbox/mudbox.h"
#include "../../include/Mudbox/MudBoxGL.h"
#endif

using namespace mudbox;

// Fixed function material plugin.  Uses the hardware's fixed function pipeline
// to render lighting & materials.  This is derived off the 'Material' base class
// that is used by Mudbox to manipulate materials.

class FixedFunctionMaterial : public Material
{
    // RTTI macro.
    DECLARE_CLASS;

public:
    FixedFunctionMaterial( void );

    ~FixedFunctionMaterial( void );

    // The following public functions are overrides

    bool Activate( const Mesh *pMesh, const AxisAlignedBoundingBox &cUVArea, const Color &cColor );

    void Deactivate( void );

    void OnNodeEvent( const Attribute &cAttribute, NodeEventType cType );

    bool IsTCNeeded( void ) const { return true; };

private:
    atexturefilename m_sTexture;

    acolor m_cDiffuse;

    acolor m_cSpecular;

    acolor m_cEmissive;

    afloatr m_fShiny;

    TexturePool *m_pTexturePool;

    GLuint m_iDiffuseTexture;

    GLubyte m_pDiffuseTexture[3];
};