opengl 【1】开始画个多边形

时间:2014-05-06 01:07:48   收藏:0   阅读:429
  1. 安装freeglut。
  2. 开始第一个opengl 程序

1 安装freeglut

官网下载系统对应的版本。我这里是freeglut-MSVC-2.6.0-4.mp。windows版本。我的工具是win7,vs2012.

配置:解压后有bin,lib,include。

 

 

2 开始第一个opengl程序

#include <GL/freeglut.h>  控制窗口显示,输入什么的。 
#include <GL/gl.h>  下面两个就opengl提供的图形处理库
#include <GL/glu.h>

glutInitContextVersion( 2, 1 );//报错的话表示你的GPU是不支持opengl3.0的

 bubuko.com,布布扣

第一次画图,必须要有坐标。你生成的窗口坐标系统如上。

 

更多细节

freeglut手册

http://freeglut.sourceforge.net/docs/api.php

http://lazyfoo.net/tutorials/OpenGL/01_hello_opengl/index2.php

 

opengl 【1】开始画个多边形,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!