Renaming and comments

This commit is contained in:
Henrik Rydgård 2024-05-21 14:48:28 +02:00
parent 3166eee3f0
commit b1a435840c
5 changed files with 18 additions and 11 deletions

View file

@ -2,13 +2,13 @@
#import <UIKit/UIKit.h>
@class ViewController;
@class PPSSPPViewControllerGL;
@interface AppDelegate : UIResponder <UIApplicationDelegate>
@property (strong, nonatomic) UIWindow *window;
@property (strong, nonatomic) UIScreen *screen;
@property (strong, nonatomic) ViewController *viewController;
@property (strong, nonatomic) PPSSPPViewControllerGL *viewController;
@end

View file

@ -89,9 +89,10 @@
NSString *bundlePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingString:@"/assets/"];
NativeInit(argc, (const char**)argv, documentsPath.UTF8String, bundlePath.UTF8String, NULL);
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
self.viewController = [[ViewController alloc] init];
// Here we can switch viewcontroller depending on backend.
self.viewController = [[PPSSPPViewControllerGL alloc] init];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(handleAudioSessionInterruption:) name:AVAudioSessionInterruptionNotification object:[AVAudioSession sharedInstance]];

View file

@ -18,7 +18,7 @@
- (void)bindDefaultFBO;
@end
@interface ViewController : GLKViewController <
@interface PPSSPPViewControllerGL : GLKViewController <
iCadeEventDelegate, LocationHandlerDelegate, CameraFrameDelegate,
UIGestureRecognizerDelegate, UIKeyInput, PPSSPPViewController>
@end

View file

@ -45,9 +45,9 @@
#define IS_IPAD() ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
#define IS_IPHONE() ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)
class IOSGraphicsContext : public GraphicsContext {
class IOSGLESContext : public GraphicsContext {
public:
IOSGraphicsContext() {
IOSGLESContext() {
CheckGLExtensions();
draw_ = Draw::T3DCreateGLContext(false);
renderManager_ = (GLRenderManager *)draw_->GetNativeObject(Draw::NativeObject::RENDER_MANAGER);
@ -56,7 +56,7 @@ public:
bool success = draw_->CreatePresets();
_assert_msg_(success, "Failed to compile preset shaders");
}
~IOSGraphicsContext() {
~IOSGLESContext() {
delete draw_;
}
Draw::DrawContext *GetDrawContext() override {
@ -103,7 +103,7 @@ static GraphicsContext *graphicsContext;
static CameraHelper *cameraHelper;
static LocationHelper *locationHelper;
@interface ViewController () {
@interface PPSSPPViewControllerGL () {
std::map<uint16_t, InputKeyCode> iCadeToKeyMap;
}
@ -116,7 +116,7 @@ static LocationHelper *locationHelper;
@end
@implementation ViewController
@implementation PPSSPPViewControllerGL
-(id) init {
self = [super init];
@ -209,7 +209,7 @@ extern float g_safeInsetBottom;
[[DisplayManager shared] updateResolution:[UIScreen mainScreen]];
graphicsContext = new IOSGraphicsContext();
graphicsContext = new IOSGLESContext();
graphicsContext->GetDrawContext()->SetErrorCallback([](const char *shortDesc, const char *details, void *userdata) {
g_OSD.Show(OSDType::MESSAGE_ERROR, details, 0.0f, "error_callback");

View file

@ -1,4 +1,10 @@
// main.mm boilerplate
//
// Overview
//
// main.mm: JIT enablement, starting the next step
// AppDelegate.mm: Runs NativeInit, launches the main ViewController
// ViewController.mm: The main application window
#import <UIKit/UIKit.h>
#import <dlfcn.h>