I am using FLTK 1.1.9 on openSuse 11.3. I am opening three FL_GL_Windows in
main. Since I want to add them to the same swap group using
JoinSwapGroupSGIX(Display *dpy, GLXDrawable drawable, GLXDrawable member), I
need access to the X11 Display and three X11 Window handles. From the
documentation on the x.H I understand I can access these via fl_display and
fl_window, after calling make_current(). I tried the following:
void FLHMIWindow::draw()
{
// Initialize components
if (!m_InitCalled)
{
Init();
}
make_current();
DMSG("wintitle: " << wintitle);
DMSG("fl_display: " << fl_display);
DMSG("RootWindow:" << RootWindow(fl_display, fl_screen));
DMSG("Xproto: " << XProtocolVersion(fl_display));
DMSG("XRevision: " << XProtocolRevision(fl_display));
DMSG("fl_window: " << fl_window);
DMSG("fl_message_window: " << fl_message_window);
DMSG("fl_gc: " << fl_gc);
DMSG("fl_screen: " << fl_screen);
DMSG("XDisplayHeight: "<< XDisplayHeight(fl_display, fl_screen));
Window *root_return;
int *x_return, *y_return;
unsigned int *width_return, *height_return;
unsigned int *border_width_return;
unsigned int *depth_return;
XGetGeometry(fl_display, fl_window, root_return, x_return, y_return,
width_return,
height_return, border_width_return, depth_return);
DMSG("fl_visual: " << fl_visual);
// Draw one frame
Display();
}
Below is the output. As you can see, fl_window is 0, and so is fl_gc. I
included this in the draw() function of all three windows, and fl_window and
fl_gc are always zero, resulting in the BadDrawable error.
Are fl_window and fl_gc broken, or am I missing something?
Thanks!
Herman
output:
----------------------------------------------
DEBUG: wintitle: mydemo
DEBUG: fl_display: 0x76c1c0
DEBUG: RootWindow:627
DEBUG: Xproto: 11
DEBUG: XRevision: 0
DEBUG: fl_window: 0
DEBUG: fl_message_window: 73400321
DEBUG: fl_gc: 0
DEBUG: fl_screen: 0
DEBUG: XDisplayHeight: 1050
X_GetGeometry: BadDrawable (invalid Pixmap or Window parameter) 0x0
DEBUG: fl_visual: 0x7781a0
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk