Hi I'm using fltk-1.1x-r5857 and I have found a program which doesn't 
behave properly on windows, but does on linux.

In particular in windows, if I use the Fl_Gl_Window::ortho method, a 
quad seems not to be drawn, but a string is drawn.  In Linux, both quad 
and string are drawn properly.
If Fl_Gl_Window::ortho is not called, then the quads and strings are 
drawn properly on windows and linux.  Heres a demonstration program:

#include <FL/Fl.h>
#include <FL/gl.h>
#include <FL/Fl_Gl_Window.h>
class GL_Win : public Fl_Gl_Window {
public:
GL_Win(int x,int y,int w,int h,const char 
*l=0):Fl_Gl_Window(x,y,w,h,l){mode=0;}
void draw(void);
int handle(int event){if(event==FL_PUSH)mode==0 ? mode=1 : 
mode=0;redraw();return 1;}
int mode;
};

void GL_Win::draw(void){
if(mode){
glLoadIdentity();
glViewport(0,0,w(),h());
glClear(GL_COLOR_BUFFER_BIT);
gl_rect(0.0,0.0,0.5,0.5);
gl_font(FL_HELVETICA,FL_NORMAL_SIZE);
gl_draw("click to toggle view",0,0);
}
else {
glLoadIdentity();
glViewport(0,0,w(),h());
glMatrixMode(GL_PROJECTION);
glLoadIdentity();
ortho();
glClear(GL_COLOR_BUFFER_BIT);
gl_rect(0.0,0.0,50.0,50.0);
gl_font(FL_HELVETICA,FL_NORMAL_SIZE);
gl_draw("click to toggle view",50,50);
}//else
}//draw

int main(void){
GL_Win w(0,0,300,300,"gl_window");
w.show();
return Fl::run();
}

any help would be appreciated.
_______________________________________________
fltk-opengl mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-opengl

Reply via email to