当前位置: 首页>>代码示例>>C#>>正文


C# Root.LoadPlugin方法代码示例

本文整理汇总了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();
                    }
                }
            }
        }
开发者ID:hach-que,项目名称:SLSharp,代码行数:45,代码来源:Program.cs

示例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);
        }
开发者ID:realmzero,项目名称:RZModelViewer,代码行数:59,代码来源:OgreWindow.cs

示例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);
        }
开发者ID:anthony-martin,项目名称:Triangles-in-space,代码行数:10,代码来源:Renderer.cs


注:本文中的Root.LoadPlugin方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。