Files
OpenVulkano/openVulkanoCpp/Host/iOS/OpenVulkanoAppDelegate.mm
2023-11-12 15:37:22 +01:00

61 lines
1.4 KiB
Plaintext

/*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/.
*/
#import "OpenVulkanoAppDelegate.h"
#include "Base/AppEvents.hpp"
#include "Base/Logger.hpp"
#include "Host/SystemInfo.hpp"
#include "Math/ByteSize.hpp"
using namespace OpenVulkano;
@interface OpenVulkanoAppDelegate ()
@end
@implementation OpenVulkanoAppDelegate
- (id)init
{
[super init];
Logger::SetupLogger();
return self;
}
- (void)applicationWillResignActive:(UIApplication *)application
{
AppEvents::OnWillResignActive();
}
- (void)applicationDidEnterBackground:(UIApplication *)application
{
AppEvents::OnDidEnterBackground();
}
- (void)applicationWillEnterForeground:(UIApplication *)application
{
AppEvents::OnWillEnterForeground();
}
- (void)applicationDidBecomeActive:(UIApplication *)application
{
AppEvents::OnDidBecomeActive();
}
- (void)applicationWillTerminate:(UIApplication *)application
{
AppEvents::OnWillTerminate();
}
- (void)applicationDidReceiveMemoryWarning:(UIApplication *)application
{
Logger::MANAGER->warn("Received Memory Warning! RAM Max {}; Available {}; Used: {}", ByteSize(SystemInfo::GetAppRamMax()), ByteSize(SystemInfo::GetAppRamAvailable()), ByteSize(SystemInfo::GetAppRamUsed()));
AppEvents::OnReceivedMemoryWarning();
}
@end