From cee712105850ac3385cd0091a923438167433f9f Mon Sep 17 00:00:00 2001
From: TSR Berry <20988865+TSRBerry@users.noreply.github.com>
Date: Sat, 8 Apr 2023 01:22:00 +0200
Subject: Move solution and projects to src

---
 src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs | 44 ++++++++++++++++++++++++
 1 file changed, 44 insertions(+)
 create mode 100644 src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs

(limited to 'src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs')

diff --git a/src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs b/src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs
new file mode 100644
index 00000000..2ab9dffb
--- /dev/null
+++ b/src/Ryujinx.Graphics.OpenGL/Image/TextureBase.cs
@@ -0,0 +1,44 @@
+using OpenTK.Graphics.OpenGL;
+using Ryujinx.Graphics.GAL;
+
+namespace Ryujinx.Graphics.OpenGL.Image
+{
+    class TextureBase
+    {
+        public int Handle { get; protected set; }
+
+        public TextureCreateInfo Info { get; }
+
+        public int Width => Info.Width;
+        public int Height => Info.Height;
+        public float ScaleFactor { get; }
+
+        public Target Target => Info.Target;
+        public Format Format => Info.Format;
+
+        public TextureBase(TextureCreateInfo info, float scaleFactor = 1f)
+        {
+            Info = info;
+            ScaleFactor = scaleFactor;
+
+            Handle = GL.GenTexture();
+        }
+
+        public void Bind(int unit)
+        {
+            Bind(Target.Convert(), unit);
+        }
+
+        protected void Bind(TextureTarget target, int unit)
+        {
+            GL.ActiveTexture(TextureUnit.Texture0 + unit);
+            GL.BindTexture(target, Handle);
+        }
+
+        public static void ClearBinding(int unit)
+        {
+            GL.ActiveTexture(TextureUnit.Texture0 + unit);
+            GL.BindTextureUnit(unit, 0);
+        }
+    }
+}
-- 
cgit v1.2.3-70-g09d2