FLTK logo

Problems mixing GLUT & FLTK

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.opengl  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Problems mixing GLUT & FLTK joe Jun 01, 2011  
 
Hi,
I'm having some problems mixing GLUT & FLTK, I have used the fractals example and when I execute the program, two windows show up when I'm expecting the GLUT window inside the Fl_Window.
I copy/paste the main function code below and if someone can tell me if there is something wrong I will be very happy.
Thanks in advance,
p

int main(int argc, char** argv)
{
//  glutInit(&argc, argv); // this line removed for FLTK

  // create FLTK window:
  Fl_Window window(512+20, 512+100);
  window.resizable(window);

  window.show(argc,argv); // glut will die unless parent window visible
  window.begin(); // this will cause Glut window to be a child
  glutInit( &argc, argv );
  glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH );
  glutCreateWindow( "Keplerian Orbits" );
  glutInitWindowSize(512, 512);
  glutInitWindowPosition(10,90); // place it inside parent window
  window.end();
  window.resizable(glut_window);


  glutReshapeFunc( Reshape );
  glutDisplayFunc( Display );
  glutMouseFunc( Mouse );
  glutMotionFunc( Motion );
  glutKeyboardFunc( Keyboard );
  glutIdleFunc( Idle );
  Init();

  glutMainLoop(); // you could use Fl::run() instead

  return 0;
}
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.