Esempio n. 1
0
 private MyApplication()
 {
     //setup
     gameWindow = new GameWindow(700, 700);
     gameWindow.KeyDown += (s, arg) => gameWindow.Close();
     gameWindow.Resize += (s, arg) => GL.Viewport(0, 0, gameWindow.Width, gameWindow.Height);
     gameWindow.RenderFrame += GameWindow_RenderFrame;
     gameWindow.RenderFrame += (s, arg) => gameWindow.SwapBuffers();
     //load font
     font = new TextureFont(TextureLoader.FromBitmap(Resourcen.Blood_Bath_2), 10, 32, .8f, 1, .7f);
     //background clear color
     GL.ClearColor(Color.Black);
     //for transparency in textures
     GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
 }
Esempio n. 2
0
 public MyApplication()
 {
     gameWindow.Resize += GameWindow_Resize;
     gameWindow.KeyDown += (sender, e) => { if (Key.Escape == e.Key)	gameWindow.Exit(); };
     gameWindow.MouseDown += GameWindow_MouseDown;
     gameWindow.RenderFrame += GameWindow_RenderFrame;
     gameWindow.RenderFrame += (sender, e) => { gameWindow.SwapBuffers(); };
     GL.ClearColor(Color.Black);
     for (int x = 0; x < gridRes; ++x)
     {
         for (int y = 0; y < gridRes; ++y)
         {
             grid[x, y] = FieldType.EMPTY;
         }
     }
     texWhite = TextureLoader.FromBitmap(Resourcen.white);
     texBlack = TextureLoader.FromBitmap(Resourcen.black);
     texWater = TextureLoader.FromBitmap(Resourcen.water);
     font = new TextureFont(TextureLoader.FromBitmap(Resourcen.Fire_2), 10, 32, 1.0f, 0.9f, 0.5f);
 }
Esempio n. 3
0
 public void RegisterFont(TextureFont textureFont)
 {
     this.font = textureFont;
 }