imacart...@... <imacart...@...> writes:
>
> Greg Ercolano wrote:
> > Does it make a difference if you're using Fl_Window vs.
> > Fl_Double_Window?
I was using Fl_Window. I tried it both ways. In both cases,
I get a 5+5+5-bit frame buffer.
I have written a small test program that reproduces this problem. Here it is:
#include <stdio.h>
#include <FL/Fl.H>
#include <FL/Fl_Window.H>
#include <FL/Fl_Box.H>
#include <FL/Fl_Gl_Window.H>
#ifdef __APPLE__ // Don't recall why I do this, but it fails either way
#include <OpenGL/gl.h>
#else
#include <FL/gl.h>
#endif
class clipping_window : public Fl_Gl_Window {
void draw();
int handle(int event);
public:
clipping_window(int x,int y,int w,int h,const char *l=0)
: Fl_Gl_Window(x,y,w,h,l) {}
};
static Fl_Window *gui;
static clipping_window *clipping;
void clipping_window::draw()
{
printf("clipping::draw()\n");
int redbits;
glGetIntegerv(GL_RED_BITS,&redbits);
printf("redbits = %d\n",redbits);
}
int clipping_window::handle(int event)
{
printf("clipping::handle()\n");
return Fl_Gl_Window::handle(event);
}
int main(int argc, char **argv)
{
printf("FLTK version = %d %d %d\n",
FL_MAJOR_VERSION,FL_MINOR_VERSION,FL_PATCH_VERSION);
gui = new Fl_Window(0,0,200,200,"");
new Fl_Box(FL_DOWN_FRAME,50,50,100,100,"");
clipping = new clipping_window(60,60,80,80,0);
clipping->mode(FL_RGB8); // Also disables double buffering
if (!clipping->can_do())
fprintf(stderr,"OpenGL mode unsupported\n");
gui->end();
gui->show();
clipping->redraw();
clipping->flush();
for (;;) {}
}
And here is the makefile:
CPPFLAGS = -g -O2 -I/sw/include -arch i386
LDFLAGS = -Wl -arch i386
LOADLIBES = -L/sw/lib
GLDLIBS = -framework OpenGL -lsupc++
CC = g++
LDLIBS = -lfltk -lfltk_gl $(GLDLIBS)
all: test
test: test.o
When I run it, I get:
aosta.stanford.edu:~/projects/sap% ./test
FLTK version = 1 1 7
clipping::handle()
clipping::handle()
clipping::draw()
redbits = 5
^C
which indicates that I'm not receiving a 24-bit visual, despite the FL_RGB8.
-Marc Levoy
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk