This test Program opens two small windows
main_window and video_vindow with different background color,
after 2 seconds it should set video_window to fullscreen, which works
freeglut 2.8.0, but no longer in freeglut 3.0.0 where the other window is
set to fullscreen. (Slackware and Debian Linux)
But if I change the function fullscreen_video_window to
glutSetWindow(main_window);
glutFullScreen();
glutSetWindow(video_window);
}
it is the other way round, it seems that glutSetWindow
is influencing the glutFullscreen before and not after it.
#include <stdarg.h>
#include <unistd.h>
#include <GL/glut.h>
static int main_window, sub_window1,sub_window2, sub_window3,sub_window4,video_window;
void displayfn_m(void)
{
glClearColor ( 0.5f, 0.5f, 0.8f, 1.0f ) ;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
void displayfn_v(void)
{
glClearColor ( 0.8f, 0.5f, 0.5f, 1.0f ) ;
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
void fullscreen_video_window()
{
glutSetWindow(video_window);
glutFullScreen();
glutSetWindow(main_window);
}
void reshapevw(int w, int h)
{
glViewport(0, 0, (GLsizei) w, (GLsizei) h);
}
static int ifi;
void idlefunc()
{
ifi++;
if(ifi<200)glutSetWindow(video_window);
glutPostRedisplay();
glutSetWindow(main_window);
glutPostRedisplay();
usleep(20000);
if(ifi==100) fullscreen_video_window();
if(ifi==200) glutDestroyWindow(video_window);
if(ifi==250) glutDestroyWindow(main_window);
}
int main( int argc, char **argv )
{
glutInitWindowPosition( 0, 100 ) ;
glutInitWindowSize ( 300, 200) ;
glutInit( &argc, argv ) ;
glutInitDisplayMode ( GLUT_RGB | GLUT_SINGLE ) ;
main_window = glutCreateWindow( "Videotimeline" ) ;
glutDisplayFunc ( displayfn_m) ;
glutInitWindowPosition( 960, 100 ) ;
glutInitWindowSize ( 300, 200) ;
glutInitDisplayMode ( GLUT_RGB | GLUT_SINGLE ) ;
video_window = glutCreateWindow ( "Video" ) ;
glutDisplayFunc( displayfn_v);
glutIdleFunc( idlefunc);
glutMainLoop();
}