예제 #1
0
 public InputAggregatorEventArgs(InputAggregator aggregator)
 {
     d_aggregator = aggregator;
 }
예제 #2
0
        protected override void LoadContent()
        {
            base.LoadContent();

            _mapTexture = Texture2D.Load(GraphicsDevice, "assets/map.png");
            //_mapTexture = Texture2D.Load(GraphicsDevice, "assets/tex.png");
            _spriteBatch = new SpriteBatch(GraphicsDevice);

            _vertexShader = GraphicsDevice.CreateVertexShader(File.ReadAllText("assets/Shaders/VertexShader_OpenGL.txt"));
            _pixelShader  = GraphicsDevice.CreatePixelShader(File.ReadAllText("assets/Shaders/PixelShader_OpenGL.txt"));

            _vertexBuffer = GraphicsDevice.CreateVertexBuffer(VertexPositionColorTexture.VertexDeclaration, 6, BufferUsage.None, false);
            _vertexBuffer.SetData(_bufferData1);

            _renderer = SharpCEGui.OpenGLRenderer.OpenGL3Renderer.Create();
            //new SharpCEGuiNLogger();
            var path = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Personal), GameName);
            var file = Path.Combine(path, "CEGUISharp.log");

            _system = SharpCEGui.Base.System.Create(_renderer,
                                                    null /*new PackedResourceProvider(Path.Combine(GetCurrentDirectory(),"resources.pack"))*/,
                                                    new SharpCEGui.Base.DefaultXmlParser(),
                                                    null,
                                                    String.Empty,
                                                    file);

            var scheme = String.Empty;
            var prefix = "00";

            //InitializeScheme(ref scheme, ref prefix);
            InitialiseDefaultResourceGroups();
            InitialiseResourceGroupDirectories(prefix);

#if WINDOWS
            _system.GetClipboard().SetNativeProvider(new WindowsClipboardProvider());
#elif __MACOS__
            _system.GetClipboard().SetNativeProvider(new MacOSClipboardProvider());
#endif

            _guiContext = _system.GetDefaultGUIContext();
            _guiContext.GetCursor().SetVisible(false);
            _inputAggregator = new SharpCEGui.Base.InputAggregator(_guiContext);
            _inputAggregator.Initialise();

            // TODO: ?? Window.TextInput += (sender, args) => _inputAggregator.InjectChar(args.Character);

            // TODO: _viewManager = new ViewManager(this, scheme, prefix);

            SchemeManager.GetSingleton().CreateFromFile("WBMLook2-00.scheme");
            _guiContext.GetCursor().SetDefaultImage("WBMLook/mouse-arrow");
            _guiContext.GetCursor().SetImage(_guiContext.GetCursor().GetDefaultImage());

            _guiContext.SetDefaultFont(FontManager.GetSingleton().Get("small-bold"));
            _guiContext.SetDefaultTooltipType(null);

            var winMgr = WindowManager.GetSingleton();
            _rootWindow = winMgr.CreateWindow("DefaultWindow", "rootWindow");

            _guiContext.SetRootWindow(_rootWindow);

            _rootWindow.AddChild(winMgr.LoadLayoutFromFile("mainMenuView2.layout"));
        }