mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-03-29 18:06:52 +00:00
Implemented multisampling on X11.
This commit is contained in:
parent
b9a84ed304
commit
b4359c51ac
|
@ -18,6 +18,10 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
class X11GraphicsMode : IGraphicsMode
|
class X11GraphicsMode : IGraphicsMode
|
||||||
{
|
{
|
||||||
|
// Todo: Add custom visual selection algorithm, instead of ChooseFBConfig/ChooseVisual.
|
||||||
|
// It seems the Choose* methods do not take multisampling into account (at least on some
|
||||||
|
// drivers).
|
||||||
|
|
||||||
#region Constructors
|
#region Constructors
|
||||||
|
|
||||||
public X11GraphicsMode()
|
public X11GraphicsMode()
|
||||||
|
@ -32,7 +36,7 @@ namespace OpenTK.Platform.X11
|
||||||
int buffers, bool stereo)
|
int buffers, bool stereo)
|
||||||
{
|
{
|
||||||
GraphicsMode gfx; // The actual GraphicsMode that will be selected.
|
GraphicsMode gfx; // The actual GraphicsMode that will be selected.
|
||||||
IntPtr visual;
|
IntPtr visual = IntPtr.Zero;
|
||||||
IntPtr display = API.DefaultDisplay;
|
IntPtr display = API.DefaultDisplay;
|
||||||
|
|
||||||
// Try to select a visual using Glx.ChooseFBConfig and Glx.GetVisualFromFBConfig.
|
// Try to select a visual using Glx.ChooseFBConfig and Glx.GetVisualFromFBConfig.
|
||||||
|
@ -137,6 +141,14 @@ namespace OpenTK.Platform.X11
|
||||||
visualAttributes.Add((int)GLXAttribute.ACCUM_RED_SIZE);
|
visualAttributes.Add((int)GLXAttribute.ACCUM_RED_SIZE);
|
||||||
visualAttributes.Add(accum.Red);
|
visualAttributes.Add(accum.Red);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (samples > 0)
|
||||||
|
{
|
||||||
|
visualAttributes.Add((int)GLXAttribute.SAMPLE_BUFFERS);
|
||||||
|
visualAttributes.Add(1);
|
||||||
|
visualAttributes.Add((int)GLXAttribute.SAMPLES);
|
||||||
|
visualAttributes.Add(samples);
|
||||||
|
}
|
||||||
|
|
||||||
if (stereo)
|
if (stereo)
|
||||||
{
|
{
|
||||||
|
@ -228,6 +240,14 @@ namespace OpenTK.Platform.X11
|
||||||
visualAttributes.Add((int)GLXAttribute.ACCUM_RED_SIZE);
|
visualAttributes.Add((int)GLXAttribute.ACCUM_RED_SIZE);
|
||||||
visualAttributes.Add(accum.Red);
|
visualAttributes.Add(accum.Red);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (samples > 0)
|
||||||
|
{
|
||||||
|
visualAttributes.Add((int)GLXAttribute.SAMPLE_BUFFERS);
|
||||||
|
visualAttributes.Add(1);
|
||||||
|
visualAttributes.Add((int)GLXAttribute.SAMPLES);
|
||||||
|
visualAttributes.Add(samples);
|
||||||
|
}
|
||||||
|
|
||||||
if (stereo)
|
if (stereo)
|
||||||
visualAttributes.Add((int)GLXAttribute.STEREO);
|
visualAttributes.Add((int)GLXAttribute.STEREO);
|
||||||
|
|
Loading…
Reference in a new issue