protected override void OnLoad(EventArgs e) { base.OnLoad(e); GraphicsSettings.Init(); GLDebug.Init(); ShaderProgram.Init(); Primitive.Init(); testLayer = new GameObjectLayer(ClientSize.Width, ClientSize.Height); testTexture = Texture2D.FromFile("testball.png"); var testSprite = new Sprite(testTexture, new Vector2(32, 32), new Vector2(0, 0), new Vector2(16, 0), new Vector2(32, 0), new Vector2(48, 0), new Vector2(64, 0), new Vector2(80, 0), new Vector2(96, 0), new Vector2(112, 0) ); var rand = new Random(); for (int i = 0; i < 20000; i++) { var newObj = new SpriteObject(testSprite, new Vector3(rand.Next(0, ClientSize.Width), rand.Next(0, ClientSize.Height), 0)); newObj.Layer = testLayer; newObj.Frame = rand.Next(0, 7); newObj.AnimationFPS = 15f; } CursorVisible = true; FPSSampleStart = DateTime.Now; }
public virtual void Delete() { _Layer = null; Deleted = true; }