Пример #1
0
        public override void Draw(SharpGL.OpenGL gl)
        {
            if (_trail > 1)
            {
                for (int t = 0; t < _trail; t++)
                {
                    PointFloat   trailPos  = GetPosition();
                    PointFloat   vel       = GetVelocity();
                    PointFloat   dit       = new PointFloat(trailPos.x - vel.x * t, trailPos.y - vel.y * t);
                    PointFloat[] pointData = RenderLogics.RectPoint(dit, GetSize(), GetRotation());

                    GetTexture().UseTexure(gl);
                    gl.Begin(OpenGL.GL_QUADS);
                    byte[] col = GetColor();
                    gl.Color(col[0], col[1], col[2]);
                    gl.TexCoord(0, 0);
                    gl.Vertex(pointData[1].x, pointData[1].y);
                    gl.TexCoord(0, 1);
                    gl.Vertex(pointData[0].x, pointData[0].y);
                    gl.TexCoord(1, 1);
                    gl.Vertex(pointData[3].x, pointData[3].y);
                    gl.TexCoord(1, 0);
                    gl.Vertex(pointData[2].x, pointData[2].y);
                    gl.End();
                }
            }
            base.Draw(gl);
        }
Пример #2
0
        public override void Draw(OpenGL gl)
        {
            PointFloat _size = GetSize();

            PointFloat[] pointData = RenderLogics.RectPoint(GetPosition(), _size, GetRotation());
            byte[]       color     = GetColor();
            GetTexture().UseTexure(gl);
            gl.Begin(OpenGL.GL_QUADS);
            gl.Color(color[0], color[1], color[2]);
            gl.TexCoord(0, 0);
            gl.Vertex(pointData[1].x, pointData[1].y);
            gl.TexCoord(0, 1);
            gl.Vertex(pointData[0].x, pointData[0].y);
            gl.TexCoord(1, 1);
            gl.Vertex(pointData[3].x, pointData[3].y);
            gl.TexCoord(1, 0);
            gl.Vertex(pointData[2].x, pointData[2].y);
            gl.End();
        }