A game framework written with osu! in mind.
at master 32 lines 1.1 kB view raw
1// Copyright (c) ppy Pty Ltd <contact@ppy.sh>. Licensed under the MIT Licence. 2// See the LICENCE file in the repository root for full licence text. 3 4using osu.Framework.Allocation; 5using osu.Framework.Graphics.Shaders; 6using osu.Framework.Graphics.Sprites; 7using osu.Framework.Platform; 8 9namespace osu.Framework.Graphics.Video 10{ 11 /// <summary> 12 /// A sprite which holds a video with a custom conversion matrix. 13 /// </summary> 14 internal class VideoSprite : Sprite 15 { 16 private readonly Video video; 17 18 public VideoSprite(Video video) 19 { 20 this.video = video; 21 } 22 23 [BackgroundDependencyLoader] 24 private void load(GameHost gameHost, ShaderManager shaders) 25 { 26 TextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.VIDEO); 27 RoundedTextureShader = shaders.Load(VertexShaderDescriptor.TEXTURE_2, FragmentShaderDescriptor.VIDEO_ROUNDED); 28 } 29 30 protected override DrawNode CreateDrawNode() => new VideoSpriteDrawNode(video); 31 } 32}