Inheritance: MonoBehaviour
        public Image Render(Action <IStaticScene> action)
        {
            gl.MakeCurrent();
            var scene = new StaticScene();

            action(scene);
            UpdateView(scene.Camera);
            // Clear The Screen And The Depth Buffer
            gl.Clear(OpenGL.GL_COLOR_BUFFER_BIT | OpenGL.GL_DEPTH_BUFFER_BIT);
            gl.ClearColor(1.0f, 0.0f, 0.0f, 0.0f);


            new BackgroundRenderer(gl, scene.Background).Render();

            new PointRenderer(gl, scene).Render();

            //new Teapot().Draw(gl, 14, 1, OpenGL.GL_FILL);

            if (!String.IsNullOrWhiteSpace(Text))
            {
                gl.DrawText(5, 5, 1.0f, 0.0f, 0.0f, "Courier New", 12.0f, Text);
            }

            return(Output());
        }
Exemple #2
0
    static int Main()
    {
        ProcessUtils.ParseArguments(Environment.CommandLine);
        StaticScene app = new StaticScene(new Context());

        return(app.Run());
    }
        static Scene BuildScenes(GameManager gameManager)
        {
            Scene          controlRoom = new StaticScene("Control Room", "The radio sits silently at the front. The grand window stares out into the darkness of space. To the south is the Lab.");
            ConcourseScene concourse   = new ConcourseScene();
            StadiumScene   stadium     = new StadiumScene(gameManager);
            DynamicScene   storage     = new DynamicScene("Storage", "Contains a rope hung by a hook from its wall. The Lab is to the east.");
            RopeItem       ropeItem    = new RopeItem(storage, concourse, stadium);
            LabScene       lab         = new LabScene("Lab", "Four capsules made of glass sit at the side.", "A lectern with buttons stands at the center. To the north is the Control Room.", ropeItem);
            Scene          hall        = new StaticScene("Hall", "East leads to the Concourse. South leads to the Lab.");

            concourse.SetDescription("A large room with multiple tables like a banquet hall. One wall scorched by the bright lights displays space across its massive window. The Hall is to the west.");

            #region Episodes

            #endregion

            #region Directions
            controlRoom.AddWork(new RoamWork(new string[] { RoamWork.South, "LAB" }, lab));
            lab.AddWork(new RoamWork(new string[] { RoamWork.North, "CONTROL", "CONTROL ROOM" }, controlRoom));
            lab.AddWork(new RoamWork(new string[] { RoamWork.East, "HALL" }, hall));
            lab.AddWork(new RoamWork(new string[] { RoamWork.West, "STORAGE" }, storage));
            storage.AddWork(new RoamWork(new string[] { RoamWork.East, "LAB" }, lab));
            hall.AddWork(new RoamWork(new string[] { RoamWork.West, "LAB" }, lab));
            hall.AddWork(new RoamWork(new string[] { RoamWork.East, "CONCOURSE" }, concourse));
            concourse.AddWork(new RoamWork(new string[] { RoamWork.West, "HALL" }, hall));

            // TEST
            //controlRoom.AddWork(new RoamWork(new string[] { "TEST" }, stadium));
            #endregion

            #region Items
            controlRoom.AddItem(new RadioItem());
            controlRoom.AddItem(new WindowItem {
                Description = "The window stares out into the vastness of space. The stars glitter in their reds, blues, and whites."
            });

            {
                CapsuleItem capsuleItem = new CapsuleItem {
                    Description = "Four empty capsules sit against the wall."
                };
                WindowItem windowItem = new WindowItem {
                    Description = "The stars from here are barely visible to the naked eye because of the sharp lights within the Concourse."
                };
                lab.AddItem(capsuleItem);
                lab.AddItem(new LecternItem(lab, concourse, capsuleItem, windowItem));
                concourse.AddItem(windowItem);
            }

            storage.AddItem(new HookItem());
            storage.AddItem(ropeItem);
            #endregion

            return(controlRoom);
        }