Improved WindowInfo.ToString. Added window mapping for X11Input. Changed the notification mask for X11GLNative
This commit is contained in:
parent
0473bb7647
commit
ce23ae19c8
3 changed files with 11 additions and 13 deletions
|
@ -37,7 +37,7 @@ namespace OpenTK.Platform.X11
|
||||||
|
|
||||||
public override string ToString()
|
public override string ToString()
|
||||||
{
|
{
|
||||||
return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}, Parent {3}",
|
return String.Format("X11.WindowInfo: Display {0}, Screen {1}, Handle {2}, Parent: ({3})",
|
||||||
this.Display, this.Screen, this.Handle, this.Parent != null ? this.Parent.ToString() : "null");
|
this.Display, this.Screen, this.Handle, this.Parent != null ? this.Parent.ToString() : "null");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,9 +110,9 @@ namespace OpenTK.Platform.X11
|
||||||
wnd_attributes.colormap = glContext.XColormap;
|
wnd_attributes.colormap = glContext.XColormap;
|
||||||
//API.CreateColormap(display, rootWindow, glxVisualInfo.visual, 0/*AllocNone*/);
|
//API.CreateColormap(display, rootWindow, glxVisualInfo.visual, 0/*AllocNone*/);
|
||||||
wnd_attributes.event_mask =
|
wnd_attributes.event_mask =
|
||||||
EventMask.StructureNotifyMask |
|
EventMask.StructureNotifyMask;// |
|
||||||
EventMask.SubstructureNotifyMask |
|
//EventMask.SubstructureNotifyMask |
|
||||||
EventMask.ExposureMask;
|
//EventMask.ExposureMask;
|
||||||
|
|
||||||
CreateWindowMask cw_mask =
|
CreateWindowMask cw_mask =
|
||||||
CreateWindowMask.CWBackPixel |
|
CreateWindowMask.CWBackPixel |
|
||||||
|
@ -126,10 +126,8 @@ namespace OpenTK.Platform.X11
|
||||||
0, 0,
|
0, 0,
|
||||||
mode.Width, mode.Height,
|
mode.Width, mode.Height,
|
||||||
0,
|
0,
|
||||||
//glxVisualInfo.depth,
|
|
||||||
glContext.XVisualInfo.depth,
|
glContext.XVisualInfo.depth,
|
||||||
Constants.InputOutput,
|
Constants.InputOutput,
|
||||||
//glxVisualInfo.visual,
|
|
||||||
glContext.XVisualInfo.visual,
|
glContext.XVisualInfo.visual,
|
||||||
cw_mask,
|
cw_mask,
|
||||||
wnd_attributes
|
wnd_attributes
|
||||||
|
@ -141,17 +139,16 @@ namespace OpenTK.Platform.X11
|
||||||
}
|
}
|
||||||
|
|
||||||
Debug.WriteLine("done! (id: " + info.Handle + ")");
|
Debug.WriteLine("done! (id: " + info.Handle + ")");
|
||||||
|
/*
|
||||||
// Set the window hints
|
// Set the window hints
|
||||||
/*
|
|
||||||
SizeHints hints = new SizeHints();
|
SizeHints hints = new SizeHints();
|
||||||
hints.x = 0;
|
hints.x = 0;
|
||||||
hints.y = 0;
|
hints.y = 0;
|
||||||
hints.width = 640;
|
hints.width = 640;
|
||||||
hints.height = 480;
|
hints.height = 480;
|
||||||
hints.flags = USSize | USPosition;
|
hints.flags = USSize | USPosition;
|
||||||
X11Api.SetNormalHints(display, window, hints);
|
API.SetNormalHints(display, window, hints);
|
||||||
X11Api.SetStandardProperties(
|
API.SetStandardProperties(
|
||||||
display,
|
display,
|
||||||
window,
|
window,
|
||||||
name,
|
name,
|
||||||
|
@ -161,10 +158,9 @@ namespace OpenTK.Platform.X11
|
||||||
0,
|
0,
|
||||||
hints
|
hints
|
||||||
);
|
);
|
||||||
*/
|
|
||||||
|
|
||||||
//glContext.ContainingWindow = info.Window;
|
//glContext.ContainingWindow = info.Window;
|
||||||
|
*/
|
||||||
|
|
||||||
glContext.windowInfo.Handle = info.Handle;
|
glContext.windowInfo.Handle = info.Handle;
|
||||||
glContext.CreateContext(null, true);
|
glContext.CreateContext(null, true);
|
||||||
|
|
|
@ -55,7 +55,7 @@ namespace OpenTK.Platform.X11
|
||||||
window.Display,
|
window.Display,
|
||||||
window.Parent.Handle,
|
window.Parent.Handle,
|
||||||
0, 0,
|
0, 0,
|
||||||
1, 1,
|
0, 0,
|
||||||
0, 0,
|
0, 0,
|
||||||
Constants.InputOnly,
|
Constants.InputOnly,
|
||||||
window.VisualInfo.visual,
|
window.VisualInfo.visual,
|
||||||
|
@ -68,6 +68,8 @@ namespace OpenTK.Platform.X11
|
||||||
throw new Exception("Could not create input window.");
|
throw new Exception("Could not create input window.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
API.MapWindow(window.Display, window.Handle);
|
||||||
|
|
||||||
Debug.WriteLine("done! (id: " + window + ")");
|
Debug.WriteLine("done! (id: " + window + ")");
|
||||||
|
|
||||||
// Select input events to be reported here.
|
// Select input events to be reported here.
|
||||||
|
|
Loading…
Reference in a new issue