2013/05/17 3

C# 언어로 작성하여 실행해 본 OpenGL 예제: Redbook 의 Teapots

컴파일에 필요한 dll 파일들은 CsGL 을 다운로드하면 들어 있다. 이전에 올린 C 언어용 소스와 Python 언어용 소스와 비교하면 이해할 수 있을 것이다. #region BSD License /* BSD License Copyright (c) 2002, Randy Ridge, The CsGL Development Team http://csgl.sourceforge.net/ All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of..

프로그래밍/C# 2013.05.17

Python 언어로 작성하여 실행해 본 OpenGL 예제: Redbook 의 Teapots

아래의 파이썬용 소스를 실행시키자면 PyOpenGL 을 먼저 설치해야 한다. 소스의 구조는 C 언어 용으로 작성된 teapots,c 의 것과 거의 유사하다. # Filename: teapots.py # # See Wiki: http://www.de-brauwer.be/wiki/wikka.php?wakka=PyOpenGL # See Source: http://www.de-brauwer.be/wiki/wikka.php?wakka=PyOpenGLHelloWorld # See C Source: http://www.glprogramming.com/red/chapter03.html from OpenGL.GL import * from OpenGL.GLUT import * from OpenGL.GLU import * ..

Visual C 2010 으로 컴파일하여 실행해 본 OpenGL 예제: Redbook 의 Teapots

Visual C 용으로 OpenGL 용 소스를 작성할 떼는 헤더 파일 gl.h 와 glu.h 는 사용하지 않아도 된다. glut.h 하나만 사용하면 된다. 컴파일할 때는 헤더 파일을 위한 경로나 라이브러리 파일을 위한 경로를 별도로 지정하지 않아도 된다. 즉, 명령 cl 소스파일명 으로 소스파일이 컴파일되어 실행파일이 생성된다. 아래 예제는 OpenGL Redebook 에 소개되어 있는 cube 예제 소스이다. /* * Copyright (c) 1993-1997, Silicon Graphics, Inc. * ALL RIGHTS RESERVED * Permission to use, copy, modify, and distribute this software for * any purpose and witho..

프로그래밍/C 2013.05.17