OpenGL 簡介

OpenGL

安裝

簡介

畫點

多邊形

模型

材質

花紋

骨架

運動

遊戲

模型編輯

訊息

相關網站

參考文獻

最新修改

簡體版

English

一個 OpenGL 的程式架構大致如下

程式範例

#include <OpenGL/gl.h>
#include <OpenGL/glu.h>
#include <GLUT/glut.h>
#define kWindowWidth 400
#define kWindowHeight 300

GLvoid InitGL(GLvoid);
GLvoid DrawGLScene(GLvoid);
GLvoid ReSizeGLScene(int Width, int Height);

int main(int argc, char** argv)
{
  glutInit(&argc, argv);
  glutInitDisplayMode (GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
  glutInitWindowSize (kWindowWidth, kWindowHeight);
  glutInitWindowPosition (100, 100);
  glutCreateWindow (argv[0]);
  InitGL();
  glutDisplayFunc(DrawGLScene);
  glutReshapeFunc(ReSizeGLScene);
  glutMainLoop();
  return 0;
}

Facebook

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License