I want to create a window covering my whole desktop screen with displaying colors RGB and then VIBGYOR. The color delay should be 1 second. This is the code I have written but output is not as expected. Can anyone tell me where I am wrong?
#include<GL/freeglut.h>
#include<GL/glut.h>
#include<stdio.h>
void main(int argc, char **argv)
{
glutInit(&argc, argv);
glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH );
glutInitWindowSize(1280,1024);
glutCreateWindow("Displays");
glutFullScreen();
glClearColor (1.0, 0.0, 0.0, 0.0); //Red
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(0,1,0,0); //Green
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(0,0,1,0);
glClear(GL_COLOR_BUFFER_BIT); //Blue
sleep(1);
glClearColor(0.933, 0.510, 0.933, 0.0); //violet
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(0.294, 0.000, 0.510, 1); //Indigo
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(0,0,1,1); //Blue
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(0,0.502,0,1); //Green
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(1,1,0,1); //Yellow
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(1,0.647,0,1); //Orange
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glClearColor(1,0,0,1); //Red
glClear(GL_COLOR_BUFFER_BIT);
sleep(1);
glutMainLoop();
}
Thanks.