Daniel Gollas wrote:
> my openGL windows inside a normal windows still does not receive
> FL_MOVE events though...
Hmm, does the following code work for you?
As you move the mouse over the opengl area (the white X)
it should print out "MOVE" events to the terminal.
Works for me with osx 10.4 and 1.1.8 svn
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Gl_Window.H>
#include <FL/gl.h>
class MyGlWindow : public Fl_Gl_Window {
int handle(int e) {
int ret = Fl_Gl_Window::handle(e);
switch ( e ) {
case FL_MOVE:
fprintf(stderr, "MOVE %d %d\n", Fl::event_x(), Fl::event_y());
ret = 1;
break;
}
return(ret);
}
void draw() {
if (!valid()) {
valid(1);
glLoadIdentity();
glViewport(0,0,w(),h());
glOrtho(-w(),w(),-h(),h(),-1,1);
}
glClear(GL_COLOR_BUFFER_BIT);
glColor3f(1.0, 1.0, 1.0);
glBegin(GL_LINE_STRIP); glVertex2f(w(), h()); glVertex2f(-w(),-h());
glEnd();
glBegin(GL_LINE_STRIP); glVertex2f(w(),-h()); glVertex2f(-w(), h());
glEnd();
}
void resize(int X,int Y,int W,int H) {
Fl_Gl_Window::resize(X,Y,W,H);
glLoadIdentity();
glViewport(0,0,W,H);
glOrtho(-W,W,-H,H,-1,1);
redraw();
}
public:
MyGlWindow(int X,int Y,int W,int H,const char*L=0) :
Fl_Gl_Window(X,Y,W,H,L) {
}
};
int main() {
Fl_Window win(500, 300);
MyGlWindow mygl(10, 10, win.w()-20, win.h()-20);
win.resizable(mygl);
win.show();
return(Fl::run());
}
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk