Example #1
0
        private MyVisual()
        {
            //set waypoints of enemy
            wayPoints.Add(new Vector2(-.5f, -.5f));
            wayPoints.Add(new Vector2(.5f, -.5f));
            wayPoints.Add(new Vector2(.5f, .5f));
            wayPoints.Add(new Vector2(-.5f, .5f));
            //wayPoints.Add(new Vector2(.6f, -.7f));
            //wayPoints.Add(new Vector2(.5f, .8f));
            //wayPoints.Add(new Vector2(-.5f, .4f));
            //wayPoints.Add(new Vector2(0, 0));
            wayTangents = CatmullRomSpline.FiniteDifferenceLoop(wayPoints);

            texBird = TextureLoader.FromBitmap(Resourcen.bird1);
            //background clear color
            GL.ClearColor(Color.White);
            //for transparency in textures
            GL.BlendFunc(BlendingFactorSrc.SrcAlpha, BlendingFactorDest.OneMinusSrcAlpha);
            GL.Enable(EnableCap.Blend);             // for transparency in textures
            timeSource.Start();
        }