示例#1
0
        /// <summary>
        /// Loads the module.
        /// </summary>
        /// <param name="name">The name of the module.</param>
        public override void Load(string name)
        {
            Renderer = new GameRenderer();
            Renderer.Add(new ColorArrayRenderer());
            Renderer.Add(new VertexArrayRenderer());
            Keyboard         = new KeyboardHandler();
            Mouse            = new MouseHandler(this);
            CursorVisibility = true;
            LatipiumModule objectModule = ModuleFactory.FindModule("Com.Latipium.Modules.World.Objects");

            if (objectModule != null)
            {
                objectModule.AddEvent("ObjectLoaded", (Action <LatipiumObject>)LoadObject);
            }
        }
        internal InterfaceHandler()
        {
            Translation = new Com.Latipium.Core.Tuple <float, float, float>();
            Rotation    = new Com.Latipium.Core.Tuple <float, float>();
            LatipiumModule graphics = ModuleFactory.FindModule("Com.Latipium.Modules.Graphics");

            if (graphics != null)
            {
                graphics.AddEvent("MouseMoved", (Action <int, int, int, int>)HandleMouse);
                Action <Action <int, int>, long> AddKeyboardBinding = graphics.GetProcedure <Action <int, int>, long>("AddKeyboardBinding");
                if (AddKeyboardBinding != null)
                {
                    AddKeyboardBinding(HandleKeyboard, 0);
                }
                graphics.InvokeProcedure("HideCursor");
            }
            int x;
            int y;

            CenterScreen(out x, out y);
            Cursor.Position = new Point(x, y);
        }