Alex wrote:
> I would like to have complete control over drawing my main window. I want a 
> toolkit to make various dialogs for the application easy, but I want to do 
> all the drawing in my main window.

        Best thing to do is derive a class from Fl_Window called eg. MainWindow,
        and make a draw() method for that class so you can take complete control
        over what's drawn in that entire window. You can use functions like
        fl_rect(), fl_rectf(), fl_line(), 
fl_draw()/fl_font()/fl_size()/fl_color()
        to draw shapes, text, etc. eg:
        http://seriss.com/people/erco/fltk/#FltkX
        ..which shows a derived class called DrawX, which you would change
        to 'MainWindow'.

        If you're just wanting to blit pixels to the screen (ie. an image
        viewer), then you can use fl_draw_pixels() to write raw RGB data
        quickly to the screen, eg:
        http://seriss.com/people/erco/fltk/#FlDrawImage

        Or, make the main window an OpenGL widget, and use opengl calls to
        manage the screen, instead of the FLTK fl_xxx() drawing functions, eg:
        http://seriss.com/people/erco/fltk/#OpenGlSimple
        ..where 'MyGlWindow' is derived from Fl_Gl_Window, and in that case
        you would make it part of an Fl_Window, using the entire xywh area of
        the window. To do blitting, I think the opengl equivalent of 
fl_draw_image()
        is glDrawPixels().

        Or, if you want some FLTK widgets to appear in the same window
        as the opengl app, then see:
        http://seriss.com/people/erco/fltk/#OpenGlSimpleWidgets
        ..where the opengl widget only takes a part of the Fl_Window,
        leaving some room for FLTK widgets at the bottom.

        Either way, all your opengl code goes into the draw() method
        for your Fl_Gl_Window-derived class.
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to