BLOG ARTICLE Hello World | 1 ARTICLE FOUND

  1. 2006.09.12 Hello, OpenGL!! 1

Hello, OpenGL!!

Computer/OpenGL 2006. 9. 12. 21:15

#include <GL/glut.h>

void display()
{
  glClear(GL_COLOR_BUFFER_BIT);

       glBegin(GL_POLYGON);
       glVertex2f(-0.5, -0.5);
       glVertex2f(-0.5, 0.5);
       glVertex2f(0.5, 0.5);
       glVertex2f(0.5, -0.5);
  glEnd();

  glFlush();
}

int main()
{
  glutCreateWindow("simple");
  glutDisplayFunc(display);
  glutMainLoop();
  return 0;
}

너무 심플. 멋있다..

'Computer > OpenGL' 카테고리의 다른 글

OpenGL 개발 환경  (1) 2006.09.12
AND