昨天PO了OpenGL的環境設定後,就開始著手Program囉~!
首先,comes up with header file~
在所有的OpenGL程式中,每個檔案一定會include的標頭檔是"gl.h"
而幾乎所有的OpenGL程式都是使用GLU(OpenGL Utility Library),
使用GLU所需include的標頭檔是"glu.h"
因此,大部分的OpenGL都由引入這兩個標頭檔開始:
#include<GL/gl.h>
#include<GL/glu.h>
接著,Windows的使用者(如我)或你你你~ (在台灣大部分都是用Windows吧XD)
就必須引入"windows.h":
#include<windows.h>
而前一篇安裝環境我們是使用GLUT,所以當然要引入"glut.h"囉:
#include<GL/glut.h>
於是來到最後,全部的標頭是如下:
all right~先這樣~~
#include<windows.h>
#include<GL/gl.h>
#include<GL/glu.h>
#include<GL/glut.h>
all right~先這樣~~
資料來源:OpenGL Programming Guide - Fifth Edition
沒有留言:
張貼留言