Beispiel #1
0
        public void Draw()
        {
            if (Hidden)
            {
                return;
            }

            GL.Color4(color);

            Matrix4 model = Matrix4.Scale(80f / 50f) * Matrix4.CreateTranslation(new Vector3(position));

            GL.MultMatrix(ref model);

            GL.BindTexture(TextureTarget.Texture2D, 0);

            GL.BindBuffer(BufferTarget.ArrayBuffer, vertVbo);
            GL.VertexPointer(3, VertexPointerType.Float, 32, 0);
            GL.TexCoordPointer(2, TexCoordPointerType.Float, 32, 12);
            GL.NormalPointer(NormalPointerType.Float, 32, 20);
            GL.BindBuffer(BufferTarget.ArrayBuffer, 0);

            GL.BindBuffer(BufferTarget.ElementArrayBuffer, indVbo);
            GL.DrawElements(BeginMode.Triangles, BlockData.GetIndexCount(), DrawElementsType.UnsignedShort, 0);
            GL.BindBuffer(BufferTarget.ElementArrayBuffer, 0);

            GL.Color4(new Color4(1f, 1f, 1f, 1f));
        }
Beispiel #2
0
 public PuzzleBox(float xPos, float yPos)
     : base(xPos, yPos)
 {
     vertVbo  = BlockData.GetVertexBufferID();
     indVbo   = BlockData.GetIndexBufferID();
     indCount = BlockData.GetIndexCount();
     tex      = Resources.Textures["block.png"];
 }
 public Cannon(float xPos, float yPos)
     : base(xPos, yPos)
 {
     BallSpeed = 5000000;
     Stupidity = 0;
     vertVbo   = BlockData.GetVertexBufferID();
     indVbo    = BlockData.GetIndexBufferID();
     indCount  = BlockData.GetIndexCount();
     tex       = Resources.Textures["block.png"];
 }
 public LaserShooter(float xPos, float yPos)
     : base(xPos, yPos)
 {
     ShotsPerSecond = 1;
     BeamWidth      = 5;
     Stupidity      = 0;
     vertVbo        = BlockData.GetVertexBufferID();
     indVbo         = BlockData.GetIndexBufferID();
     indCount       = BlockData.GetIndexCount();
     tex            = Resources.Textures["block.png"];
 }