Hmmm...that's interesting. Ben: I built a minimal project using only the code
you provided and the cursor worked correctly. However, when I add the GlWindow
to a parent Window, I get the aforementioned cursor error. For the sake of
completeness, here are the contents of the only .cpp file I compile:
/*------------------------------------------------------------------------------------------*/
// Compiled on my ubuntu and msys boxes with fltk2-config --use-gl --configure
text.cxx
// linked against ws2_32.lib, fltk2.lib, fltk2_gl.lib, glu32.lib
andopengl32.lib under msvs
#include <fltk/GlWindow.h>
#include <fltk/events.h>
#include <fltk/Cursor.h>
#include <fltk/run.h>
#include <fltk/gl.h>
#include <cstdio>
using namespace fltk;
class RR_GlWindow : public GlWindow {
void draw() {
if (!valid()) {
valid(1);
glLoadIdentity();
glViewport(0,0,w(),h());
glOrtho(-w(),w(),-h(),h(),-1,1);
}
glClearColor(1.0, 1.0, 1.0, 0.0);
glClear(GL_COLOR_BUFFER_BIT);
// Draw white 'X'
glColor3f(0.0, 0.0, 0.0);
glBegin(GL_LINE_STRIP);
glVertex2i(w(), h());
glVertex2i(-w(),-h());
glEnd();
glBegin(GL_LINE_STRIP);
glVertex2i(w(),-h());
glVertex2i(-w(), h());
glEnd();
}
public:
RR_GlWindow(int x, int y, int w, int h, const char* label=0) :
GlWindow(x,y,w,h,label) {};
int handle(int e) {
int ret = GlWindow::handle(e);
switch(e) {
case fltk::ENTER:
this->cursor(CURSOR_CROSS);
return 1;
default:
return ret;
}
}
};
int main(){
Window win(10, 10, 1000, 800, "");
win.begin();
RR_GlWindow mygl(10, 10, 400, 400);
win.end();
win.show();
return run();
}
/*------------------------------------------------------------------------------------------*/
My compiler options:
/Od /I "V:\dev\ddempsey\cg\fltk-2.0.x-r7704\\" /D "WIN32" /D "_DEBUG" /D
"_CONSOLE" /D "_UNICODE" /D "UNICODE" /Gm /EHsc /RTC1 /MDd /Fo"Debug\\"
/Fd"Debug\vc80.pdb" /W3 /nologo /c /Wp64 /ZI /TP /errorReport:prompt
Linker options:
/OUT:"V:\dev\ddempsey\cg\fltkTest_minimal_100610\Debug\fltkTest_minimal_100610.exe"
/INCREMENTAL /NOLOGO /LIBPATH:"V:\dev\ddempsey\cg\fltk-2.0.x-r7704\lib"
/MANIFEST
/MANIFESTFILE:"Debug\fltkTest_minimal_100610.exe.intermediate.manifest" /DEBUG
/PDB:"v:\dev\ddempsey\cg\fltktest_minimal_100610\debug\fltkTest_minimal_100610.pdb"
/SUBSYSTEM:CONSOLE /MACHINE:X86 /ERRORREPORT:PROMPT ws2_32.lib fltk2.lib
fltk2_gl.lib glu32.lib opengl32.lib kernel32.lib user32.lib gdi32.lib
winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib
uuid.lib odbc32.lib odbccp32.lib
I'll try to update my OpenGL driver to see if that makes a difference...
don
>
> > Maybe a duff GL driver? I know I used to have an old box that did weird
> > stuff in a GL window until I
> > upgraded the driver...
> >
> Yeah, it's either that or there's a #define that is (not) being
> triggered by a -D...
> Although having said that, I'm effectively compiling the MSVS project
> with nothing more than -D_WIN32 and it's working fine.
> Perhaps a more complete code snippet, Don, would be of help here!
>
> Ben
>
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk