//-----------------------------------------------------------------------------
MyWindow* createWindow( int width, int height )
//-----------------------------------------------------------------------------
{
    MyWindow* pWindow = new MyWindow( width, height );
    if( pWindow->can_do() == 0 )
    {
        cout << "OpenGL not possible!!" << endl;
    }
    else
    {
        cout << "Using OpenGL." << endl;
        if( pWindow->can_do_overlay() == 0 )
        {
            cout << "OpenGL Overlays not possible!!" << endl;
        }
        else
        {
            cout << "Using OpenGL Overlays." << endl;
        }

        //window->clear_border();
        gl_font( FL_TIMES, 12 );
        Fl::gl_visual( FL_RGB );
        pWindow->end();
        pWindow->show();
    }
    return pWindow;
}
示例#2
0
int main(int argc, char** argv) {
    
    
    CrazyContainer *container = new CrazyContainer();
    container->loadXML();
    MyWindow *window = new MyWindow();
    window->setCrazyContainer(container);
        
    Fl_Button *b1 = new Fl_Button(20, 20, 80, 25, "Connect");
    b1->callback(connect,(void *)container);
    
    Fl_Button *b2 = new Fl_Button(100, 20, 80, 25, "Go 11000");
    b2->callback(run,(void *)container);
    FLContainer::thrustOutput = new Fl_Value_Slider(100,50,250,25,"Thrust meter");
    FLContainer::thrustOutput->type(FL_HOR_FILL_SLIDER);
    FLContainer::thrustOutput->scrollvalue(5000, 100, 5000, 100000);
    FLContainer::thrustOutput->callback(runCustomThrust,(void *)container); 
    
    FLContainer::pitch = new Fl_Value_Slider(100,100,250,25,"Pitch");
    FLContainer::pitch->type(FL_HORIZONTAL);
    FLContainer::pitch->scrollvalue(0,10,-180,370);
    FLContainer::pitch->precision(2);
    FLContainer::roll = new Fl_Value_Slider(100,140,250,25,"Roll");
    FLContainer::roll->type(FL_HORIZONTAL);
    FLContainer::roll->scrollvalue(0,10,-180,370);
    FLContainer::roll->precision(2);
    FLContainer::yaw = new Fl_Value_Slider(100,180,250,25,"Yaw");
    FLContainer::yaw->type(FL_HORIZONTAL);
    FLContainer::yaw->scrollvalue(0,10,-180,370);
    FLContainer::yaw->precision(2);
    FLContainer::offsetPitch = new Fl_Value_Slider(100,220,250,25,"Offset Pitch");
    FLContainer::offsetPitch->type(FL_HORIZONTAL);
    FLContainer::offsetPitch->scrollvalue(container->getOffsetPitch(),10,-20,50);
    FLContainer::offsetPitch->precision(2);
    FLContainer::offsetPitch->callback(setOffsetPitch,(void *)container);
    FLContainer::offsetRoll = new Fl_Value_Slider(100,260,250,25,"Offset Roll");
    FLContainer::offsetRoll->type(FL_HORIZONTAL);
    FLContainer::offsetRoll->scrollvalue(container->getOffsetRoll(),10,-20,50);
    FLContainer::offsetRoll->precision(2);
    FLContainer::offsetRoll->callback(setOffsetRoll,(void *)container);
    
     Fl_Button *b3 = new Fl_Button(200, 20, 80, 25, "Stop");
    b3->callback(stop,(void *)container);
    
    Fl_Button *bfocus = new Fl_Button(20, 45, 80, 25, "Focus");
    
     Fl_Button *b5 = new Fl_Button(400, 20, 80, 25, "Kill n' Exit");
    b5->callback(killnstop,(void *)container);
    
    Fl_Button *bsave = new Fl_Button(500, 20, 80, 25, "Plot");
    bsave->callback(save,(void *)container);
    
    Fl_Button *bload = new Fl_Button(500, 50, 80, 25, "Load");
    bload->callback(load,(void *)container);
    
    
    window->end();
    window->show(argc,argv);
    return Fl::run();
}
示例#3
0
//-----------------------------------------------------------------------------
MyWindow* createWindow( int width, int height )
//-----------------------------------------------------------------------------
{
    MyWindow* pWindow = new MyWindow( width, height );
    //pWindow->clear_border();
    fl_font( FL_TIMES, 12 );
    pWindow->end();
    Fl::visual( FL_RGB | FL_DOUBLE | FL_INDEX );
    return pWindow;
}