mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-24 02:15:29 +00:00
Renamed GraphicsFormat to GraphicsMode.
This commit is contained in:
parent
afc5f84b21
commit
7d6d34c686
|
@ -24,7 +24,7 @@ namespace Examples.WinForms
|
|||
[Example("Extensions", ExampleCategory.WinForms, 3)]
|
||||
public partial class W03_Extensions : Form
|
||||
{
|
||||
GLControl glControl = new GLControl(GraphicsFormat.Default);
|
||||
GLControl glControl = new GLControl(GraphicsMode.Default);
|
||||
Type glClass;
|
||||
Type delegatesClass;
|
||||
Type importsClass;
|
||||
|
|
|
@ -307,9 +307,9 @@ namespace OpenTK
|
|||
|
||||
#endregion
|
||||
|
||||
internal GraphicsFormat ToGraphicsFormat()
|
||||
internal GraphicsMode ToGraphicsFormat()
|
||||
{
|
||||
return new GraphicsFormat(this.Color.BitsPerPixel, this.DepthBits, this.StencilBits, 0, this.AuxBits, this.Buffers, this.Stereo);
|
||||
return new GraphicsMode(this.Color.BitsPerPixel, this.DepthBits, this.StencilBits, 0, this.AuxBits, this.Buffers, this.Stereo);
|
||||
}
|
||||
|
||||
#region --- Overrides ---
|
||||
|
|
|
@ -23,7 +23,7 @@ namespace OpenTK
|
|||
public partial class GLControl : UserControl
|
||||
{
|
||||
IGraphicsContext context;
|
||||
GraphicsFormat format;
|
||||
GraphicsMode format;
|
||||
IGLControlHelper helper;
|
||||
|
||||
#region --- Constructor ---
|
||||
|
@ -32,7 +32,7 @@ namespace OpenTK
|
|||
/// Constructs a new GLControl.
|
||||
/// </summary>
|
||||
public GLControl()
|
||||
: this(GraphicsFormat.Default)
|
||||
: this(GraphicsMode.Default)
|
||||
{ }
|
||||
|
||||
/// <summary>
|
||||
|
@ -43,7 +43,7 @@ namespace OpenTK
|
|||
: this(mode.ToGraphicsFormat())
|
||||
{ }
|
||||
|
||||
public GLControl(GraphicsFormat format)
|
||||
public GLControl(GraphicsMode format)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
|
@ -119,7 +119,7 @@ namespace OpenTK
|
|||
if (context != null)
|
||||
throw new InvalidOperationException("GLControl already contains an OpenGL context.");
|
||||
if (format == null)
|
||||
format = GraphicsFormat.Default;
|
||||
format = GraphicsMode.Default;
|
||||
|
||||
if (!this.DesignMode)
|
||||
{
|
||||
|
@ -221,7 +221,7 @@ namespace OpenTK
|
|||
/// <remarks>
|
||||
/// To change the GraphicsFormat, you must destroy and recreate the GLControl.
|
||||
/// </remarks>
|
||||
public GraphicsFormat GraphicsFormat
|
||||
public GraphicsMode GraphicsFormat
|
||||
{
|
||||
get { return (Context as IGLContextInternal).GraphicsFormat; }
|
||||
}
|
||||
|
|
|
@ -98,23 +98,23 @@ namespace OpenTK
|
|||
|
||||
#region --- Contructors ---
|
||||
|
||||
public GameWindow() : this("OpenTK Game Window", 640, 480, null, GraphicsFormat.Default) { }
|
||||
public GameWindow() : this("OpenTK Game Window", 640, 480, null, GraphicsMode.Default) { }
|
||||
|
||||
public GameWindow(string title) : this(title, 640, 480, null, GraphicsFormat.Default) { }
|
||||
public GameWindow(string title) : this(title, 640, 480, null, GraphicsMode.Default) { }
|
||||
|
||||
public GameWindow(string title, int width, int height)
|
||||
: this(title, width, height, null, GraphicsFormat.Default) { }
|
||||
: this(title, width, height, null, GraphicsMode.Default) { }
|
||||
|
||||
public GameWindow(string title, int width, int height, GraphicsFormat format)
|
||||
public GameWindow(string title, int width, int height, GraphicsMode format)
|
||||
: this(title, width, height, null, format) { }
|
||||
|
||||
public GameWindow(string title, DisplayResolution resolution)
|
||||
: this(title, resolution.Width, resolution.Height, resolution, GraphicsFormat.Default) { }
|
||||
: this(title, resolution.Width, resolution.Height, resolution, GraphicsMode.Default) { }
|
||||
|
||||
public GameWindow(string title, DisplayResolution resolution, GraphicsFormat format)
|
||||
public GameWindow(string title, DisplayResolution resolution, GraphicsMode format)
|
||||
: this(title, resolution.Width, resolution.Height, resolution, format) { }
|
||||
|
||||
GameWindow(string title, int width, int height, DisplayResolution resolution, GraphicsFormat format)
|
||||
GameWindow(string title, int width, int height, DisplayResolution resolution, GraphicsMode format)
|
||||
{
|
||||
if (Configuration.RunningOnWindows)
|
||||
glWindow = new OpenTK.Platform.Windows.WinGLNative();
|
||||
|
|
|
@ -39,7 +39,7 @@ namespace OpenTK.Graphics
|
|||
: this(mode.ToGraphicsFormat(), window)
|
||||
{ }
|
||||
|
||||
public GraphicsContext(GraphicsFormat format, IWindowInfo window)
|
||||
public GraphicsContext(GraphicsMode format, IWindowInfo window)
|
||||
{
|
||||
//if (available_contexts.Count == 0)
|
||||
// available_contexts.Add(IntPtr.Zero, new WeakReference(null));
|
||||
|
@ -247,7 +247,7 @@ namespace OpenTK.Graphics
|
|||
/// <summary>
|
||||
/// Gets the DisplayMode of the context.
|
||||
/// </summary>
|
||||
GraphicsFormat IGLContextInternal.GraphicsFormat
|
||||
GraphicsMode IGLContextInternal.GraphicsFormat
|
||||
{
|
||||
get { return (implementation as IGLContextInternal).GraphicsFormat; }
|
||||
}
|
||||
|
|
|
@ -13,7 +13,7 @@ using System.Text;
|
|||
namespace OpenTK.Graphics
|
||||
{
|
||||
/// <summary>Defines the format for graphics operations.</summary>
|
||||
public class GraphicsFormat
|
||||
public class GraphicsMode
|
||||
{
|
||||
ColorDepth color_format, accumulator_format;
|
||||
int depth, stencil, buffers, samples;
|
||||
|
@ -26,7 +26,7 @@ namespace OpenTK.Graphics
|
|||
/// <internal />
|
||||
/// <summary>Constructs a new GraphicsFormat from the given GraphicsFormat.</summary>
|
||||
/// <param name="mode"></param>
|
||||
internal GraphicsFormat(GraphicsFormat mode)
|
||||
internal GraphicsMode(GraphicsMode mode)
|
||||
: this(mode.ColorFormat, mode.Depth, mode.Stencil, mode.Samples, mode.AccumulatorFormat, mode.Buffers, mode.Stereo) { }
|
||||
|
||||
#endregion
|
||||
|
@ -34,7 +34,7 @@ namespace OpenTK.Graphics
|
|||
#region public GraphicsFormat()
|
||||
|
||||
/// <summary>Constructs a new GraphicsFormat with sensible default parameters.</summary>
|
||||
public GraphicsFormat()
|
||||
public GraphicsMode()
|
||||
: this(Default)
|
||||
{ }
|
||||
|
||||
|
@ -44,7 +44,7 @@ namespace OpenTK.Graphics
|
|||
|
||||
/// <summary>Constructs a new GraphicsFormat with the specified parameters.</summary>
|
||||
/// <param name="color">The ColorFormat of the color buffer.</param>
|
||||
public GraphicsFormat(ColorDepth color)
|
||||
public GraphicsMode(ColorDepth color)
|
||||
: this(color, Default.Depth, Default.Stencil, Default.Samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo)
|
||||
{ }
|
||||
|
||||
|
@ -55,7 +55,7 @@ namespace OpenTK.Graphics
|
|||
/// <summary>Constructs a new GraphicsFormat with the specified parameters.</summary>
|
||||
/// <param name="color">The ColorFormat of the color buffer.</param>
|
||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
||||
public GraphicsFormat(ColorDepth color, int depth)
|
||||
public GraphicsMode(ColorDepth color, int depth)
|
||||
: this(color, depth, Default.Stencil, Default.Samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo)
|
||||
{ }
|
||||
|
||||
|
@ -67,7 +67,7 @@ namespace OpenTK.Graphics
|
|||
/// <param name="color">The ColorFormat of the color buffer.</param>
|
||||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
||||
/// <param name="stencil">The number of bits in the stencil buffer.</param>
|
||||
public GraphicsFormat(ColorDepth color, int depth, int stencil)
|
||||
public GraphicsMode(ColorDepth color, int depth, int stencil)
|
||||
: this(color, depth, stencil, Default.Samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo)
|
||||
{ }
|
||||
|
||||
|
@ -80,7 +80,7 @@ namespace OpenTK.Graphics
|
|||
/// <param name="depth">The number of bits in the depth buffer.</param>
|
||||
/// <param name="stencil">The number of bits in the stencil buffer.</param>
|
||||
/// <param name="samples">The number of samples for FSAA.</param>
|
||||
public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples)
|
||||
public GraphicsMode(ColorDepth color, int depth, int stencil, int samples)
|
||||
: this(color, depth, stencil, samples, Default.AccumulatorFormat, Default.Buffers, Default.Stereo)
|
||||
{ }
|
||||
|
||||
|
@ -94,7 +94,7 @@ namespace OpenTK.Graphics
|
|||
/// <param name="stencil">The number of bits in the stencil buffer.</param>
|
||||
/// <param name="samples">The number of samples for FSAA.</param>
|
||||
/// <param name="accum">The ColorFormat of the accumilliary buffer.</param>
|
||||
public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum)
|
||||
public GraphicsMode(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum)
|
||||
: this(color, depth, stencil, samples, accum, Default.Buffers, Default.Stereo)
|
||||
{ }
|
||||
|
||||
|
@ -109,7 +109,7 @@ namespace OpenTK.Graphics
|
|||
/// <param name="samples">The number of samples for FSAA.</param>
|
||||
/// <param name="accum">The ColorFormat of the accumilliary buffer.</param>
|
||||
/// <param name="buffers">The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering).</param>
|
||||
public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers)
|
||||
public GraphicsMode(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers)
|
||||
: this(color, depth, stencil, samples, accum, buffers, Default.Stereo)
|
||||
{ }
|
||||
|
||||
|
@ -125,7 +125,7 @@ namespace OpenTK.Graphics
|
|||
/// <param name="accum">The ColorFormat of the accumilliary buffer.</param>
|
||||
/// <param name="stereo">Set to true for a GraphicsFormat with stereographic capabilities.</param>
|
||||
/// <param name="buffers">The number of render buffers. Typical values include one (single-), two (double-) or three (triple-buffering).</param>
|
||||
public GraphicsFormat(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers, bool stereo)
|
||||
public GraphicsMode(ColorDepth color, int depth, int stencil, int samples, ColorDepth accum, int buffers, bool stereo)
|
||||
{
|
||||
if (depth < 0) throw new ArgumentOutOfRangeException("depth", "Must be greater than, or equal to zero.");
|
||||
if (stencil < 0) throw new ArgumentOutOfRangeException("stencil", "Must be greater than, or equal to zero.");
|
||||
|
@ -239,9 +239,9 @@ namespace OpenTK.Graphics
|
|||
#region public static GraphicsFormat Default
|
||||
|
||||
/// <summary>Returns an OpenTK.GraphicsFormat compatible with the underlying platform.</summary>
|
||||
public static GraphicsFormat Default
|
||||
public static GraphicsMode Default
|
||||
{
|
||||
get { return new GraphicsFormat(DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, 2, false); }
|
||||
get { return new GraphicsMode(DisplayDevice.PrimaryDisplay.BitsPerPixel, 16, 0, 0, 0, 2, false); }
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace OpenTK.Graphics
|
|||
IWindowInfo Info { get; }
|
||||
|
||||
/// <summary>Gets the GraphicsFormat of the context.</summary>
|
||||
GraphicsFormat GraphicsFormat { get; }
|
||||
GraphicsMode GraphicsFormat { get; }
|
||||
|
||||
///// <summary>
|
||||
///// Gets a System.IntPtr containing the handle to the OpenGL context which is current in the
|
||||
|
|
|
@ -17,19 +17,19 @@ namespace OpenTK.Platform
|
|||
/// </summary>
|
||||
internal sealed class DummyGLContext : IGraphicsContext
|
||||
{
|
||||
GraphicsFormat format;
|
||||
GraphicsMode format;
|
||||
bool vsync;
|
||||
|
||||
#region --- Constructors ---
|
||||
|
||||
public DummyGLContext(GraphicsFormat format) { this.format = format; }
|
||||
public DummyGLContext(GraphicsMode format) { this.format = format; }
|
||||
|
||||
#endregion
|
||||
|
||||
#region --- IGraphicsContext Members ---
|
||||
|
||||
public IntPtr Context { get { return IntPtr.Zero; } }
|
||||
public GraphicsFormat GraphicsFormat { get { return format; } }
|
||||
public GraphicsMode GraphicsFormat { get { return format; } }
|
||||
|
||||
public void CreateContext() { }
|
||||
public void CreateContext(bool direct) { }
|
||||
|
|
|
@ -32,7 +32,7 @@ namespace OpenTK.Platform.Windows
|
|||
const string opengl32Name = "OPENGL32.DLL";
|
||||
WinWindowInfo windowInfo = new WinWindowInfo();
|
||||
|
||||
GraphicsFormat format;
|
||||
GraphicsMode format;
|
||||
//DisplayMode mode = null;
|
||||
bool vsync_supported;
|
||||
|
||||
|
@ -58,7 +58,7 @@ namespace OpenTK.Platform.Windows
|
|||
}
|
||||
}
|
||||
|
||||
GraphicsFormat SelectFormat(GraphicsFormat format)
|
||||
GraphicsMode SelectFormat(GraphicsMode format)
|
||||
{
|
||||
using (WinGLNative native = new WinGLNative(16, 16))
|
||||
//using (WinGLContext context = new WinGLContext(format, native.WindowInfo, null))
|
||||
|
@ -68,7 +68,7 @@ namespace OpenTK.Platform.Windows
|
|||
}
|
||||
}
|
||||
|
||||
public WinGLContext(GraphicsFormat format, IWindowInfo window, IGraphicsContext sharedContext)
|
||||
public WinGLContext(GraphicsMode format, IWindowInfo window, IGraphicsContext sharedContext)
|
||||
{
|
||||
//format = this.SelectFormat(format);
|
||||
|
||||
|
@ -222,7 +222,7 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
#region GraphicsFormat IGLContextInternal.GraphicsFormat
|
||||
|
||||
GraphicsFormat IGLContextInternal.GraphicsFormat
|
||||
GraphicsMode IGLContextInternal.GraphicsFormat
|
||||
{
|
||||
get { return format; }
|
||||
}
|
||||
|
@ -271,7 +271,7 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
#region GraphicsFormat SetGraphicsFormatPFD(GraphicsFormat format)
|
||||
|
||||
GraphicsFormat SetGraphicsFormatPFD(GraphicsFormat format)
|
||||
GraphicsMode SetGraphicsFormatPFD(GraphicsMode format)
|
||||
{
|
||||
deviceContext = Functions.GetDC(this.windowInfo.Handle);
|
||||
Debug.WriteLine(String.Format("Device context: {0}", deviceContext));
|
||||
|
@ -317,7 +317,7 @@ namespace OpenTK.Platform.Windows
|
|||
pixelFormat.Size = API.PixelFormatDescriptorSize;
|
||||
pixelFormat.Version = API.PixelFormatDescriptorVersion;
|
||||
Functions.DescribePixelFormat(deviceContext, pixel, API.PixelFormatDescriptorSize, ref pfd);
|
||||
GraphicsFormat fmt = new GraphicsFormat(
|
||||
GraphicsMode fmt = new GraphicsMode(
|
||||
new ColorDepth(pfd.RedBits, pfd.GreenBits, pfd.BlueBits, pfd.AlphaBits),
|
||||
pfd.DepthBits,
|
||||
pfd.StencilBits,
|
||||
|
@ -338,7 +338,7 @@ namespace OpenTK.Platform.Windows
|
|||
|
||||
#region GraphicsFormat SetGraphicsFormatARB(GraphicsFormat format)
|
||||
|
||||
GraphicsFormat SetGraphicsFormatARB(GraphicsFormat format)
|
||||
GraphicsMode SetGraphicsFormatARB(GraphicsMode format)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@ namespace OpenTK.Platform.X11
|
|||
IntPtr context;
|
||||
DisplayMode mode;
|
||||
X11WindowInfo windowInfo = new X11WindowInfo();
|
||||
GraphicsFormat format;
|
||||
GraphicsMode format;
|
||||
IntPtr visual;
|
||||
bool vsync_supported;
|
||||
int vsync_interval;
|
||||
|
@ -306,7 +306,7 @@ namespace OpenTK.Platform.X11
|
|||
|
||||
#region public DisplayMode Mode
|
||||
|
||||
GraphicsFormat IGLContextInternal.GraphicsFormat
|
||||
GraphicsMode IGLContextInternal.GraphicsFormat
|
||||
{
|
||||
get { return format; }
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue