Ejemplo n.º 1
0
        protected override void LoadContent()
        {
            base.LoadContent();

            DrawActionScheduler.Schedule(() => {
                ImGuiState.BuildTextureAtlas();

                SpriteBatch = new SpriteBatch(GraphicsDevice);

                FinishedLoading = true;
            });
        }
Ejemplo n.º 2
0
        public override void Initialize()
        {
            base.Initialize();

            LogoMesh = new Mesh {
                AlwaysOnTop = true
            };

            for (int i = 0; i < StripColors.Length; i++)
            {
                FezVertexPositionColor[] vertices = new FezVertexPositionColor[202];
                for (int j = 0; j < vertices.Length; j++)
                {
                    vertices[j] = new FezVertexPositionColor(Vector3.Zero, StripColors[i]);
                }
                LogoMesh.AddGroup().Geometry = new IndexedUserPrimitives <FezVertexPositionColor>(vertices, Enumerable.Range(0, vertices.Length).ToArray(), PrimitiveType.TriangleStrip);
            }

            float viewScale = GraphicsDevice.GetViewScale();
            float xScale    = GraphicsDevice.Viewport.Width / (1280f * viewScale);
            float yScale    = GraphicsDevice.Viewport.Height / (720f * viewScale);
            int   width     = GraphicsDevice.Viewport.Width;
            int   height    = GraphicsDevice.Viewport.Height;

            LogoMesh.Position = new Vector3(-0.1975f / xScale, -0.25f / yScale, 0f);
            LogoMesh.Scale    = new Vector3(new Vector2(500f) * viewScale / new Vector2(width, height), 1f);
            sPolytron         = CMProvider.Get(CM.Intro).Load <SoundEffect>("Sounds/Intro/PolytronJingle");

            DrawActionScheduler.Schedule(delegate {
                PolytronText    = CMProvider.Get(CM.Intro).Load <Texture2D>("Other Textures/splash/polytron_neue" + (viewScale >= 1.5f ? "_1440" : ""));
                spriteBatch     = new SpriteBatch(GraphicsDevice);
                LogoMesh.Effect = new DefaultEffect.VertexColored {
                    ForcedProjectionMatrix = Matrix.CreateOrthographic(320f / 224f, 320f / 224f, 0.1f, 100f),
                    ForcedViewMatrix       = Matrix.CreateLookAt(Vector3.UnitZ, -Vector3.UnitZ, Vector3.Up)
                };
            });
        }
Ejemplo n.º 3
0
 public static void InvokeGL(this Action a)
 {
     DrawActionScheduler.Schedule(a);
 }