Esempio n. 1
0
        public override cCritter copy()
        {
            cCritterViewer c = new cCritterViewer();

            c.copy(this);
            return(c);
        }
Esempio n. 2
0
        public void OnDraw()
        {
            //If you've just changed the game type, or restarted a game,
            //use the game's initialization code on this view.
            if (ACDoc.RESTART)
            {
                _pviewpointcritter = new cCritterViewer(this);         // Looks at pgame().border()
                pgame().View       = this;
                pgame().Viewpoint  = _pviewpointcritter;
                pgraphics().installLightingModel(pgame().LightingModel);
                ACDoc.RESTART = false;
                //And now go on and show the game.
            }
            //Animate the viewer
            float dt = Framework.pdoc.getdt();

            _pviewpointcritter.feellistener(dt);
            _pviewpointcritter.move(dt);
            _pviewpointcritter.update(this, dt);
            //possibly feel forces or sniff pixels or align position with player.
            _pviewpointcritter.animate(dt);

            _pgraphics.garbageCollect(); // gets rid of textures, etc., that haven't
            // been used for a while

            //Graphically show the status of the game.

            GL.Clear(ClearBufferMask.ColorBufferBit |
                     ClearBufferMask.DepthBufferBit);

            //Install the projection and view matrices.
            _pviewpointcritter.loadProjectionMatrix();     // Initializes the PROJECTION matrix or,
            _pviewpointcritter.loadViewMatrix();

            //Draw the world, by default as a background and a foreground rectangle.
            pgame().drawWorld(_pgraphics, _drawflags);

            //Draw the critters.
            pgame().drawCritters(_pgraphics, _drawflags);

            GL.Finish();

            // and then, SwapBuffers displays everything on the screen in Framework
        }
Esempio n. 3
0
 public ACView()
 {
     _drawflags = DF_STANDARD;
     if (STARTBITMAPBACKGROUNDFLAG)
     {
         _drawflags |= DF_FULL_BACKGROUND;
     }
     else
     {
         _drawflags &= ~DF_FULL_BACKGROUND;
     }
     if (STARTSOLIDBACKGROUNDFLAG)
     {
         _drawflags |= DF_SIMPLIFIED_BACKGROUND;
     }
     else
     {
         _drawflags &= ~DF_SIMPLIFIED_BACKGROUND;
     }
     _pviewpointcritter          = new cCritterViewer(this);
     _pgraphics                  = new cGraphicsOpenGL();
     _pviewpointcritter.Listener = new cListenerViewerRide();
     pgame().Viewpoint           = _pviewpointcritter;
 }