Skip to content
Snippets Groups Projects
Select Git revision
  • eb0004c27163ec089201c81eb9ece470700be6c7
  • main default protected
  • 3.10
  • 3.11
  • revert-15688-bpo-38031-_io-FileIO-opener-crash
  • 3.8
  • 3.9
  • 3.7
  • enum-fix_auto
  • branch-v3.11.0
  • backport-c3648f4-3.11
  • gh-93963/remove-importlib-resources-abcs
  • refactor-wait_for
  • shared-testcase
  • v3.12.0a2
  • v3.12.0a1
  • v3.11.0
  • v3.8.15
  • v3.9.15
  • v3.10.8
  • v3.7.15
  • v3.11.0rc2
  • v3.8.14
  • v3.9.14
  • v3.7.14
  • v3.10.7
  • v3.11.0rc1
  • v3.10.6
  • v3.11.0b5
  • v3.11.0b4
  • v3.10.5
  • v3.11.0b3
  • v3.11.0b2
  • v3.9.13
34 results

patchlevel.h

Blame
  • Engine.cpp 18.09 KiB
    #include "Engine.h"
    #include <core/task.h>
    #include <GRegisterIndex.h>
    
    #include <core/taskmanager.h>
    
    #include "SkyXEngine.h"
    
    #include <xcommon/IXSoundSystem.h>
    
    #ifdef _DEBUG
    #	pragma comment(lib, "sxcore_d.lib")
    #else
    #	pragma comment(lib, "sxcore.lib")
    #endif
    
    #ifdef USE_BREAKPAD
    #	pragma comment(lib, "crash_generation_client.lib")
    #	pragma comment(lib, "exception_handler.lib")
    #	pragma comment(lib, "common.lib")
    #endif
    
    class CMainLoopTask: public ITaskImpl<ITask>
    {
    public:
    	CMainLoopTask(CEngine *pEngine):
    		m_pEngine(pEngine),
    		ITaskImpl(CORE_TASK_FLAG_MAINTHREAD_REPEATING)
    	{
    	}
    
    	void run() override
    	{
    		if(!m_pEngine->runFrame())
    		{
    			XCoreStop();
    		}
    	}
    
    protected:
    	CEngine *m_pEngine;
    };
    
    //##########################################################################
    
    #ifdef USE_BREAKPAD
    static bool HandleCrashDump(const wchar_t *wszDumpPath, const wchar_t* wszMinidumpId, void* pContext, EXCEPTION_POINTERS* pExInfo, MDRawAssertionInfo* pAssertion, bool isSucceeded)
    {
    	wchar_t *pCrashReporter = (wchar_t*)pContext;
    	if(isSucceeded)
    	{
    		wcscat(pCrashReporter, wszMinidumpId);
    		STARTUPINFOW info = {sizeof(info)};
    		PROCESS_INFORMATION processInfo;
    		if(CreateProcessW(NULL, pCrashReporter, NULL, NULL, TRUE, 0, NULL, NULL, &info, &processInfo))
    		{
    			CloseHandle(processInfo.hProcess);
    			CloseHandle(processInfo.hThread);
    		}
    	}
    	else
    	{
    		MessageBoxW(NULL, L"Program has crashed. Failed to write crashdump.", L"Crashed!", MB_OK | MB_ICONSTOP);
    	}
    	//MessageBoxW(NULL, wszMinidumpId, pCrashReporter, MB_OK | MB_ICONSTOP);
    	return(true);
    }
    #endif
    
    //##########################################################################