コード例 #1
0
        public static void Dispose()
        {
            UIWindow.Dispose();
            UIWindow = null;

            Elements.Clear();
        }
コード例 #2
0
 public static void Dispose()
 {
     UserInterface.UIWindow?.Dispose();
     UserInterface.UIWindow = (UIContainer)null;
     UserInterface.Elements?.Clear();
     Shaders.Dispose();
 }
コード例 #3
0
 public static void InitUI(int width, int height)
 {
     if (!Shaders.Init(Shaders.ShaderVersion.GLSL140))
     {
         return;
     }
     UserInterface.Elements            = new Dictionary <string, UIElement>();
     UserInterface.UIWindow            = new UIContainer(new Point(0, 0), new Point(UserInterface.Width, UserInterface.Height), "TopLevel");
     UserInterface.UIWindow.RelativeTo = Corner.BottomLeft;
     UserInterface.Elements.Add("Screen", (UIElement)UserInterface.UIWindow);
     UserInterface.UIProjectionMatrix = Matrix4.CreateTranslation(new Vector3((float)(-UserInterface.Width / 2), (float)(-UserInterface.Height / 2), 0.0f)) * Matrix4.CreateOrthographic((float)UserInterface.Width, (float)UserInterface.Height, 0.0f, 1000f);
     UserInterface.Visible            = true;
     UserInterface.MainThreadID       = Thread.CurrentThread.ManagedThreadId;
     UserInterface.OnResize(width, height);
 }
コード例 #4
0
        public static void InitUI(int width, int height)
        {
            if (Shaders.Init())
            {
                Elements = new Dictionary <string, UIElement>();

                // create the top level screen container
                UIWindow            = new UIContainer(new Point(0, 0), new Point(UserInterface.Width, UserInterface.Height), "TopLevel");
                UIWindow.RelativeTo = Corner.BottomLeft;
                Elements.Add("Screen", UIWindow);

                UIProjectionMatrix = Matrix4.CreateTranslation(new Vector3(-UserInterface.Width / 2, -UserInterface.Height / 2, 0)) * Matrix4.CreateOrthographic(UserInterface.Width, UserInterface.Height, 0, 1000);

                Visible = true;

                MainThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;

                OnResize(width, height);
            }
        }