Exemple #1
0
 public void Update(double elapsedTime)
 {
     _delayInSeconds -= elapsedTime;
     if (_delayInSeconds <= 0)
     {
         _delayInSeconds = 3;
         _system.ChangeState("title");
     }
 }
Exemple #2
0
        public Form1()
        {
            //initialize windows stuff
            InitializeComponent();

            //initialize OpenGL
            _openGLControl.InitializeContexts();

            //Initialize DevIl
            Il.ilInit();
            Ilu.iluInit();
            Ilut.ilutInit();
            Ilut.ilutRenderer(Ilut.ILUT_OPENGL);

            //Load Textures
            _textureManager.LoadTexture("face", "face_alpha.tif");
            _textureManager.LoadTexture("face_alpha", "face.tif");
            _textureManager.LoadTexture("font", "font.tga");

            //Adding States to system
            _system.AddState("splash", new SplashScreenState(_system));
            _system.AddState("title", new TitleMenuState(_system));
            _system.AddState("sprite", new DrawSpriteState(_textureManager));
            _system.AddState("sprite_test", new TestSpriteClassState(_textureManager));
            _system.AddState("text_test", new TextTestState(_textureManager));
            _system.AddState("FPS_test", new FPSTestState(_textureManager));
            _system.AddState("waveform", new WaveformGraphState());
            _system.AddState("effect_test_state", new SpecialEffectsState(_textureManager));
            _system.AddState("circle_test_state", new CircleIntersectionState(_input));
            _system.AddState("rectang_test_state", new RectangleIntersectionState(_input));
            _system.AddState("tween_test_state", new TweenTestState(_textureManager));
            _system.AddState("matrix_test_state", new MatrixTestState(_textureManager));


            //INitilize splash state
            _system.ChangeState("FPS_test");



            if (_fullscreen)
            {
                FormBorderStyle = FormBorderStyle.None;
                WindowState     = FormWindowState.Maximized;
            }
            else
            {
                ClientSize = new Size(1280, 720);
            }

            //2D grahpics setup
            Setup2DGrahpics(ClientSize.Width, ClientSize.Height);

            //Initiate Fastloop
            _fastLoop = new FastLoop(GameLoop);
        }