www.pudn.com > Tugasgrafkom_0102516901.rar > modul1.c, change:2017-03-20,size:536b


#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 
#include <GL/glut.h> 
 
void mydisplay(){ 
   glClear(GL_COLOR_BUFFER_BIT); //Menghapus layar 
   glBegin(GL_POLYGON); 
          glVertex2f(-0.3, -0.3); 
          glVertex2f(-0.3, 0.3); 
          glVertex2f(0.3, 0.3); 
          glVertex2f(0.3, -0.3); 
    glEnd(); 
    glFlush(); 
   } 
int main(int argc, char** argv) 
{ 
    printf("Hello World... this is 2D Rectangle"); 
    glutCreateWindow("simple"); 
    glutDisplayFunc(mydisplay); 
    glutMainLoop(); 
 
}