/** * main関数、最初にここから実行されます。 */ void main(){ //GUIの構築や初期化 initializeComponent(); //ユーザー定義の初期化処理 initialize(); //アニメーションのメインループ while(mainLoopState){ //ユーザー定義の描画処理 paint(); //ユーザー定義の更新処理 update(); //GUIコンポーネントの再描画 paintComponent(screenLabel); paintComponent(window); //指定時間待機(アニメーションウェイト) sleep(loopWait); } //アニメーションループを抜けたら終了 finalize(); exit(); } /** * ウィンドウを閉じた際に呼び出されるイベントハンドラです。 */ void onWindowClose(int id){ if(id == window){ //メインループを脱出させて終了させる mainLoopState = false; } }