mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-05-08 15:02:07 +00:00
Fixed crash bug in X11GLNative. Almost ready for release. Niar!
This commit is contained in:
parent
7287e5d5a4
commit
cccbb9823b
|
@ -187,7 +187,7 @@ namespace OpenTK.Platform.X11
|
||||||
{
|
{
|
||||||
Debug.WriteLine("Creating visual.");
|
Debug.WriteLine("Creating visual.");
|
||||||
Debug.Indent();
|
Debug.Indent();
|
||||||
|
/*
|
||||||
ColorDepth color = new ColorDepth(24);
|
ColorDepth color = new ColorDepth(24);
|
||||||
int depthBits = 16;
|
int depthBits = 16;
|
||||||
|
|
||||||
|
@ -206,7 +206,8 @@ namespace OpenTK.Platform.X11
|
||||||
visualAttributes.Add((int)depthBits);
|
visualAttributes.Add((int)depthBits);
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.NONE);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.NONE);
|
||||||
/*
|
*/
|
||||||
|
|
||||||
Debug.Print("Requesting DisplayMode: {0}. ", mode.ToString());
|
Debug.Print("Requesting DisplayMode: {0}. ", mode.ToString());
|
||||||
// Hack; Temp workaround for invalid depth of 24
|
// Hack; Temp workaround for invalid depth of 24
|
||||||
if (mode.DepthBits == 24)
|
if (mode.DepthBits == 24)
|
||||||
|
@ -226,10 +227,11 @@ namespace OpenTK.Platform.X11
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.ALPHA_SIZE);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.ALPHA_SIZE);
|
||||||
visualAttributes.Add((int)mode.Color.Alpha);
|
visualAttributes.Add((int)mode.Color.Alpha);
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DEPTH_SIZE);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DEPTH_SIZE);
|
||||||
visualAttributes.Add((int)mode.DepthBits);
|
//visualAttributes.Add((int)mode.DepthBits);
|
||||||
|
visualAttributes.Add(1);
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.DOUBLEBUFFER);
|
||||||
visualAttributes.Add((int)Glx.Enums.GLXAttribute.NONE);
|
visualAttributes.Add((int)Glx.Enums.GLXAttribute.NONE);
|
||||||
*/
|
|
||||||
visual = Glx.ChooseVisual(windowInfo.Display, windowInfo.Screen, visualAttributes.ToArray());
|
visual = Glx.ChooseVisual(windowInfo.Display, windowInfo.Screen, visualAttributes.ToArray());
|
||||||
if (visual == IntPtr.Zero)
|
if (visual == IntPtr.Zero)
|
||||||
{
|
{
|
||||||
|
|
|
@ -250,14 +250,18 @@ namespace OpenTK.Platform.X11
|
||||||
Debug.Write("Creating output window... ");
|
Debug.Write("Creating output window... ");
|
||||||
|
|
||||||
XSetWindowAttributes attributes = new XSetWindowAttributes();
|
XSetWindowAttributes attributes = new XSetWindowAttributes();
|
||||||
//attributes.colormap = glContext.colormap;
|
attributes.background_pixel = IntPtr.Zero;
|
||||||
|
attributes.border_pixel = IntPtr.Zero;
|
||||||
|
attributes.colormap = API.CreateColormap(window.Display, window.RootWindow,
|
||||||
|
window.VisualInfo.visual, 0/*AllocNone*/); //glContext.colormap;
|
||||||
attributes.event_mask = (IntPtr)(EventMask.StructureNotifyMask |
|
attributes.event_mask = (IntPtr)(EventMask.StructureNotifyMask |
|
||||||
EventMask.SubstructureNotifyMask | EventMask.ExposureMask);
|
EventMask.SubstructureNotifyMask | EventMask.ExposureMask);
|
||||||
|
|
||||||
uint mask = (uint)SetWindowValuemask.ColorMap | (uint)SetWindowValuemask.EventMask;
|
uint mask = (uint)SetWindowValuemask.ColorMap | (uint)SetWindowValuemask.EventMask |
|
||||||
|
(uint)SetWindowValuemask.BackPixel | (uint)SetWindowValuemask.BorderPixel;
|
||||||
|
|
||||||
window.Handle = Functions.XCreateWindow(window.Display, /*window.RootWindow*/IntPtr.Zero,
|
window.Handle = Functions.XCreateWindow(window.Display, window.RootWindow,
|
||||||
0, 0, mode.Width, mode.Height, 0, /*window.VisualInfo.depth*/(int)CreateWindowArgs.CopyFromParent,
|
0, 0, mode.Width, mode.Height, 0, window.VisualInfo.depth/*(int)CreateWindowArgs.CopyFromParent*/,
|
||||||
(int)CreateWindowArgs.InputOutput, window.VisualInfo.visual, (UIntPtr)mask,
|
(int)CreateWindowArgs.InputOutput, window.VisualInfo.visual, (UIntPtr)mask,
|
||||||
ref attributes);
|
ref attributes);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue