GLUT Tutorial : Setup
来源:互联网 发布:淘宝数据管理系统 编辑:程序博客网 时间:2024/05/05 19:30
下面的一些文档转载自http://www.lighthouse3d.com/opengl/tutorials.shtml 感觉不错,贴出来,做个储备吧
GLUT stands for OpenGL Utility Toolkit. Mark J. Kilgard, to enable the construction of OpenGL applications that are truly window system independent, conceived the GLUT library. Thanks to GLUT, we can write applications without having to learn about X windows or Microsoft's own window system. Kilgard implemented the version for X windows, and later Nate Robins ported it to Microsoft Windows. Thanks to both, you did a great job.
In this tutorial I'll introduce you to the basics of building an application using GLUT. This tutorial won't introduce fancy visual effects in order to keep the code as simple as possible.
What you need
In order to write applications with GLUT you should have the latest version (at the time of writing this, I believe it is 3.7). The GLUT distribution comes with lots and lots of examples so after you read through the basics in here you'll have plenty of material to go on. Check out the GLUTs page.
In order to write a C application using GLUT you'll need three files:
Setting up in Visual C/C++ 6.0
There are two options available for a project in Visual C/C++: console, and Win32. the first is the most common option. The application will have two windows: a console window and the OpenGL window. With Win32 it is still possible to build an application using GLUT without messing up with windows programming. All you have to do is to change one setting.
For an existing console project there is a simple way to transform it into a Win32 application, i.e. to get rid of the console window.
Alternatively just add the following line to the beginning of your c code:
// #pragma comment( linker, "/subsystem:/"windows/" /entry:/"mainCRTStartup/"" )
Note that the line is commented on purpose.
And thats all there is to it, now the application has no console window, just the OpenGL window. In Visual C/C++ you'll have to do the following in order to link an application using GLUT:
Note: I've added glu32.lib and opengl32.lib as well. These are the two libraries for the standard OpenGL. GLU is an API that comes with the standard OpenGL distribution.
OK, so all is set, lets learn how to write GLUT applications. If there is anything that is not quite clear please let me know and I'll try to improve it. Your feedback is important.
I hope you enjoy this tutorial.
Antonio
- GLUT Tutorial : Setup
- GLUT Tutorial : Initialization
- SURVIVAL SHOOTER TUTORIAL之Environment setup [1]
- Angular2-tutorial-one: Setup a basic project
- GLUT Tutorial 3 : Preparing the window for a reshape
- glut
- GLUT
- glut
- Step by step tutorial to setup a JBoss Seam application
- Red Media Server Development Setup Tutorial [red5安装指南]
- Spring MVC快速教程:安装 Spring MVC Fast Tutorial: Setup
- setup
- setup
- Setup
- setup
- tutorial
- Tutorial
- Tutorial
- VC++6.0实现视频数据实时获取的探讨(作者:谭佐军 吴鹏飞)
- FC5的光盘的验证方法
- 居说智商高的人才能看得懂的(有点带色)
- DB2V8学习笔记1
- 个人觉得在Eclipse里比较好用的快捷
- GLUT Tutorial : Setup
- GLUT Tutorial : Initialization
- GLUT Tutorial 3 : Preparing the window for a reshape
- 在Jbuider9中开发中发现在一些技巧!
- JSP实现三级菜单级联
- C++对模板的分离式编译问题
- 使用JSDoc建立JavaScript代码的文档
- 总结创建窗口全过程
- CSS样式