opengl编程基础源代码
opengl编程基础的源代码 以下为原版的详细的描述 This directory contains program that support the third edition of the OpenGL Primer. They are organized by chapter. Each directory contains the source code relevant to that chapter. Because under Mac OSX the GLUT header files are stored in the GLUT include rather than GL as on other systems, I have adde d the following compiler directive to each program so each should compile without modification on all architectures #ifdef __APPLE_ #include #else #include #endif If you compile and link your code from a command line, then the following Makefile should work on most linux systems. Use the LDLIBS line that fits your X11 installation. C = gcc #LDLIBS = -lglut -lGL -lGLU -lXmu -lX11 -lm LDLIBS = -lglut -lGL -lXmu -lX11 -lm -L/usr/X11R6/lib -I/usr/X11R6/include .c: $(CC) $@.c $(LDLIBS) -o $@ For Mac OS X, the following is a minimal Makefile for Mac OS X GCC_OPTIONS=-Wall -pedantic GL_OPTIONS=-framework OpenGL -framework GLUT OPTIONS=$(GCC_OPTIONS) $(GL_OPTIONS) .c: gcc $@.c $(OPTIONS) -o $@ Using the proper makefile, you should be able to comile a single program myprogram.c by make myprogram For Windows platforms, if you write your own shaders, you will also have to install the GLEW libraries from sourceforge.com. Then add the include #include and the intialization glewInit(); after the glutInitWindow call. d the following compiler directive to each program so each should compile without modification on all architectures #ifdef __APPLE_ #include #else #include #endif If you compile and link your code from a command line, then the following Makefile should work on most linux systems. Use the LDLIBS line that fits your X11 installation. C = gcc #LDLIBS = -lglut -lGL -lGLU -lXmu -lX11 -lm LDLIBS = -lglut -lGL -lXmu -lX11 -lm -L/usr/X11R6/lib -I/usr/X11R6/include .c: $(CC) $@.c $(LDLIBS) -o $@ For Mac OS X, the following is a minimal Makefile for Mac OS X GCC_OPTIONS=-Wall -pedantic GL_OPTIONS=-framework OpenGL -framework GLUT OPTIONS=$(GCC_OPTIONS) $(GL_OPTIONS) .c: gcc $@.c $(OPTIONS) -o $@ Using the proper makefile, you should be able to comile a single program myprogram.c by make myprogram For Windows platforms, if you write your own shaders, you will also have to install the GLEW libraries from sourceforge.com. Then add the include #include and the intialization glewInit(); after the glutInitWindow call.
用户评论