mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-02-24 12:36:50 +00:00
Qualify System.Drawing.Rectangle/Point/Size structs fully when necessary, to avoid namespace clash with OpenTK.Rectangle/Point/Size.
This commit is contained in:
parent
c8c652131e
commit
9d8cf134c1
|
@ -1,4 +1,4 @@
|
||||||
#region License
|
#region License
|
||||||
//
|
//
|
||||||
// The Open Toolkit Library License
|
// The Open Toolkit Library License
|
||||||
//
|
//
|
||||||
|
|
|
@ -117,7 +117,7 @@ namespace Examples.Tutorial
|
||||||
GL.GenTextures(1, out Texture);
|
GL.GenTextures(1, out Texture);
|
||||||
GL.BindTexture(TextureTarget.Texture2D, Texture);
|
GL.BindTexture(TextureTarget.Texture2D, Texture);
|
||||||
|
|
||||||
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
BitmapData data = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
||||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMinFilter, (int)TextureMinFilter.Linear);
|
||||||
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
GL.TexParameter(TextureTarget.Texture2D, TextureParameterName.TextureMagFilter, (int)TextureMagFilter.Linear);
|
||||||
|
|
|
@ -120,7 +120,7 @@ namespace Examples.Tutorial
|
||||||
GL.BindTexture(Target, texture);
|
GL.BindTexture(Target, texture);
|
||||||
|
|
||||||
Bitmap bitmap = new Bitmap(filename);
|
Bitmap bitmap = new Bitmap(filename);
|
||||||
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
BitmapData data = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||||
GL.TexImage2D(Target, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
GL.TexImage2D(Target, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
||||||
GL.Finish();
|
GL.Finish();
|
||||||
bitmap.UnlockBits(data);
|
bitmap.UnlockBits(data);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
||||||
* See license.txt for license info
|
* See license.txt for license info
|
||||||
*/
|
*/
|
||||||
|
@ -46,7 +46,7 @@ namespace Examples.Tutorial
|
||||||
GL.GenTextures(1, out texture);
|
GL.GenTextures(1, out texture);
|
||||||
GL.BindTexture(TextureTarget.Texture2D, texture);
|
GL.BindTexture(TextureTarget.Texture2D, texture);
|
||||||
|
|
||||||
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
BitmapData data = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height),
|
||||||
ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||||
|
|
||||||
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0,
|
GL.TexImage2D(TextureTarget.Texture2D, 0, PixelInternalFormat.Rgba, data.Width, data.Height, 0,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Licensed under the MIT/X11 license.
|
/* Licensed under the MIT/X11 license.
|
||||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||||
* This notice may not be removed from any source distribution.
|
* This notice may not be removed from any source distribution.
|
||||||
|
@ -159,7 +159,7 @@ namespace Examples.Tutorial
|
||||||
|
|
||||||
using (Bitmap bitmap = new Bitmap("Data/Textures/JuliaColorTable.bmp"))
|
using (Bitmap bitmap = new Bitmap("Data/Textures/JuliaColorTable.bmp"))
|
||||||
{
|
{
|
||||||
BitmapData data = bitmap.LockBits(new Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly,
|
BitmapData data = bitmap.LockBits(new System.Drawing.Rectangle(0, 0, bitmap.Width, bitmap.Height), ImageLockMode.ReadOnly,
|
||||||
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
||||||
GL.TexImage1D(TextureTarget.Texture1D, 0, PixelInternalFormat.Rgb8, data.Width, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgr,
|
GL.TexImage1D(TextureTarget.Texture1D, 0, PixelInternalFormat.Rgb8, data.Width, 0, OpenTK.Graphics.OpenGL.PixelFormat.Bgr,
|
||||||
PixelType.UnsignedByte, data.Scan0);
|
PixelType.UnsignedByte, data.Scan0);
|
||||||
|
@ -177,7 +177,7 @@ namespace Examples.Tutorial
|
||||||
{
|
{
|
||||||
Bitmap bmp = new Bitmap(this.Width, this.Height);
|
Bitmap bmp = new Bitmap(this.Width, this.Height);
|
||||||
System.Drawing.Imaging.BitmapData data =
|
System.Drawing.Imaging.BitmapData data =
|
||||||
bmp.LockBits(new Rectangle(0, 0, this.Width, this.Height),
|
bmp.LockBits(new System.Drawing.Rectangle(0, 0, this.Width, this.Height),
|
||||||
System.Drawing.Imaging.ImageLockMode.WriteOnly,
|
System.Drawing.Imaging.ImageLockMode.WriteOnly,
|
||||||
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
System.Drawing.Imaging.PixelFormat.Format24bppRgb);
|
||||||
GL.ReadPixels(0, 0, this.Width, this.Height,
|
GL.ReadPixels(0, 0, this.Width, this.Height,
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
||||||
* See license.txt for license info
|
* See license.txt for license info
|
||||||
*/
|
*/
|
||||||
|
@ -142,7 +142,7 @@ namespace Examples.WinForms
|
||||||
// Change the width of our Form to make every DataGridView column visible.
|
// Change the width of our Form to make every DataGridView column visible.
|
||||||
dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
|
dataGridView1.AutoResizeColumns(DataGridViewAutoSizeColumnsMode.AllCellsExceptHeader);
|
||||||
dataGridView1.Columns[1].Width = 450;
|
dataGridView1.Columns[1].Width = 450;
|
||||||
this.Size = dataGridView1.GetPreferredSize(new Size(2000, Height));
|
this.Size = dataGridView1.GetPreferredSize(new System.Drawing.Size(2000, Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
#endregion
|
#endregion
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
/* Copyright (c) 2006, 2007 Stefanos Apostolopoulos
|
||||||
* See license.txt for license info
|
* See license.txt for license info
|
||||||
*/
|
*/
|
||||||
|
@ -68,7 +68,7 @@ namespace Examples.Tests
|
||||||
gfx.DrawString(String.Format("Mouse {0} window.", mouse_in_window ? "inside" : "outside of"), TextFont, Brushes.White, new PointF(0, 3 * TextFont.Height));
|
gfx.DrawString(String.Format("Mouse {0} window.", mouse_in_window ? "inside" : "outside of"), TextFont, Brushes.White, new PointF(0, 3 * TextFont.Height));
|
||||||
}
|
}
|
||||||
|
|
||||||
System.Drawing.Imaging.BitmapData data = TextBitmap.LockBits(new Rectangle(0, 0, TextBitmap.Width, TextBitmap.Height),
|
System.Drawing.Imaging.BitmapData data = TextBitmap.LockBits(new System.Drawing.Rectangle(0, 0, TextBitmap.Width, TextBitmap.Height),
|
||||||
System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
System.Drawing.Imaging.ImageLockMode.ReadOnly, System.Drawing.Imaging.PixelFormat.Format32bppArgb);
|
||||||
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, TextBitmap.Width, TextBitmap.Height, PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
GL.TexSubImage2D(TextureTarget.Texture2D, 0, 0, 0, TextBitmap.Width, TextBitmap.Height, PixelFormat.Bgra, PixelType.UnsignedByte, data.Scan0);
|
||||||
TextBitmap.UnlockBits(data);
|
TextBitmap.UnlockBits(data);
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#region --- License ---
|
#region --- License ---
|
||||||
/* Licensed under the MIT/X11 license.
|
/* Licensed under the MIT/X11 license.
|
||||||
* Copyright (c) 2006-2008 the OpenTK Team.
|
* Copyright (c) 2006-2008 the OpenTK Team.
|
||||||
* This notice may not be removed from any source distribution.
|
* This notice may not be removed from any source distribution.
|
||||||
|
@ -87,7 +87,7 @@ namespace Examples.TextureLoaders
|
||||||
throw new ArgumentException( "ERROR: Unsupported Pixel Format " + CurrentBitmap.PixelFormat );
|
throw new ArgumentException( "ERROR: Unsupported Pixel Format " + CurrentBitmap.PixelFormat );
|
||||||
}
|
}
|
||||||
|
|
||||||
BitmapData Data = CurrentBitmap.LockBits( new Rectangle( 0, 0, CurrentBitmap.Width, CurrentBitmap.Height ), ImageLockMode.ReadOnly, CurrentBitmap.PixelFormat );
|
BitmapData Data = CurrentBitmap.LockBits( new System.Drawing.Rectangle( 0, 0, CurrentBitmap.Width, CurrentBitmap.Height ), ImageLockMode.ReadOnly, CurrentBitmap.PixelFormat );
|
||||||
|
|
||||||
if ( Data.Height > 1 )
|
if ( Data.Height > 1 )
|
||||||
{ // image is 2D
|
{ // image is 2D
|
||||||
|
|
Loading…
Reference in a new issue