mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-25 15:35:28 +00:00
Fixed recursion that between WinGraphicsMode.SelectGraphicsModeARB and GraphicsMode.Default.
Fixed acceleration attribute in WinGraphicsMode.SelectGraphicsModeARB. Now, antialiasing works on nvidia drivers, too.
This commit is contained in:
parent
66efa41a8f
commit
b1b3706e64
|
@ -156,7 +156,7 @@ namespace OpenTK.Platform.Windows
|
||||||
{
|
{
|
||||||
using (Control native_window = new Control())
|
using (Control native_window = new Control())
|
||||||
using (WinWindowInfo window = new WinWindowInfo(native_window.Handle, null))
|
using (WinWindowInfo window = new WinWindowInfo(native_window.Handle, null))
|
||||||
using (WinGLContext context = new WinGLContext(GraphicsMode.Default, window, null, 1, 0, GraphicsContextFlags.Default))
|
using (WinGLContext context = new WinGLContext(new GraphicsMode(new ColorFormat(), 0, 0, 0, new ColorFormat(), 2, false), window, null, 1, 0, GraphicsContextFlags.Default))
|
||||||
{
|
{
|
||||||
Debug.Write("Selecting pixel format (ARB)... ");
|
Debug.Write("Selecting pixel format (ARB)... ");
|
||||||
if (Wgl.Delegates.wglChoosePixelFormatARB == null || Wgl.Delegates.wglGetPixelFormatAttribivARB == null)
|
if (Wgl.Delegates.wglChoosePixelFormatARB == null || Wgl.Delegates.wglGetPixelFormatAttribivARB == null)
|
||||||
|
@ -196,7 +196,7 @@ namespace OpenTK.Platform.Windows
|
||||||
|
|
||||||
int[] attribs_values = new int[]
|
int[] attribs_values = new int[]
|
||||||
{
|
{
|
||||||
(int)WGL_ARB_pixel_format.AccelerationArb, 1,
|
(int)WGL_ARB_pixel_format.AccelerationArb, (int)WGL_ARB_pixel_format.FullAccelerationArb,
|
||||||
|
|
||||||
(int)WGL_ARB_pixel_format.RedBitsArb, color.Red,
|
(int)WGL_ARB_pixel_format.RedBitsArb, color.Red,
|
||||||
(int)WGL_ARB_pixel_format.GreenBitsArb, color.Green,
|
(int)WGL_ARB_pixel_format.GreenBitsArb, color.Green,
|
||||||
|
@ -224,6 +224,12 @@ namespace OpenTK.Platform.Windows
|
||||||
int[] pixel = new int[1], num_formats = new int[1];
|
int[] pixel = new int[1], num_formats = new int[1];
|
||||||
Wgl.Arb.ChoosePixelFormat(window.DeviceContext, attribs_values, null, 1, pixel, num_formats);
|
Wgl.Arb.ChoosePixelFormat(window.DeviceContext, attribs_values, null, 1, pixel, num_formats);
|
||||||
if (num_formats[0] == 0 || pixel[0] == 0)
|
if (num_formats[0] == 0 || pixel[0] == 0)
|
||||||
|
{
|
||||||
|
// Try again without an accumulator. Many modern cards cannot accelerate multisampled formats with accumulator buffers.
|
||||||
|
attribs_values[10 * 2 + 1] = attribs_values[11 * 2 + 1] = attribs_values[12 * 2 + 1] = attribs_values[13 * 2 + 1] = attribs_values[14 * 2 + 1] = 0;
|
||||||
|
Wgl.Arb.ChoosePixelFormat(window.DeviceContext, attribs_values, null, 1, pixel, num_formats);
|
||||||
|
}
|
||||||
|
if (num_formats[0] == 0 || pixel[0] == 0)
|
||||||
{
|
{
|
||||||
Debug.WriteLine("failed");
|
Debug.WriteLine("failed");
|
||||||
return null;
|
return null;
|
||||||
|
|
Loading…
Reference in a new issue