예제 #1
0
        public MyApplication()
        {
            gameWindow = new GameWindow();
            gameWindow.Load += GameWindow_Load;
            gameWindow.Resize += GameWindow_Resize;
            gameWindow.UpdateFrame += GameWindow_UpdateFrame;
            gameWindow.RenderFrame += GameWindow_RenderFrame;
            gameWindow.RenderFrame += (sender, e) => { gameWindow.SwapBuffers(); };

            renderer = new Renderer();
            //private static TextureFont font = new TextureFont("../../media/bitmap_fonts/OpenTKTextureFont.png", 16, 0, 0.8f, 0.8f, 0.8f);
            //private static TextureFont font = new TextureFont("../../media/bitmap_fonts/Orange with Shadow.png", 10, 32, 1.0f, 1.0f, 0.9f);
            //private static TextureFont font = new TextureFont("../../media/bitmap_fonts/LED Green.png", 10, 32, 0.9f, 0.7f, 0.8f);
            //private static TextureFont font = new TextureFont("../../media/bitmap_fonts/Bamboo.png", 10, 32, 0.8f, 0.7f, 1.0f);
            renderer.RegisterFont(new TextureFont(TextureLoader.FromBitmap(Resourcen.Video_Phreak), 10, 32));
            renderer.Register("player", TextureLoader.FromBitmap(Resourcen.blueships1));
            renderer.Register("enemy", TextureLoader.FromBitmap(Resourcen.redship4));
            renderer.Register("bulletPlayer", TextureLoader.FromBitmap(Resourcen.blueLaserRay));
            renderer.Register("bulletEnemy", TextureLoader.FromBitmap(Resourcen.redLaserRay));
            renderer.Register("explosion", TextureLoader.FromBitmap(Resourcen.explosion));

            this.galaxyBirds = new GameLogic(renderer);
            timeSource.Start();
        }