Пример #1
0
 public void RenderMenu(DoomApplication app)
 {
     if (app.Menu.Active)
     {
         menu.Render(app.Menu);
     }
 }
Пример #2
0
        public void Render(DoomApplication app)
        {
            if (app.State == ApplicationState.Opening)
            {
                openingSequence.Render(app.Opening);
            }
            else if (app.State == ApplicationState.Game)
            {
                RenderGame(app.Game);
            }

            if (app.Menu.Active)
            {
                menu.Render(app.Menu);
            }

            var screenData = screen.Data;
            var p          = MemoryMarshal.Cast <byte, uint>(sfmlTextureData);

            for (var i = 0; i < p.Length; i++)
            {
                p[i] = colors[screenData[i]];
            }

            sfmlTexture.Update(sfmlTextureData, (uint)screen.Height, (uint)screen.Width, 0, 0);

            sfmlWindow.Draw(sfmlSprite, sfmlStates);

            sfmlWindow.Display();
        }