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);
}