// Copyright (c) ppy Pty Ltd . Licensed under the MIT Licence. // See the LICENCE file in the repository root for full licence text. using System; using osuTK; using osu.Framework.Graphics.Sprites; using osu.Framework.Graphics.OpenGL.Vertices; namespace osu.Framework.Graphics.Video { internal class VideoSpriteDrawNode : SpriteDrawNode { public VideoSpriteDrawNode(Video source) : base(source.Sprite) { yuvCoeff = source.ConversionMatrix; } private Matrix3 yuvCoeff; private int yLoc, uLoc = 1, vLoc = 2; public override void Draw(Action vertexAction) { Shader.GetUniform("m_SamplerY").UpdateValue(ref yLoc); Shader.GetUniform("m_SamplerU").UpdateValue(ref uLoc); Shader.GetUniform("m_SamplerV").UpdateValue(ref vLoc); Shader.GetUniform("yuvCoeff").UpdateValue(ref yuvCoeff); base.Draw(vertexAction); } } }