// ConsoleApplication3.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <glut.h>
void init();
void persegi();
int main (int argc, char *argv[])
{
glutInit (&argc, argv);
glutInitWindowSize (500, 500);
glutInitWindowPosition(10, 50);
glutCreateWindow ("segitiga");
init();
glutDisplayFunc(persegi);
glutMainLoop();
return 0;
}
void init (){
glClearColor (0.5, 0.5, 0.5, 0.0);
glClear (GL_COLOR_BUFFER_BIT);
}
void persegi(){
glBegin (GL_POLYGON);
glVertex2f (-0.3f, 0.3f);
glVertex2f (0.3f, 0.3f);
glVertex2f (0.3f, -0.3f);
glVertex2f (-0.3f, -0.3f);
glEnd();
glFlush();
}
//
#include "stdafx.h"
#include <glut.h>
void init();
void persegi();
int main (int argc, char *argv[])
{
glutInit (&argc, argv);
glutInitWindowSize (500, 500);
glutInitWindowPosition(10, 50);
glutCreateWindow ("segitiga");
init();
glutDisplayFunc(persegi);
glutMainLoop();
return 0;
}
void init (){
glClearColor (0.5, 0.5, 0.5, 0.0);
glClear (GL_COLOR_BUFFER_BIT);
}
void persegi(){
glBegin (GL_POLYGON);
glVertex2f (-0.3f, 0.3f);
glVertex2f (0.3f, 0.3f);
glVertex2f (0.3f, -0.3f);
glVertex2f (-0.3f, -0.3f);
glEnd();
glFlush();
}