A game framework written with osu! in mind.
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.OpenGL;
5using osu.Framework.Graphics.OpenGL.Textures;
6using osu.Framework.Graphics.Primitives;
7
8namespace osu.Framework.Graphics.Textures
9{
10 internal class TextureWhitePixel : Texture
11 {
12 public TextureWhitePixel(TextureGL textureGl)
13 : base(textureGl)
14 {
15 }
16
17 protected override RectangleF TextureBounds(RectangleF? textureRect = null)
18 {
19 // We need non-zero texture bounds for EdgeSmoothness to work correctly.
20 // Let's be very conservative and use a tenth of the size of a pixel in the
21 // largest possible texture.
22 float smallestPixelTenth = 0.1f / GLWrapper.MaxTextureSize;
23 return new RectangleF(0, 0, smallestPixelTenth, smallestPixelTenth);
24 }
25 }
26}