Ejemplo n.º 1
0
LibRetroCore::~LibRetroCore()
{
	assert(g_libRetroCore);
	UnloadGame();
	m_retroDeinit();
	g_libRetroCore = nullptr;
}
Ejemplo n.º 2
0
//------------------------------------------------------------------------------------
// Program main entry point
//------------------------------------------------------------------------------------
int main(void)
{
    // Initialization (Note windowTitle is unused on Android)
    //---------------------------------------------------------
    InitWindow(screenWidth, screenHeight, "sample game: space invaders");

    InitGame();

#if defined(PLATFORM_WEB)
    emscripten_set_main_loop(UpdateDrawFrame, 0, 1);
#else

    SetTargetFPS(60);
    //--------------------------------------------------------------------------------------
    
    // Main game loop
    while (!WindowShouldClose())    // Detect window close button or ESC key
    {
        // Update and Draw
        //----------------------------------------------------------------------------------
        UpdateDrawFrame();
        //----------------------------------------------------------------------------------
    }
#endif

    // De-Initialization
    //--------------------------------------------------------------------------------------
    UnloadGame();         // Unload loaded data (textures, sounds, models...)
    
    CloseWindow();        // Close window and OpenGL context
    //--------------------------------------------------------------------------------------

    return 0;
}
Ejemplo n.º 3
0
void Exit()
{
	glutLeaveGameMode();
	DisplayUnload();
	UnloadGame();

	exit(0);
}
// Todo: add info msgs for error states
// Note: return some wrapper or ptr to game loader (we need the appropriate unload method)
IGame *CGameLoaderHandler::LoadGame(const tString &asPath /*, globalvars_t *apGlobals*/)
{
	DevMsg("Trying to load game dll from \"%s\"...", asPath.c_str());
	
	// Unload previous dll
	UnloadGame();
	
	for(auto It : mvLoaders)
	{
		if(It->LoadGame(asPath))
		{
			DevMsg("Successfully loaded the game dll!");
			DevMsg("DLL loaded for mod (game) \"%s\"", pGame->GetGameDescription());
			//It->Init();
			return It;
		};
	};
	
	return nullptr;
};
CGameLoaderHandler::~CGameLoaderHandler()
{
	UnloadGame();
	
	DebugLog("Destructing the game loader component...");
};