-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathcsRenderPlugin.cpp
More file actions
86 lines (73 loc) · 2.04 KB
/
csRenderPlugin.cpp
File metadata and controls
86 lines (73 loc) · 2.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#include <BaseLib/xEvol3DBaseInc.h>
#include <Application/xPluginMgr.h>
#include <BaseLib/xStringHash.h>
#include "./include/csRenderer.h"
using namespace XEvol3D;
class xScriptRendererPlugin : public IPluginObject
{
class csRendererCreator : public IRendererCreator
{
public:
virtual const wchar_t* name() const
{
return _CSCRIPTRENDER_NAME_;
}
virtual IBaseRenderer* createInstance(IRenderApi* pRenderApi) const
{
return new csRenderer(pRenderApi);
}
};
csRendererCreator* m_RenderCreator;
public:
xScriptRendererPlugin()
{
m_RenderCreator = NULL;
}
bool start(const wchar_t* pluginName , const wchar_t* pluginPath)
{
if(m_RenderCreator == NULL)
{
m_RenderCreator = new csRendererCreator;
xRendererManager::singleton()->registeRenderer(m_RenderCreator);
}
return true;
}
void info(xPluginInfo* info)
{
wcsncpy(info->m_Description , L"Script Renderer Plugin name=[csRenderer]" , 256);
info->m_ID = xStringHash(L"Script Renderer Plugin");
wcsncpy(info->m_Name , L"Script Renderer Plugin" , 32);
info->m_Type =ePT_Renderer;
}
bool stop()
{
if(m_RenderCreator)
{
xRendererManager::singleton()->unregisteRenderer(m_RenderCreator);
delete m_RenderCreator;
m_RenderCreator = NULL;
}
return true;
}
unsigned int nObject()
{
return 0;
}
void* createObject(const wchar_t* objName, const void * arg)
{
return NULL;
}
const wchar_t** objectList()
{
static wchar_t* objectList[1] = {NULL};
return (const wchar_t**)objectList;
}
};
#ifndef _XEVOL_BUILD_STATIC_PLUGIN_
extern "C" _declspec(dllexport) IPluginObject* PLUGIN_ENTRYPOINT()
{
static xScriptRendererPlugin gPluginObject;
return &gPluginObject;
}
#else
#endif