Tag: c program
-
no errors then run your project.
program #include<Windows.h> // first include Windows.h header file which is required #include<stdio.h> #include<gl/GL.h> // GL.h header file #include<gl/GLU.h> // GLU.h header file #include<gl/glut.h> // glut.h header file from freeglut\include\GL folder #include<conio.h> #include<stdio.h> #include<math.h> #include<string.h> // Init_OpenGL() function void Init_OpenGL() { // set background color to Black glClearColor(0.0, 0.0, 0.0, 0.0); // set shade model to Flat glShadeModel(GL_FLAT); } // Display_Objects() function void Display_Objects(void) { // clearing the window or remove all drawn objects glClear(GL_COLOR_BUFFER_BIT); /*glPushMatrix(), which copies the current matrix and adds the copy to the top of the stack, and glPopMatrix(), which discards the top matrix on the stack*/ glPushMatrix(); //the glTranslatef() routine in the display list alters the position of the next object to be drawn glTranslatef(0.0, 0.0, 0.0); // set color to object glColor3f(red,green,blue); glColor3f(1.0, 0.8, 0.0); // draw a wire tea pot glutWireTeapot(1.0); // draw a wire sphere glTranslatef(-2.5, 0.0, 0.0); glColor3f(0.0, 1.0, 0.0); glutWireSphere(0.8, 30, 30); // draw a wire cone glTranslatef(5.0, 0.0, 0.0); glColor3f(0.0, 0.6, 1.0); glutWireCone(0.8, 1.5, 20, 20); // draw a wire cube glTranslatef(-1.0, 1.4, 0.0); glColor3f(1.0, 0.3, 0.0); glutWireCube(1.0); // draw a wire torus glTranslatef(-3.0, 0.4, 0.0); glColor3f(1.0, 0.3, 1.0); glutWireTorus(0.2, 0.6, 20, 20); …
-
C Programming Language
Introduction C is a procedural programming language initially developed by Dennis Ritchie in the year 1972 at Bell Laboratories of AT&T Labs. It was mainly developed as a system programming language to write the UNIX operating system. The main features of the C language include: These features make the C language suitable for system programming…