From: Diederick C. N. <dc...@gm...> - 2012-05-10 05:47:41
|
So for the second window are both resize2() and resize() not called? or is the wrong one called? Best, Dee On Wed, May 9, 2012 at 4:55 PM, Kevin Fan <kev...@gm...> wrote: > > > ---------- Forwarded message ---------- > From: Kevin Fan <kev...@gm...> > Date: Wed, May 9, 2012 at 5:51 PM > Subject: resizing the second window in a two window context sharing program > To: fre...@li... > > > Hi all, > > I am trying to learn context sharing for two windows in freeglut. > I know I can use glutSetOption(GLUT_RENDERING_CONTEXT > ,GLUT_USE_CURRENT_CONTEXT ); > > I successfully rendered the same object in two windows. > However, when resizing the second window, the resize function call back is > not called, and it resized weirdly. > Am I not understanding the concept of context sharing corretly? > Thank you. > > My code: > glutInit(&argc, argv); > glutInitDisplayMode(GLUT_DEPTH | GLUT_DOUBLE | GLUT_RGBA); > glutInitWindowPosition(0,0); > glutInitWindowSize(640,480); > glutCreateWindow("Window 1"); > glutDisplayFunc(&render); > glutIdleFunc(&render); //just renders a teapot > glutReshapeFunc(&resize); > > glutSetOption(GLUT_RENDERING_CONTEXT ,GLUT_USE_CURRENT_CONTEXT ); > glutInitWindowPosition(640,0); > //glutInitWindowSize(640,480); > glutCreateWindow("Window 2"); > //glutDisplayFunc(&render); > //glutIdleFunc(&render); > //glutReshapeFunc(&resize2); > > glutMainLoop(); > > > ------------------------------------------------------------------------------ > Live Security Virtual Conference > Exclusive live event will cover all the ways today's security and > threat landscape has changed and how IT managers can respond. Discussions > will include endpoint security, mobile security and the latest in malware > threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/ > _______________________________________________ > Freeglut-developer mailing list > Fre...@li... > https://lists.sourceforge.net/lists/listinfo/freeglut-developer > |