本文整理汇总了C#中Root.LoadPlugin方法的典型用法代码示例。如果您正苦于以下问题:C# Root.LoadPlugin方法的具体用法?C# Root.LoadPlugin怎么用?C# Root.LoadPlugin使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Root
的用法示例。
在下文中一共展示了Root.LoadPlugin方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Main
private static void Main()
{
using (var r = new Root())
{
Console.WriteLine();
Console.WriteLine();
Console.WriteLine("Select Render system:");
Console.WriteLine("1.) OpenGL");
Console.WriteLine("2.) Direct3D9");
while (true)
{
var k = Console.ReadKey(true);
int v;
if (!int.TryParse(k.KeyChar.ToString(), out v))
continue;
if (v > 2 || v == 0)
continue;
if (v == 1)
{
r.LoadPlugin("RenderSystem_GL");
r.RenderSystem = r.GetRenderSystemByName("OpenGL Rendering Subsystem");
}
else
{
r.LoadPlugin("RenderSystem_Direct3D9");
r.RenderSystem = r.GetRenderSystemByName("Direct3D9 Rendering Subsystem");
}
break;
}
using (r.Initialise(false))
{
using (var w = r.RenderSystem._createRenderWindow("SL# Demo", 640, 480, false))
{
var win = new DemoWindow(r, w);
win.OnLoad();
r.FrameRenderingQueued += win.OnRenderFrame;
r.StartRendering();
win.OnUnload();
}
}
}
}
示例2: InitMogre
public void InitMogre()
{
root = new Root();
#if DEBUG
root.LoadPlugin("RenderSystem_Direct3D9_d");
#else
root.LoadPlugin("RenderSystem_Direct3D9");
#endif
bool foundit = false;
foreach (RenderSystem rs in root.GetAvailableRenderers())
{
root.RenderSystem = rs;
String rname = root.RenderSystem.Name;
if (rname == "Direct3D9 Rendering Subsystem")
{
foundit = true;
break;
}
}
if (!foundit)
return; //we didn't find it... Raise exception?
//we found it, we might as well use it!
root.RenderSystem.SetConfigOption("Full Screen", "No");
root.RenderSystem.SetConfigOption("Video Mode",
String.Format("{0} x {1} @ 32-bit colour", windowSize.Width, windowSize.Height));
root.Initialise(false);
// other plugins
#if DEBUG
root.LoadPlugin("Plugin_CgProgramManager_d");
root.LoadPlugin("Plugin_OctreeSceneManager_d");
#else
root.LoadPlugin("Plugin_CgProgramManager");
root.LoadPlugin("Plugin_OctreeSceneManager");
#endif
NameValuePairList misc = new NameValuePairList();
misc["externalWindowHandle"] = hWnd.ToString();
window = root.CreateRenderWindow("Simple Mogre Form Window", 0, 0, false, misc);
ResourceGroupManager.Singleton.InitialiseAllResourceGroups();
sceneMgr = root.CreateSceneManager(SceneType.ST_GENERIC, "SceneMgr");
sceneMgr.AmbientLight = new ColourValue(0.5f, 0.5f, 0.5f);
camera = sceneMgr.CreateCamera("SimpleCamera");
camera.NearClipDistance = 0.1f;
camera.AutoAspectRatio = true;
viewport = window.AddViewport(camera);
viewport.BackgroundColour = new ColourValue(0.25f, 0.25f, 0.25f, 1.0f);
root.FrameStarted += new FrameListener.FrameStartedHandler(MogreFrameStarted);
}
示例3: CreateRoot
private void CreateRoot()
{
m_Root = new Root();
m_Root.LoadPlugin("RenderSystem_Direct3D9");
m_Root.LoadPlugin("RenderSystem_GL");
m_Root.LoadPlugin("Plugin_OctreeSceneManager");
m_SceneManager = m_Root.CreateSceneManager(SceneType.ST_GENERIC);
m_Scene = new Scene(m_Bus, m_SceneManager);
}