92 lines
2.7 KiB
C++
92 lines
2.7 KiB
C++
/*************************************************************************/
|
|
/* File : VRMain.cpp */
|
|
/* */
|
|
/* Author : Virtools */
|
|
/* Defines the initialization routines for the plugin DLL */
|
|
/* */
|
|
/* The VR Sdk being under development, the following implementation and */
|
|
/* recommendation will problably change for the official release. */
|
|
/*************************************************************************/
|
|
#include "CKAll.h"
|
|
#include "VRAll.h"
|
|
#include ".\Sources\MyVRManager.h"
|
|
|
|
|
|
/************************************************************************
|
|
Behavior List
|
|
************************************************************************/
|
|
// CKObjectDeclaration* MyBehaviorDecl();
|
|
|
|
// This function should be present and exported for Virtools
|
|
// to be able to retrieve objects declarations.
|
|
// Virtools will call this function at initialization
|
|
void RegisterBehaviorDeclarations(XObjectDeclarationArray *reg)
|
|
{
|
|
// Additionnal behaviors registrations should be added here....
|
|
// RegisterBehavior(reg, MyBehaviorDecl);
|
|
}
|
|
|
|
|
|
/************************************************************************
|
|
Initialization / Cleaning
|
|
************************************************************************/
|
|
CKERROR InitInstance(CKContext* context)
|
|
{
|
|
// Try to initialize our manager. As we implemented it, it may fail,
|
|
// in this case, we need to delete it.
|
|
CKBOOL Error;
|
|
MyVRManager* man = new MyVRManager(context, Error);
|
|
if (Error) delete (man);
|
|
|
|
return CK_OK;
|
|
}
|
|
|
|
CKERROR ExitInstance(CKContext* context)
|
|
{
|
|
// This function will only be called if the dll is unloaded explicitely
|
|
// by a user in Virtools Dev interface
|
|
// Otherwise the manager destructor will be called by Virtools runtime directly
|
|
MyVRManager* MyManager = (MyVRManager*) context->GetManagerByGuid(MyVRManagerGUID);
|
|
if ( MyManager )
|
|
delete (MyManager);
|
|
|
|
return CK_OK;
|
|
}
|
|
|
|
|
|
/************************************************************************
|
|
Plugin Info
|
|
************************************************************************/
|
|
#define PLUGIN_COUNT 1 // A Manager
|
|
|
|
CKPluginInfo g_PluginInfo[PLUGIN_COUNT];
|
|
|
|
|
|
int CKGetPluginInfoCount() {
|
|
return PLUGIN_COUNT;
|
|
}
|
|
|
|
CKPluginInfo* CKGetPluginInfo(int Index)
|
|
{
|
|
int Plugin = 0;
|
|
g_PluginInfo[Plugin].m_Author = "Virtools";
|
|
g_PluginInfo[Plugin].m_Description = "VR Sdk Sample";
|
|
g_PluginInfo[Plugin].m_Extension = "";
|
|
g_PluginInfo[Plugin].m_Type = CKPLUGIN_MANAGER_DLL;
|
|
g_PluginInfo[Plugin].m_Version = 0x00010000;
|
|
g_PluginInfo[Plugin].m_InitInstanceFct = InitInstance;
|
|
g_PluginInfo[Plugin].m_ExitInstanceFct = ExitInstance;
|
|
g_PluginInfo[Plugin].m_GUID = MyVRManagerGUID;
|
|
g_PluginInfo[Plugin].m_Summary = "MyVRManager";
|
|
Plugin++;
|
|
|
|
return &g_PluginInfo[Index];
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|