| 
 | Generated by UTF-8 version of diff2html.pl © Yves Bailly, MandrakeSoft S.A. 2001, Ryohei Morita 2007 diff2html.pl is licensed under the GNU GPL. | 
| ../07-02/07-02-Initialization.c | 07-03-Initialization.c | |||
|---|---|---|---|---|
| 36 lines 1393 bytes Last modified : Mon Nov 5 13:44:16 2012 | 38 lines 1440 bytes Last modified : Mon Nov 5 13:44:16 2012 | |||
| 1 | // Keisanki Joron 2 (Introduction to Computing II) | 1 | // Keisanki Joron 2 (Introduction to Computing II) | |
| 2 | // Dept. of Engineering Systems, University of Tsukuba | 2 | // Dept. of Engineering Systems, University of Tsukuba | |
| 3 | // [UTF-8 / Unix] | 3 | // [UTF-8 / Unix] | |
| 4 | // 計算機序論2・実習 (筑波大学工学システム学類) | 4 | // 計算機序論2・実習 (筑波大学工学システム学類) | |
| 5 | 5 | |||
| 6 | // 2012/11/05a kameda[at]iit.tsukuba.ac.jp | 6 | // 2012/11/05a kameda[at]iit.tsukuba.ac.jp | |
| 7 | // 07.02. ファイル分割 | 7 | // 07.03. ファイル分割に伴う修正 | |
| 8 | ||||
| 9 | #include "ic2-CommonHeaders.h" | |||
| 8 | 10 | |||
| 9 | // *********************************************************************** | 11 | // *********************************************************************** | |
| 10 | // Initialization ******************************************************** | 12 | // Initialization ******************************************************** | |
| 11 | 13 | |||
| 12 | // +++-------------------------------------------------- | 14 | // +++-------------------------------------------------- | |
| 13 | // 初期化(主にGLUT) | 15 | // 初期化(主にGLUT) | |
| 14 | // +++-------------------------------------------------- | 16 | // +++-------------------------------------------------- | |
| 15 | 17 | |||
| 16 | // +---------------------------------------------------- | 18 | // +---------------------------------------------------- | |
| 17 | // OpenGLとしてのWindowの初期化 | 19 | // OpenGLとしてのWindowの初期化 | |
| 18 | // +---------------------------------------------------- | 20 | // +---------------------------------------------------- | |
| 19 | void ic2_BootWindow (char winname[]) { | 21 | void ic2_BootWindow (char winname[]) { | |
| 20 | 22 | |||
| 21 | // DisplayModeの設定(それぞれを|で繋ぐ) | 23 | // DisplayModeの設定(それぞれを|で繋ぐ) | |
| 22 | // GLUT_DOUBLE ... ダブルバッファ | 24 | // GLUT_DOUBLE ... ダブルバッファ | |
| 23 | // GLUT_RGB ... RGB表色モード | 25 | // GLUT_RGB ... RGB表色モード | |
| 24 | glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); | 26 | glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB); | |
| 25 | 27 | |||
| 26 | // 準備(Initialization)が済んだらウィンドウを開く | 28 | // 準備(Initialization)が済んだらウィンドウを開く | |
| 27 | glutCreateWindow(winname); | 29 | glutCreateWindow(winname); | |
| 28 | 30 | |||
| 29 | // Callback関数を設定 (イベント処理) | 31 | // Callback関数を設定 (イベント処理) | |
| 30 | glutDisplayFunc(ic2_DrawFrame); // フレームを(再)描画するために呼び出す関数 | 32 | glutDisplayFunc(ic2_DrawFrame); // フレームを(再)描画するために呼び出す関数 | |
| 31 | glutTimerFunc(250, ic2_timerhandler, 0); // 250[ms]後に呼び出す関数 | 33 | glutTimerFunc(250, ic2_timerhandler, 0); // 250[ms]後に呼び出す関数 | |
| 32 | 34 | |||
| 33 | // ウィンドウ全体を書き直すときの色(R,G,B,0) ここでは黒 | 35 | // ウィンドウ全体を書き直すときの色(R,G,B,0) ここでは黒 | |
| 34 | glClearColor(0.0, 0.0, 0.0, 0.0); | 36 | glClearColor(0.0, 0.0, 0.0, 0.0); | |
| 35 | } | 37 | } | |
| 36 | 38 |