> As I suspected. This is the generic software-only renderer.
>
> I don't see anything in FLTK that could affect this. Ensure that you're
> setting visual() correctly.
>
> Maybe you can post a minimal example that exhibits the problem?
> I don't have an Intel card, but I could try this on a couple of window
> boxes.
>
This is a minimal example of my program. I have tested and compiled the code on
my computer using visual studio 2008.
I added a popup button "Test", which will call glGetString and print some
information onto console window. You could use it. I get the same result as my
program in dual monitors mode and single monitor mode.
And there is another problem: in dual monitors mode, the soft rendering mode,
gl_draw() doesn't draw text.
//
//This is a code that exhibits the Fl_Gl_Window problem I mentioned.
//
#include <FL/Fl.h>
#include <FL/gl.h>
#include <FL/Fl_Gl_Window.H>
#include <FL/Fl_Menu_Item.H>
#include <FL/Fl_Menu_Bar.H>
#include <FL/Fl_Menu_Button.H>
#include <FL/Fl_Menu_Window.H>
#include <iostream>
class GlWindow : public Fl_Gl_Window {
public:
GlWindow(int X, int Y, int W, int H, const char *L = NULL)
: Fl_Gl_Window(X, Y, W, H, L) {
valid = false;
persent = 0.0f;
}
int handle(int i)
{
if(i == FL_PUSH && Fl::event_button () == 1)
{
if(persent > 0.99999f)
persent = 0;
else
persent += 0.05f;
draw();
return 1;
}
else
return Fl_Gl_Window::handle(i);
}
void draw()
{
if(!valid)
{
gl_font(0, 12);
glViewport (0, 0, w(), h());
glMatrixMode (GL_PROJECTION);
glLoadIdentity();
glOrtho(0.0f, w(), 0.0f, h(), -1.0f,
1.0f);
glMatrixMode (GL_MODELVIEW);
glLoadIdentity();
glDisable (GL_DEPTH_TEST);
valid = true;
glDrawBuffer (GL_FRONT);
glClear(GL_COLOR_BUFFER_BIT);
}
glDrawBuffer (GL_BACK);
glClear(GL_COLOR_BUFFER_BIT);
//Draw Gray Proceeding Bar
glColor3b(33, 33, 33);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(0, h() * 0.3f);
glVertex2f(0, h() * 0.6f);
glVertex2f(w(), h() * 0.3f);
glVertex2f(w(), h() * 0.6f);
glEnd();
//Draw White Proceeding Bar
glColor3b(127, 127, 127);
glBegin(GL_TRIANGLE_STRIP);
glVertex2f(0, h() * 0.3f);
glVertex2f(0, h() * 0.6f);
glVertex2f(w() * persent, h() * 0.3f);
glVertex2f(w() * persent, h() * 0.6f);
glEnd();
//Draw Text "Persent : %4.4f s"
glColor3f (1.0f, 1.0f, 1.0f);
char temptext [30];
sprintf (temptext, "Persent : %4.4f s", persent);
gl_draw(temptext, 0.0f, h() * 0.7f);
swap_buffers();
}
bool valid;
float persent;
static void Test_cb(Fl_Widget * w, void*)
{
const char * gstring = (const char*) (glGetString(GL_RENDERER));
if(gstring != NULL)
{
printf ("%s\n", gstring);
}
gstring = (const char*) (glGetString(GL_VENDOR));
if(gstring != NULL)
{
printf ("%s\n", gstring);
}
gstring = (const char*) (glGetString(GL_EXTENSIONS));
if(gstring != NULL)
{
printf ("%s\n\n", gstring);
}
}
};
class ContainerWindow: public Fl_Menu_Window
{
public:
ContainerWindow(int X, int Y, int W, int H, const char *L = NULL)
: Fl_Menu_Window(X, Y, W, H, L) {
static Fl_Menu_Item menuitems[] = {
{ "&File", 0, 0, 0, FL_SUBMENU },
{ "&Open File", 0, (Fl_Callback *)0 },
{ "&Save File", 0, (Fl_Callback *)0 },
{ "&Exit", 0, (Fl_Callback *)0 },
{ 0 },
{ "&Operation", 0, 0, 0, FL_SUBMENU },
{"&Test", 0, (Fl_Callback *)&GlWindow::Test_cb},
{ 0 },
{0}
};
static Fl_Menu_Item popupMenuItems[] = {
{ "&Test", 0, (Fl_Callback
*)&GlWindow::Test_cb},
};
menuBar = new Fl_Menu_Bar(0, 0, w(), 30);
menuBar->copy(menuitems);
glWindow = new GlWindow(0, 30, w(), h() - 30);
popupMenu = new Fl_Menu_Button(0, 0, w(), h());
popupMenu->type(Fl_Menu_Button::POPUP3);
popupMenu->copy(popupMenuItems);
resizable(menuBar);
resizable(glWindow);
end();
}
void draw()
{
glWindow->redraw();
Fl_Menu_Window::draw();
}
public:
Fl_Menu_Bar* menuBar;
GlWindow* glWindow;
Fl_Menu_Button* popupMenu;
};
int main()
{
ContainerWindow mainWindow(0, 0, 700, 700, "Ray Casting");
Fl::visual(FL_DOUBLE|FL_RGB);
mainWindow.show();
mainWindow.end();
Fl::run();
return 0;
}
_______________________________________________
fltk-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-bugs