Exemple #1
0
        public Form1()
        {
            _fastLoop = new FastLoop(GameLoop);
            _system   = new StateSystem();

            InitializeComponent();
            Stage.InitializeContexts();
            Setup2DGraphics(ClientSize.Width, ClientSize.Height);
            Sys.LoadMap();
            Sys.InitializeMap();

            Sys.halfHeight = ClientSize.Height / 2;
            Sys.halfWidth  = ClientSize.Width / 2;

            Sys.preX = ClientSize.Width / Sys.currentMap.map.GetLength(0);
            Sys.preY = ClientSize.Height / Sys.currentMap.map.GetLength(1);

            Gl.glScalef(0.02f / Sys.preX, 0.02f / Sys.preY, 1);

            _system.AddState("map", Sys.currentMap);
            _system.ChangeState("map");

            Form2 frm = new Form2();

            frm.Show();

            timer1.Enabled = true;
            //Gl.glTranslatef(-ClientSize.Width / 2, -ClientSize.Height / 2, 0);
        }
Exemple #2
0
        public Form1()
        {
            //Initialize DeviL
            Il.ilInit();
            Ilu.iluInit();
            Ilut.ilutInit();
            Ilut.ilutRenderer(Ilut.ILUT_OPENGL);

            FastLoop _fastLoop = new FastLoop(GameLoop);

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

            // Add all the states that will be used.
            _system.AddState("splash", new SplashScreenState(_system));
            _system.AddState("title_menu", new TitleMenuState());
            _system.AddState("sprite_test", new DrawSpriteState());

            // Select the start state
            _system.ChangeState("sprite_test");
        }
        public Form1()
        {
            InitializeComponent();
            _openGLControl.InitializeContexts();
            _openGLControl.SizeChanged += new EventHandler(OnOpenGLControlResized);

            _input.Mouse    = new Mouse(this, _openGLControl);
            _input.Keyboard = new Keyboard(_openGLControl);
            _scene          = new Scene();

            InitializeDisplay();
            // InitializeSounds();
            InitializeTextures();
            // InitializeFonts();
            InitializeGameState();


            _layers = new Layers(_scene, _textureManager);
            _layers.Show();

            _modeComboBox.SelectedIndex = 1;


            _fastLoop = new FastLoop(GameLoop);
        }
        public void StateSystemUpdateTest()
        {
            stateSystemUpdate = new StateSystem();

            stateSystemUpdate.AddState("drawSprite", new DrawSpriteState());
            stateSystemUpdate.ChangeState("drawSprite");

            FastLoop fastLoop = new FastLoop(GameLoopTest);
        }
        public void StateSystemUpdateTest()
        {
            stateSystemUpdate = new StateSystem();

            stateSystemUpdate.AddState("drawSprite", new DrawSpriteState());
            stateSystemUpdate.ChangeState("drawSprite");

            FastLoop fastLoop = new FastLoop(GameLoopTest);
        }
Exemple #6
0
        public Form1()
        {
            _fastLoop = new FastLoop(GameLoop);

            InitializeComponent();

            if (_fulllScreen)
            {
                FormBorderStyle = FormBorderStyle.None;
                WindowState     = FormWindowState.Maximized;
            }
        }
        public Form1()
        {
            InitializeComponent();
            simpleOpenGlControl1.InitializeContexts();

            InitializeDisplay();
            InitializeTextures();
            InitializeGameState();

            _input.Mouse = new Mouse(this, simpleOpenGlControl1);

            _fastLoop = new FastLoop(GameLoop);
        }
Exemple #8
0
        public void PeekMessageTest()
        {
            Message msg              = new Message(); // TODO: Initialize to an appropriate value
            Message msgExpected      = new Message(); // TODO: Initialize to an appropriate value
            IntPtr  hWnd             = new IntPtr();  // TODO: Initialize to an appropriate value
            uint    messageFilterMin = 0;             // TODO: Initialize to an appropriate value
            uint    messageFilterMax = 0;             // TODO: Initialize to an appropriate value
            uint    flags            = 0;             // TODO: Initialize to an appropriate value
            bool    expected         = false;         // TODO: Initialize to an appropriate value
            bool    actual;

            actual = FastLoop.PeekMessage(out msg, hWnd, messageFilterMin, messageFilterMax, flags);
            Assert.AreEqual(msgExpected, msg);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }
Exemple #9
0
        public Form1()
        {
            InitializeComponent();
            _simpleOpenGLControl.InitializeContexts();

            _input.Mouse    = new Mouse(this, _simpleOpenGLControl);
            _input.Keyboard = new Keyboard(_simpleOpenGLControl);

            InitializeDisplay();
            InitializeSounds();
            InitializeTextures();
            InitializeFonts();
            InitializeGameState();

            _fastLoop = new FastLoop(GameLoop);
        }
Exemple #10
0
        //public static byte[,] m_ChessBoard = new byte[10, 9];

        public Form1()
        {
            InitializeComponent();
            simpleOpenGlControl.InitializeContexts();

            _input.Mouse    = new Mouse(this, simpleOpenGlControl);
            _input.Keyboard = new Keyboard(simpleOpenGlControl);

            WindowSize = InitializeDisplay();
            InitializeSounds();
            InitializeTextures();
            InitializeGameData();
            InitializeFonts();
            InitializeGameState(WindowSize);

            _fastLoop = new FastLoop(GameLoop);
        }
Exemple #11
0
 public FormMainWindow()
 {
     InitializeComponent();
     _fastLoop = new FastLoop(GameLoop);
     _stopwatch.Start();
 }
Exemple #12
0
 public void CreateFastLoop()
 {
     PreciseTimer preciseTimer = new PreciseTimer();
     FastLoop fastloop = new FastLoop(GameLoopTest);
 }
Exemple #13
0
 public void CreateFastLoop()
 {
     PreciseTimer preciseTimer = new PreciseTimer();
     FastLoop     fastloop     = new FastLoop(GameLoopTest);
 }