source file REDFactory.h

Go to the documentation of this file.

#ifndef RED_FACTORY_H
#define RED_FACTORY_H

//******************************************************************************
// Copyright (c) 2005 Redway. All rights reserved.
//
// Redway3d is a registered trademark. Any reproduction and / or utilization
// of any material from this document without Redway?s express authorization
// are prohibited.
//******************************************************************************

#include "REDObject.h"
#include "REDCID.h"
#include "REDString.h"
#include "REDWindowRenderInfo.h"
#include "REDState.h"
#include "REDAnimationClip.h"


//******************************************************************************
//*** Object class IDs that can be created by the factory **********************
//******************************************************************************

#define CID_REDLightShape         CID_class_REDLightSourceShape
#define CID_REDLineShape          CID_class_REDLineShape
#define CID_REDPointShape         CID_class_REDPointShape
#define CID_REDTransformShape     CID_class_REDNodeShape
#define CID_REDMeshShape          CID_class_REDTriangleShape
#define CID_REDTextShape          CID_class_REDTextShape
#define CID_REDVolumeShape        CID_class_REDVolumeShape
#define CID_REDCloudsVolumeShape  CID_class_REDCloudsVolumeShape


#define CID_REDViewpoint          CID_class_REDViewpoint


#define CID_REDResourceManager    CID_class_REDResourceManager


#define CID_REDFile               CID_class_REDFile


#define CID_REDGICache            CID_class_REDGICache


//******************************************************************************
//*** RED::Factory class *******************************************************
//******************************************************************************

namespace RED
{
  
  class REDFullExp Factory: public RED::Object
  {
    friend void REDFullExp REDBreak( RED_RC iRC, const char* iCaller, const void* iObject, const char* iExpression, const char* iInfo );
    
    public:
    
    static RED::Object* CreateInstance( const RED::CID& iCID );
    
    
    static RED_RC DeleteInstance( RED::Object*      iInstance,
                                  const RED::State& iState );
    
    
    static RED::Object* CreateREDWindow( RED::Object&           iResourceManager, 
                                         void*                  iOSHandler, 

#if defined( _LIN32 )

                                                                       Display*               iDisplay,
                                                                       int                    iScreen,
                                                                       Visual*                iVisual,

#endif

                                         unsigned int           iWidth, 
                                         unsigned int           iHeight,
                                         RED::WindowRenderInfo* iInfo,
                                         RED_RC&                oErrorCode );
    
    
    static RED::Object* CreateMaterialController( RED::Object&       iResourceManager,
                                                  RED::Object*       iMaterial,
                                                  const RED::String& iCategory, 
                                                  const RED::String& iSubCategory, 
                                                  const RED::String& iDescription, 
                                                  const RED::String& iName, 
                                                  const RED::String& iAuthor,
                                                  RED_RC&            oErrorCode );
    
    
    static RED::Object* CreateAnimationClipController( RED::Object&              iResourceManager,
                                                       const RED::AnimationClip& iAnimationClip,
                                                       RED_RC&                   oErrorCode );
    

    static RED::Object* CreateSkeletalAnimationClipController( RED::Object&              iResourceManager,
                                                               const RED::AnimationClip& iAnimationClip,
                                                               RED_RC&                   oErrorCode );


    static RED::Object* CreateSkeletalAnimationBlender( RED::Object& iResourceManager,
                                                        RED_RC&      oErrorCode );


    static bool IsRegistered( const RED::CID& iCID );
    
    
    static RED::Object* CreateMemoryStream( unsigned char*  iStart,
                                            RED::uint64     iSize );
    
    
    static RED::Object* CreateMemoryStream();
    
    
    static RED::Object* CreateFileStream( const RED::String& iPath );
    
    
    static RED_RC DeleteStream( RED::Object* iStream );


    static RED::Object* CreatePeer();


    static RED_RC DeletePeer( RED::Object* iPeer );


  protected:
    
    static RED::Object* _resmgr;
  };
};


#endif