示例#1
0
        private void Render()
        {
            GL.Clear(ClearBufferMask.ColorBufferBit);

            GL.Color3(Color.CornflowerBlue);
            DrawLine(stick);

            GL.Color3(Color.YellowGreen);
            DrawAABB(stickAABB);

            GL.Color3(Color.Black);
            DrawAABB(Box2dExtensions.CreateFromCenterSize(0, 0, 0.02f, 0.02f));
        }
示例#2
0
 private MyVisual()
 {
     //setup
     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
     //generate birds
     for (float delta = .1f; delta < .5f; delta += .1f)
     {
         birds.Add(Box2dExtensions.CreateFromCenterSize(rotCenter.X - delta, rotCenter.Y - delta, .1f, .1f));
         birds.Add(Box2dExtensions.CreateFromCenterSize(rotCenter.X - delta, rotCenter.Y + delta, .1f, .1f));
         birds.Add(Box2dExtensions.CreateFromCenterSize(rotCenter.X + delta, rotCenter.Y - delta, .1f, .1f));
         birds.Add(Box2dExtensions.CreateFromCenterSize(rotCenter.X + delta, rotCenter.Y + delta, .1f, .1f));
     }
 }