Eoin wrote:
> Hey,
>
> I've derived my own class from Fl_Gl_Window which is part of my FLTK GUI. I'm
> taking information from the mouse so I've written a MyFlGlWindow::handle()
> function that does stuff when the mouse is moved over the window.
See fltk.opengl -- there was a recent thread on this same subject.
See the entire thread "Re: Callback", esp. my comment on 03/18/09 14:11
which shows how a handle() function should look in the context of an
Fl_Gl_Window.
Segfaults sounds like a bug in what you're doing.
If you're still having trouble, shrink your code down to a simple
compilable application. In the process you may find the problem,
and if not, post that complete shrunken program here, so we can
see what you're doing and can try compiling it. Be sure to remove
any extraneous stuff that doesn't show the problem; keep the example
as small as possible.
For lots of small examples of fltk code, see my cheat page:
http://seriss.com/people/erco/fltk/
Here's an opengl example with a handle() defined:
http://seriss.com/people/erco/fltk/#GLCursor
Note how the events are passed to the base widget,
and the return value preserved/enhanced.
> I found that I had to include a call to show() in my handle() function or the
> GL scene was never drawn. My first question is, is this the correct way to
> override the handle() function? (I've not been able to find example code
> where the handle() function is overridden)
If the mouse is changing values that affect the scene,
you'll want to call redraw() to ensure the scene is updated.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk