diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Program.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Program.cs index 57adaad57d..c7179ffad3 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Program.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Program.cs @@ -18,13 +18,14 @@ class Program private static Texture Texture; private static Shader Shader; + // OpenGL has image origin in the bottom-left corner. private static readonly float[] Vertices = { //X Y Z U V - 0.5f, 0.5f, 0.0f, 1f, 1f, - 0.5f, -0.5f, 0.0f, 1f, 0f, - -0.5f, -0.5f, 0.0f, 0f, 0f, - -0.5f, 0.5f, 0.5f, 0f, 1f + 0.5f, 0.5f, 0.0f, 1f, 0f, + 0.5f, -0.5f, 0.0f, 1f, 1f, + -0.5f, -0.5f, 0.0f, 0f, 1f, + -0.5f, 0.5f, 0.5f, 0f, 0f }; private static readonly uint[] Indices = diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Texture.cs index d919f0c71d..b219101321 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Texture.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 1.4 - Textures/Texture.cs @@ -16,10 +16,8 @@ public unsafe Texture(GL gl, string path) { //Loading an image using imagesharp. Image img = (Image) Image.Load(path); - //We need to flip our image as image sharps coordinates has origin (0, 0) in the top-left corner, - //whereas openGL has origin in the bottom-left corner. - img.Mutate(x => x.Flip(FlipMode.Vertical)); + // OpenGL has image origin in the bottom-left corner. fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) { //Loading the actual image. diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Program.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Program.cs index c7eaaf9db8..ad895af033 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Program.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Program.cs @@ -23,10 +23,10 @@ class Program private static readonly float[] Vertices = { //X Y Z U V - 0.5f, 0.5f, 0.0f, 1f, 1f, - 0.5f, -0.5f, 0.0f, 1f, 0f, - -0.5f, -0.5f, 0.0f, 0f, 0f, - -0.5f, 0.5f, 0.5f, 0f, 1f + 0.5f, 0.5f, 0.0f, 1f, 0f, + 0.5f, -0.5f, 0.0f, 1f, 1f, + -0.5f, -0.5f, 0.0f, 0f, 1f, + -0.5f, 0.5f, 0.5f, 0f, 0f }; private static readonly uint[] Indices = diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Texture.cs index 15e3d3fa53..77165e5086 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Texture.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 1.5 - Transformations/Texture.cs @@ -16,8 +16,7 @@ public class Texture : IDisposable public unsafe Texture(GL gl, string path) { Image img = (Image) Image.Load(path); - img.Mutate(x => x.Flip(FlipMode.Vertical)); - + fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) { Load(gl, data, (uint) img.Width, (uint) img.Height); diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Program.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Program.cs index 723b47f1d4..64b0c22726 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Program.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Program.cs @@ -39,47 +39,47 @@ class Program private static readonly float[] Vertices = { //X Y Z U V - -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, - 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, - 0.5f, 0.5f, -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0.5f, 0.0f, 1.0f, + 0.5f, -0.5f, 0.5f, 1.0f, 1.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, 0.5f, 0.5f, 0.5f, 1.0f, 0.0f, -0.5f, 0.5f, 0.5f, 0.0f, 0.0f, - -0.5f, 0.5f, -0.5f, 0.0f, 1.0f + -0.5f, -0.5f, 0.5f, 0.0f, 1.0f, + + -0.5f, 0.5f, 0.5f, 1.0f, 1.0f, + -0.5f, 0.5f, -0.5f, 1.0f, 0.0f, + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, + -0.5f, -0.5f, 0.5f, 0.0f, 1.0f, + -0.5f, 0.5f, 0.5f, 1.0f, 1.0f, + + 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, + 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, + 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, + 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 0.0f, 1.0f, + 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, + + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, + 0.5f, -0.5f, -0.5f, 1.0f, 0.0f, + 0.5f, -0.5f, 0.5f, 1.0f, 1.0f, + 0.5f, -0.5f, 0.5f, 1.0f, 1.0f, + -0.5f, -0.5f, 0.5f, 0.0f, 1.0f, + -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, + + -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, + 0.5f, 0.5f, -0.5f, 1.0f, 0.0f, + 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, + 0.5f, 0.5f, 0.5f, 1.0f, 1.0f, + -0.5f, 0.5f, 0.5f, 0.0f, 1.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 0.0f }; private static readonly uint[] Indices = diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Texture.cs index 53ebe97ae1..7cee47d0fd 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Texture.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 2.2 - Camera/Texture.cs @@ -15,8 +15,7 @@ public class Texture : IDisposable public unsafe Texture(GL gl, string path) { Image img = (Image) Image.Load(path); - img.Mutate(x => x.Flip(FlipMode.Vertical)); - + fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) { Load(gl, data, (uint) img.Width, (uint) img.Height); diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 3.1 - Ambient Lighting/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 3.1 - Ambient Lighting/Texture.cs deleted file mode 100644 index 53ebe97ae1..0000000000 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 3.1 - Ambient Lighting/Texture.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Silk.NET.OpenGL; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using System; -using System.Runtime.InteropServices; - -namespace Tutorial -{ - public class Texture : IDisposable - { - private uint _handle; - private GL _gl; - - public unsafe Texture(GL gl, string path) - { - Image img = (Image) Image.Load(path); - img.Mutate(x => x.Flip(FlipMode.Vertical)); - - fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) - { - Load(gl, data, (uint) img.Width, (uint) img.Height); - } - - img.Dispose(); - } - - public unsafe Texture(GL gl, Span data, uint width, uint height) - { - fixed (void* d = &data[0]) - { - Load(gl, d, width, height); - } - } - - private unsafe void Load(GL gl, void* data, uint width, uint height) - { - _gl = gl; - - _handle = _gl.GenTexture(); - Bind(); - - _gl.TexImage2D(TextureTarget.Texture2D, 0, (int) InternalFormat.Rgba, width, height, 0, PixelFormat.Rgba, PixelType.UnsignedByte, data); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int) GLEnum.Linear); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int) GLEnum.Linear); - _gl.GenerateMipmap(TextureTarget.Texture2D); - } - - public void Bind(TextureUnit textureSlot = TextureUnit.Texture0) - { - _gl.ActiveTexture(textureSlot); - _gl.BindTexture(TextureTarget.Texture2D, _handle); - } - - public void Dispose() - { - _gl.DeleteTexture(_handle); - } - } -} diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 3.2 - Diffuse Lighting/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 3.2 - Diffuse Lighting/Texture.cs deleted file mode 100644 index 53ebe97ae1..0000000000 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 3.2 - Diffuse Lighting/Texture.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Silk.NET.OpenGL; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using System; -using System.Runtime.InteropServices; - -namespace Tutorial -{ - public class Texture : IDisposable - { - private uint _handle; - private GL _gl; - - public unsafe Texture(GL gl, string path) - { - Image img = (Image) Image.Load(path); - img.Mutate(x => x.Flip(FlipMode.Vertical)); - - fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) - { - Load(gl, data, (uint) img.Width, (uint) img.Height); - } - - img.Dispose(); - } - - public unsafe Texture(GL gl, Span data, uint width, uint height) - { - fixed (void* d = &data[0]) - { - Load(gl, d, width, height); - } - } - - private unsafe void Load(GL gl, void* data, uint width, uint height) - { - _gl = gl; - - _handle = _gl.GenTexture(); - Bind(); - - _gl.TexImage2D(TextureTarget.Texture2D, 0, (int) InternalFormat.Rgba, width, height, 0, PixelFormat.Rgba, PixelType.UnsignedByte, data); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int) GLEnum.Linear); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int) GLEnum.Linear); - _gl.GenerateMipmap(TextureTarget.Texture2D); - } - - public void Bind(TextureUnit textureSlot = TextureUnit.Texture0) - { - _gl.ActiveTexture(textureSlot); - _gl.BindTexture(TextureTarget.Texture2D, _handle); - } - - public void Dispose() - { - _gl.DeleteTexture(_handle); - } - } -} diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 3.3 - Specular Lighting/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 3.3 - Specular Lighting/Texture.cs deleted file mode 100644 index 53ebe97ae1..0000000000 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 3.3 - Specular Lighting/Texture.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Silk.NET.OpenGL; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using System; -using System.Runtime.InteropServices; - -namespace Tutorial -{ - public class Texture : IDisposable - { - private uint _handle; - private GL _gl; - - public unsafe Texture(GL gl, string path) - { - Image img = (Image) Image.Load(path); - img.Mutate(x => x.Flip(FlipMode.Vertical)); - - fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) - { - Load(gl, data, (uint) img.Width, (uint) img.Height); - } - - img.Dispose(); - } - - public unsafe Texture(GL gl, Span data, uint width, uint height) - { - fixed (void* d = &data[0]) - { - Load(gl, d, width, height); - } - } - - private unsafe void Load(GL gl, void* data, uint width, uint height) - { - _gl = gl; - - _handle = _gl.GenTexture(); - Bind(); - - _gl.TexImage2D(TextureTarget.Texture2D, 0, (int) InternalFormat.Rgba, width, height, 0, PixelFormat.Rgba, PixelType.UnsignedByte, data); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int) GLEnum.Linear); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int) GLEnum.Linear); - _gl.GenerateMipmap(TextureTarget.Texture2D); - } - - public void Bind(TextureUnit textureSlot = TextureUnit.Texture0) - { - _gl.ActiveTexture(textureSlot); - _gl.BindTexture(TextureTarget.Texture2D, _handle); - } - - public void Dispose() - { - _gl.DeleteTexture(_handle); - } - } -} diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 3.4 - Materials/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 3.4 - Materials/Texture.cs deleted file mode 100644 index 53ebe97ae1..0000000000 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 3.4 - Materials/Texture.cs +++ /dev/null @@ -1,62 +0,0 @@ -using Silk.NET.OpenGL; -using SixLabors.ImageSharp; -using SixLabors.ImageSharp.PixelFormats; -using SixLabors.ImageSharp.Processing; -using System; -using System.Runtime.InteropServices; - -namespace Tutorial -{ - public class Texture : IDisposable - { - private uint _handle; - private GL _gl; - - public unsafe Texture(GL gl, string path) - { - Image img = (Image) Image.Load(path); - img.Mutate(x => x.Flip(FlipMode.Vertical)); - - fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) - { - Load(gl, data, (uint) img.Width, (uint) img.Height); - } - - img.Dispose(); - } - - public unsafe Texture(GL gl, Span data, uint width, uint height) - { - fixed (void* d = &data[0]) - { - Load(gl, d, width, height); - } - } - - private unsafe void Load(GL gl, void* data, uint width, uint height) - { - _gl = gl; - - _handle = _gl.GenTexture(); - Bind(); - - _gl.TexImage2D(TextureTarget.Texture2D, 0, (int) InternalFormat.Rgba, width, height, 0, PixelFormat.Rgba, PixelType.UnsignedByte, data); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapS, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureWrapT, (int) GLEnum.ClampToEdge); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int) GLEnum.Linear); - _gl.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int) GLEnum.Linear); - _gl.GenerateMipmap(TextureTarget.Texture2D); - } - - public void Bind(TextureUnit textureSlot = TextureUnit.Texture0) - { - _gl.ActiveTexture(textureSlot); - _gl.BindTexture(TextureTarget.Texture2D, _handle); - } - - public void Dispose() - { - _gl.DeleteTexture(_handle); - } - } -} diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Program.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Program.cs index 9c8c93de16..1c2793b189 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Program.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Program.cs @@ -39,47 +39,47 @@ class Program private static readonly float[] Vertices = { //X Y Z Normals U V - -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, - 0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 0.0f, - 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, - 0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 1.0f, 1.0f, - -0.5f, 0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 1.0f, - -0.5f, -0.5f, -0.5f, 0.0f, 0.0f, -1.0f, 0.0f, 0.0f, - - -0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 0.0f, 0.0f, - 0.5f, -0.5f, 0.5f, 0.0f, 0.0f, 1.0f, 1.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f, 0.0f, 1.0f, 0.0f, 0.0f, 0.0f, + -0.5f, 0.5f, -0.5f, 0.0f, 1.0f, 0.0f, 0.0f, 1.0f }; private static readonly uint[] Indices = diff --git a/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Texture.cs b/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Texture.cs index 53ebe97ae1..7cee47d0fd 100644 --- a/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Texture.cs +++ b/examples/CSharp/OpenGL Tutorials/Tutorial 3.5 - Lighting Maps/Texture.cs @@ -15,8 +15,7 @@ public class Texture : IDisposable public unsafe Texture(GL gl, string path) { Image img = (Image) Image.Load(path); - img.Mutate(x => x.Flip(FlipMode.Vertical)); - + fixed (void* data = &MemoryMarshal.GetReference(img.GetPixelRowSpan(0))) { Load(gl, data, (uint) img.Width, (uint) img.Height);