You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
The AppFramework module is intended to be used for compound widgets and UI related classes that are too specific (not basic enough) for Slate, but also not Editor specific (reusable in non-Editor applications and games). The test suite has been moved in its entirety for now, but core widget specific test classes will eventually be split off and moved back into Slate, so that they can live alongside of their corresponding widgets. Other changes: - moved to "include what you use" scheme for SColorPicker - broke out color picker related widgets that may be reusable - added forward declarations to reduce header include dependencies #CodeReview: saul.abreu [CL 2275496 by Max Preussner in Main branch]
98 lines
2.0 KiB
C++
98 lines
2.0 KiB
C++
// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
|
|
|
|
#import <UIKit/UIKit.h>
|
|
|
|
#include "IOSAppDelegate.h"
|
|
#include "IOSCommandLineHelper.h"
|
|
#include "IOS/SlateOpenGLESView.h"
|
|
#include "STestSuite.h"
|
|
|
|
|
|
#define IOS_MAX_PATH 1024
|
|
#define CMD_LINE_MAX 16384
|
|
|
|
FString GSavedCommandLine;
|
|
|
|
|
|
void FAppEntry::PreInit(IOSAppDelegate* AppDelegate, UIApplication* Application)
|
|
{
|
|
// make a controller object
|
|
AppDelegate.SlateController = [[SlateOpenGLESViewController alloc] init];
|
|
|
|
// property owns it now
|
|
[AppDelegate.SlateController release];
|
|
|
|
// point to the GL view we want to use
|
|
AppDelegate.RootView = [AppDelegate.SlateController view];
|
|
|
|
if (AppDelegate.OSVersion >= 6.0f)
|
|
{
|
|
// this probably works back to OS4, but would need testing
|
|
[AppDelegate.Window setRootViewController:AppDelegate.SlateController];
|
|
}
|
|
else
|
|
{
|
|
[AppDelegate.Window addSubview:AppDelegate.RootView];
|
|
}
|
|
}
|
|
|
|
|
|
void FAppEntry::PlatformInit()
|
|
{
|
|
}
|
|
|
|
|
|
void FAppEntry::Init()
|
|
{
|
|
// start up the main loop
|
|
GEngineLoop.PreInit(FCommandLine::Get());
|
|
|
|
// crank up a normal Slate application using the platform's standalone renderer
|
|
FSlateApplication::InitializeAsStandaloneApplication(GetStandardStandaloneRenderer());
|
|
|
|
// Bring up the test suite.
|
|
{
|
|
RestoreSlateTestSuite();
|
|
}
|
|
|
|
#if WITH_SHARED_POINTER_TESTS
|
|
SharedPointerTesting::TestSharedPointer< ESPMode::Fast >();
|
|
SharedPointerTesting::TestSharedPointer< ESPMode::ThreadSafe >();
|
|
#endif
|
|
|
|
// loop while the server does the rest
|
|
double LastTime = FPlatformTime::Seconds();
|
|
}
|
|
|
|
|
|
void FAppEntry::Tick()
|
|
{
|
|
FSlateApplication::Get().PumpMessages();
|
|
FSlateApplication::Get().Tick();
|
|
|
|
// Sleep
|
|
FPlatformProcess::Sleep( 0 );
|
|
}
|
|
|
|
|
|
void FAppEntry::Shutdown()
|
|
{
|
|
FSlateApplication::Shutdown();
|
|
}
|
|
|
|
|
|
int main(int argc, char *argv[])
|
|
{
|
|
for (int32 Option = 1; Option < argc; Option++)
|
|
{
|
|
GSavedCommandLine += TEXT(" ");
|
|
GSavedCommandLine += ANSI_TO_TCHAR(argv[Option]);
|
|
}
|
|
|
|
FIOSCommandLineHelper::InitCommandArgs(FString());
|
|
|
|
@autoreleasepool {
|
|
return UIApplicationMain(argc, argv, nil, NSStringFromClass([IOSAppDelegate class]));
|
|
}
|
|
}
|