A game framework written with osu! in mind.
at master 30 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.Graphics.Primitives; 5using osuTK.Graphics.ES30; 6 7namespace osu.Framework.Graphics.OpenGL.Textures 8{ 9 /// <summary> 10 /// A special texture which refers to the area of a texture atlas which is white. 11 /// Allows use of such areas while being unaware of whether we need to bind a texture or not. 12 /// </summary> 13 internal class TextureGLAtlasWhite : TextureGLSub 14 { 15 public TextureGLAtlasWhite(TextureGLSingle parent) 16 : base(new RectangleI(0, 0, 1, 1), parent) 17 { 18 Opacity = Opacity.Opaque; 19 } 20 21 internal override bool Bind(TextureUnit unit, WrapMode wrapModeS, WrapMode wrapModeT) 22 { 23 //we can use the special white space from any atlas texture. 24 if (GLWrapper.AtlasTextureIsBound(unit)) 25 return true; 26 27 return base.Bind(unit, wrapModeS, wrapModeT); 28 } 29 } 30}