wglCreateContext() : 랜더링 컨텍스트를 생성한다. wglDeleteContext() : 랜더링 컨텍스트를 삭제한다. wglMakeCurrent() : 현재 랜더링 컨텍스트를 설정한다. wglGetProcAddress() : 확장함수 포인터를 리턴한다. wglUseFontBitmap() : 현재 선택된 GDI폰트에 대해 OpenGL디스플레이 리스트를 만든다. wgluseFontOutlines() : 현재 외곽선 글꼴과 같은 것에 디스플레이 리스트를 만든다. glutTimerFunc() : 지정된 시간후에 지정된 함수를 한번 호출한다. 다시 호출할려면 함수를 재호출 ChoosePIxelFormat() : 가장 근접한 픽셀형식을 결정한다. SetPixelFormat() : 픽셀형식을 디바이스 ..
///////코드 6-6 태양계모델링// #include #include #include static int Day=0,Time=0; void MyDisplay() { glClear(GL_COLOR_BUFFER_BIT); glMatrixMode(GL_MODELVIEW); glLoadIdentity(); glColor3f(1.0,0.0,0.0); glutSolidSphere(0.2,20,16); glPushMatrix(); glRotatef((GLfloat)Day,0.0,1.0,0.0); glTranslatef(0.7,0.0,0.0); glRotatef((GLfloat)Time,0.0,1.0,0.0); glColor3f(0.5,0.6,0.7); glutWireSphere(0.1,10,8); glPushMa..
#include #include #include GLfloat MyVertices[8][3] = {{-0.25,-0.25,0.25}, {-0.25,0.25,0.25}, {0.25,0.25,0.25}, {0.25,-0.25,0.25}, {-0.25,-0.25,-0.25}, {-0.25,0.25,-0.25}, {0.25,0.25,-0.25}, {0.25,-0.25,-0.25}}; GLfloat MyColors[8][3]={{0.2,0.2,0.2}, {1.0,0.0,0.0}, {1.0, 1.0, 0.0}, {0.0,1.0,0.0}, {0.0,0.0,1.0}, {1.0,0.0,1.0}, {1.0,1.0,1.0}, {0.0,1.0,1.0}}; GLubyte MyVertexList[24]={0,3,2,1, 2,3,..
/*********************** * inclues ***********************/ #include #include #include #include //rand(), srand() #include //time() /*********************** * macro definition ***********************/ #define randomize() srand((int)time(NULL)) // srand 초기화하는 매크로 #define random(n) rand()%(n) // 0 부터 n-1까지 임의의 수를 얻는 매크로 /******************************************** * the global variable * * 위에서 떨어..
#include #include #include void MyDisplay(){ glClear(GL_COLOR_BUFFER_BIT); glViewport(0,0,300,300); glColor3f(1.0,1.0,1.0); glutSolidTeapot(0.5); // glutWireTeapot(0.5); // glEnd(); glFlush(); } int main(int argc, char** argv) { glutInit(&argc,argv); glutInitDisplayMode(GLUT_RGB); glutInitWindowSize(300,300); glutInitWindowPosition(0,0); glutCreateWindow("차 주전자"); glClearColor(0.0,0.0,0.0,1.0); ..
// 컴퓨터그래픽스 교재 P174 예제 #include #include #include void MyDisplay(){ glClear(GL_COLOR_BUFFER_BIT); glColor3f(1.0,0.0,0.0); glBegin(GL_POLYGON); glVertex3f(-0.5,-0.5,0.0); glVertex3f(0.5,-0.5,0.0); glVertex3f(0.5,0.5,0.0); glVertex3f(-0.5,0.5,0.0); glEnd(); glFlush(); } int main() { glutCreateWindow("OpenGL Drawing Example"); glClearColor(255,255,0.0,0.0); glutDisplayFunc(MyDisplay); glutMainLoop()..