OpenTkEngine.Core.Graphics.DrawTexture C# (CSharp) Method

DrawTexture() public static method

public static DrawTexture ( Texture texture, float x, float y, float z, float width, float height, int sx, int sy, int sw, int sh, Color4 color ) : void
texture Texture
x float
y float
z float
width float
height float
sx int
sy int
sw int
sh int
color Color4
return void
        public static void DrawTexture(Texture texture, float x, float y, float z, float width, float height, int sx, int sy, int sw, int sh, Color4 color)
        {
            float textX = (float)sx / texture.GetWidth();
            float textY = (float)sy / texture.GetHeight();
            float textW = (float)sw / texture.GetWidth();
            float textH = (float)sh / texture.GetHeight();

            if (textX != _texturePosition.X || textY != _texturePosition.Y || textW != _textureDimension.X || textH != _textureDimension.Y)
            {
                _texturePosition.X = textX;
                _texturePosition.Y = textY;
                _textureDimension.X = textW;
                _textureDimension.Y = textH;
                _texCoordsChanged = true;
            }

            texture.Bind();
            SetColor(color);

            RenderQuad(x, y, z, width, height);
        }

Same methods

Graphics::DrawTexture ( Texture texture, Rectangle dest, float z, Rectangle source, Color4 color ) : void
Graphics::DrawTexture ( Texture texture, Vector3 position, System.Vector2 size, System.Vector2 sourcePosition, System.Vector2 sourceDimension, Color4 color ) : void
Graphics::DrawTexture ( Texture texture, float x, float y, float z, Color4 color ) : void
Graphics::DrawTexture ( Texture texture, float x, float y, float z, float width, float height, Color4 color ) : void