Esempio n. 1
0
//-----------------------------------------------------------------------------
bool Init()
{
    try
    {
        InitGL();
	
	char applicationConfigDirectory[1000];
	int bytes = GetModuleFileName(NULL, applicationConfigDirectory, 1000);

        CGE_LoadLibrary();
        // Note: the log output is in
        // c:/Users/<username>/AppData/Local/cpp_winapi_library_tester/cpp_winapi_library_tester.log
        // See https://castle-engine.io/manual_log.php
        CGE_Open(ecgeofLog, g_windowWidth, g_windowHeight, 96, applicationConfigDirectory);
        CGE_SetLibraryCallbackProc(OpenGlLibraryCallback);
        CGE_SetUserInterface(true);
        //CGE_LoadSceneFromFile("c:\\projects\\humanoid_stand.wrl");
        ShowOpenFileDialog();
        return true;
    }
    catch (const std::exception &e)
    {
        std::ostringstream msg;

        msg << "Application initialization failed!" << std::endl << std::endl;
        msg << e.what();

        MessageBox(g_hWnd, msg.str().c_str(), "Error", MB_ICONERROR);
        return false;
    }
}
Esempio n. 2
0
//-----------------------------------------------------------------------------
bool Init()
{
    try
    {
        InitGL();

        CGE_LoadLibrary();
        CGE_Open(0);
        CGE_Resize(g_windowWidth, g_windowHeight);
        CGE_SetLibraryCallbackProc(OpenGlLibraryCallback);
        CGE_SetUserInterface(true, 96);
        //CGE_LoadSceneFromFile("c:\\projects\\humanoid_stand.wrl");
        ShowOpenFileDialog();
        return true;
    }
    catch (const std::exception &e)
    {
        std::ostringstream msg;

        msg << "Application initialization failed!" << std::endl << std::endl;
        msg << e.what();

        MessageBox(g_hWnd, msg.str().c_str(), "Error", MB_ICONERROR);
        return false;
    }
}