Improved WindowInfo.ToString. Added window mapping for X11Input. Changed the notification mask for X11GLNative

This commit is contained in:
the_fiddler 2007-08-05 19:04:06 +00:00
parent 0473bb7647
commit ce23ae19c8
3 changed files with 11 additions and 13 deletions

View file

@ -37,7 +37,7 @@ namespace OpenTK.Platform.X11
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");
}
}

View file

@ -110,9 +110,9 @@ namespace OpenTK.Platform.X11
wnd_attributes.colormap = glContext.XColormap;
//API.CreateColormap(display, rootWindow, glxVisualInfo.visual, 0/*AllocNone*/);
wnd_attributes.event_mask =
EventMask.StructureNotifyMask |
EventMask.SubstructureNotifyMask |
EventMask.ExposureMask;
EventMask.StructureNotifyMask;// |
//EventMask.SubstructureNotifyMask |
//EventMask.ExposureMask;
CreateWindowMask cw_mask =
CreateWindowMask.CWBackPixel |
@ -126,10 +126,8 @@ namespace OpenTK.Platform.X11
0, 0,
mode.Width, mode.Height,
0,
//glxVisualInfo.depth,
glContext.XVisualInfo.depth,
Constants.InputOutput,
//glxVisualInfo.visual,
glContext.XVisualInfo.visual,
cw_mask,
wnd_attributes
@ -141,17 +139,16 @@ namespace OpenTK.Platform.X11
}
Debug.WriteLine("done! (id: " + info.Handle + ")");
/*
// Set the window hints
/*
SizeHints hints = new SizeHints();
hints.x = 0;
hints.y = 0;
hints.width = 640;
hints.height = 480;
hints.flags = USSize | USPosition;
X11Api.SetNormalHints(display, window, hints);
X11Api.SetStandardProperties(
API.SetNormalHints(display, window, hints);
API.SetStandardProperties(
display,
window,
name,
@ -161,10 +158,9 @@ namespace OpenTK.Platform.X11
0,
hints
);
*/
//glContext.ContainingWindow = info.Window;
*/
glContext.windowInfo.Handle = info.Handle;
glContext.CreateContext(null, true);

View file

@ -55,7 +55,7 @@ namespace OpenTK.Platform.X11
window.Display,
window.Parent.Handle,
0, 0,
1, 1,
0, 0,
0, 0,
Constants.InputOnly,
window.VisualInfo.visual,
@ -68,6 +68,8 @@ namespace OpenTK.Platform.X11
throw new Exception("Could not create input window.");
}
API.MapWindow(window.Display, window.Handle);
Debug.WriteLine("done! (id: " + window + ")");
// Select input events to be reported here.