Skip to content

Commit

Permalink
Forgot about iOS
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed Jul 19, 2020
1 parent e3faf08 commit 6966a50
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Core/Config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -530,7 +530,7 @@ static int DefaultInternalResolution() {
}

static bool DefaultFrameskipUnthrottle() {
#if PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP)
#if PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(IOS)
return true;
#else
return false;
Expand Down
2 changes: 2 additions & 0 deletions GPU/GPUCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ void GPUCommon::Reinitialize() {
}

void GPUCommon::UpdateVsyncInterval(bool force) {
#if !(PPSSPP_PLATFORM(ANDROID) || USING_QT_UI || PPSSPP_PLATFORM(UWP) || PPSSPP_PLATFORM(IOS))
int desiredVSyncInterval = g_Config.bVSync ? 1 : 0;
if (PSP_CoreParameter().unthrottle) {
desiredVSyncInterval = 0;
Expand All @@ -487,6 +488,7 @@ void GPUCommon::UpdateVsyncInterval(bool force) {
gfxCtx_->SwapInterval(desiredVSyncInterval);
lastVsync_ = desiredVSyncInterval;
}
#endif
}

int GPUCommon::EstimatePerVertexCost() {
Expand Down
2 changes: 1 addition & 1 deletion UI/GameSettingsScreen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void GameSettingsScreen::CreateViews() {
}
#endif

#if !(PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP))
#if !(PPSSPP_PLATFORM(ANDROID) || defined(USING_QT_UI) || PPSSPP_PLATFORM(UWP)) || PPSSPP_PLATFORM(IOS)
CheckBox *vSync = graphicsSettings->Add(new CheckBox(&g_Config.bVSync, gr->T("VSync")));
vSync->OnClick.Add([=](EventParams &e) {
NativeResized();
Expand Down
8 changes: 7 additions & 1 deletion ios/ViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
#define IS_IPAD() ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPad)
#define IS_IPHONE() ([UIDevice currentDevice].userInterfaceIdiom == UIUserInterfaceIdiomPhone)

class IOSGraphicsContext : public DummyGraphicsContext {
class IOSGraphicsContext : public GraphicsContext {
public:
IOSGraphicsContext() {
CheckGLExtensions();
Expand All @@ -55,6 +55,11 @@
Draw::DrawContext *GetDrawContext() override {
return draw_;
}

void SwapInterval(int interval) override {}
void SwapBuffers() override {}
void Resize() {}

void ThreadStart() override {
renderManager_->ThreadStart(draw_);
}
Expand All @@ -71,6 +76,7 @@ void StopThread() override {
renderManager_->WaitUntilQueueIdle();
renderManager_->StopThread();
}

private:
Draw::DrawContext *draw_;
GLRenderManager *renderManager_;
Expand Down

0 comments on commit 6966a50

Please sign in to comment.