pixel_city() { RandomInit (time (NULL)); RenderInit (); CameraInit (); TextureInit (); WorldInit (); resetviewport(); }
void AppInit (void) { RandomInit (time (NULL)); CameraInit (); RenderInit (); TextureInit (); WorldInit (); }
int main(int argc, char **argv) { _CrtSetDbgFlag ( _CRTDBG_ALLOC_MEM_DF | _CRTDBG_LEAK_CHECK_DF ); glutInit(&argc, argv); glewInit(); GLInit(); WorldInit(); glutMainLoop(); return 0; }
int main(int argc, char* args[]) { int _SysCt = 0; struct PakFile _Pak; struct System _Systems[] = { {"Main", HeraldInit, HeraldDestroy}, {"Lua", InitLuaSystem, QuitLuaCore}, {"Video", VideoInit, VideoQuit}, {NULL, NULL, NULL} }; g_Log.Level = ELOG_ALL; LogSetFile("Log.txt"); #ifdef DEBUG chdir("data"); CreatePak("graphics"); chdir(".."); #endif ResourceManagementInit(1); RsrMgrConstruct(&_Pak, "data/graphics.pak"); for(_SysCt = 0; _Systems[_SysCt].Name != NULL; ++_SysCt) { Log(ELOG_INFO, "Initializing %s system.", _Systems[_SysCt].Name); if(_Systems[_SysCt].Init() == 0) { Log(ELOG_INFO, "System %s could not be loaded.", _Systems[_SysCt].Name); goto quit; } } AnimationLoad(g_LuaState, "data/anim/test.lua"); WorldInit(300); CoSchedule(MainCoro); quit: ResourceManagementQuit(); WorldQuit(); IMG_Quit(); for(_SysCt = _SysCt - 1;_SysCt >= 0; --_SysCt) { Log(ELOG_INFO, "Quitting %s system.", _Systems[_SysCt].Name); _Systems[_SysCt].Quit(); } return 0; }
void hack_init (xstuff_t * XStuff) { //Load the fonts for printing debug info to the window. #ifdef HAVE_GLC glc_ctx = glcGenContext (); glcContext (glc_ctx); for (unsigned int ii = 0; ii < FONT_COUNT; ii++) { fonts[ii].id = glcGenFontID(); if (glcNewFontFromFamily(fonts[ii].id, fonts[ii].name) != fonts[ii].id) { printf("%s\n", fonts[ii].name); glcDeleteFont(fonts[ii].id); fonts[ii].id = 0; } } glcScale (FONT_SIZE, FONT_SIZE); #endif hack_reshape (XStuff); TextureInit (); WorldInit (); }
BOOL CCyberToolBoxApp::InitInstance() { // 標準的な初期化処理 // もしこれらの機能を使用せず、実行ファイルのサイズを小さく // したければ以下の特定の初期化ルーチンの中から不必要なもの // を削除してください。 #ifndef _DEBUG #ifndef INSTALL_BIN_DIR char moduleFileName[_MAX_PATH]; HMODULE module = GetModuleHandle(AfxGetAppName()); GetModuleFileName(module, moduleFileName, sizeof(moduleFileName)-1); SetCurrentDirectory(GetDirectoryName(moduleFileName)); // MessageBox(NULL, GetDirectoryName(moduleFileName), "Current Directory", IDOK); #endif #endif WorldInit(); #ifdef _AFXDLL Enable3dControls(); // 共有 DLL の中で MFC を使用する場合にはここを呼び出してください。 #else Enable3dControlsStatic(); // MFC と静的にリンクしている場合にはここを呼び出してください。 #endif LoadStdProfileSettings(); // 標準の INI ファイルのオプションをロードします (MRU を含む) // アプリケーション用のドキュメント テンプレートを登録します。ドキュメント テンプレート // はドキュメント、フレーム ウィンドウとビューを結合するために機能します。 CSingleDocTemplate* pDocTemplate; pDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CCyberToolBoxDoc), RUNTIME_CLASS(CMainFrame), // メイン SDI フレーム ウィンドウ RUNTIME_CLASS(CCyberToolBoxView)); AddDocTemplate(pDocTemplate); // DDE、file open など標準のシェル コマンドのコマンドラインを解析します。 CCommandLineInfo cmdInfo; ParseCommandLine(cmdInfo); // コマンドラインでディスパッチ コマンドを指定します。 if (!ProcessShellCommand(cmdInfo)) return FALSE; mDgmDocTemplate = new CMultiDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(CDiagramDoc), RUNTIME_CLASS(CDiagramFrame), // メイン SDI フレーム ウィンドウ RUNTIME_CLASS(CDiagramView)); AddDocTemplate(mDgmDocTemplate); mpPerspectiveDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(PerspectiveDoc), RUNTIME_CLASS(PerspectiveFrame), // メイン SDI フレーム ウィンドウ RUNTIME_CLASS(PerspectiveView)); AddDocTemplate(mpPerspectiveDocTemplate); mpPerspectiveDocument = mpPerspectiveDocTemplate->OpenDocumentFile(NULL); mpOrthoDocTemplate = new CSingleDocTemplate( IDR_MAINFRAME, RUNTIME_CLASS(OrthoDoc), RUNTIME_CLASS(OrthoFrame), // メイン SDI フレーム ウィンドウ RUNTIME_CLASS(OrthoView)); AddDocTemplate(mpOrthoDocTemplate); mpOrthoDocument = mpOrthoDocTemplate->OpenDocumentFile(NULL); /* setSceneGraphView(view); */ // GetWorld()->createJavaConsole(); m_pMainWnd->SetWindowText(_T("CyberToolbox")); assert(SetPriorityClass(GetCurrentProcess(),HIGH_PRIORITY_CLASS) == TRUE); return TRUE; }