title: C# forms too slow for a 2D game?
body: <p>I made this game with Python+Pygame, but it was slow, so I tried it with C# and its forms. It's even slower! I get only 20fps on a i5 radeon 6770m NTB millions of times faster than hardware I want this game to run and I haven't even finished the game yet, it's only rendering a map. It's a remake of a game that was run with slow several MHz processors. It's map containes 400x200 tiles and camera shows only 79*79. I also installed unity 4.5; is it worth learning it, would it bring me significant perfomance increase - if someone knows it how would I do a map consisting of 600*400 tiles randomly either dark tile or bright; it has to be "collidable"? Or I doing sth wrong in forms?</p>
  
  <pre><code>public void render()
      {
  
          Bitmap frame = new Bitmap(Game.CANVAS_WIDTH, Game.CANVAS_HEIGHT);
          Graphics frameGraphics = Graphics.FromImage(frame);
  
          TextureID[,] textures = Background.Blocks;
  
          while (true)
          {
  
              //frameGraphics.FillRectangle(new SolidBrush(Color.Aqua), 0, 0, Game.CANVAS_WIDTH, Game.CANVAS_HEIGHT);
              for (int x = 0; x &lt; Game.AR_WIDTH; x++)
              {
                  int xx = x * Game.TILE_SIDE - game.green_tank_pos[0] + Game.DIFF;
                  if (xx &lt; 0) continue;
                  if (xx &gt; Game.CANVAS_WIDTH) break;
  
                  for (int y = 0; y &lt; Game.AR_HEIGHT; y++)
                  {
                      int yy = y * Game.TILE_SIDE - game.green_tank_pos[1] + Game.DIFF;
                      if (yy &lt; 0) continue;
                      if (yy &gt; Game.CANVAS_HEIGHT) continue;
                      switch(textures[x,y])
                      {
                          case TextureID.dark:
                              frameGraphics.DrawImage(tex_dark_gnd, xx, yy);
                              break;
                          case TextureID.bright:
                              frameGraphics.DrawImage(tex_bright_gnd, x * Game.TILE_SIDE - game.green_tank_pos[0] + Game.DIFF, y * Game.TILE_SIDE - game.green_tank_pos[1] + Game.DIFF);
                              break;
                      }
                  }
              }
  
              frameGraphics.DrawImage(tex_green_tank, Game.DIFF, Game.DIFF);
  
  
  
              drawHandle.DrawImage(frame, 0, 0);
  </code></pre>