From beaed6bc7ea6f3466de3890314338a9b57a93486 Mon Sep 17 00:00:00 2001 From: Meta Vens Date: Mon, 25 May 2026 18:06:58 +0100 Subject: [PATCH] Keep EveCanvas alive without ES3 context --- Makefile | 2 +- README.md | 29 ++++++++++++++++++++--------- Sources/EVEGLView.mm | 16 +++++++++++++++- Sources/EVEViewController.mm | 2 +- scripts/stage-to-eve.ps1 | 9 +++++++-- 5 files changed, 44 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index bf1ab4d..974cc18 100644 --- a/Makefile +++ b/Makefile @@ -12,7 +12,7 @@ EveCanvas_FILES = \ Sources/EVEGLView.mm EveCanvas_FRAMEWORKS = UIKit QuartzCore OpenGLES CoreMotion -EveCanvas_CFLAGS = -fobjc-arc -Wall -Wextra +EveCanvas_CFLAGS = -fobjc-arc -Wall -Wextra -DGLES_SILENCE_DEPRECATION EveCanvas_CODESIGN_FLAGS = -Sentitlements.plist EveCanvas_INSTALL_PATH = /Applications diff --git a/README.md b/README.md index 73e3d16..5090745 100644 --- a/README.md +++ b/README.md @@ -39,9 +39,9 @@ make package make install ``` -EVE currently has SSH and jailbreak package management, but the native build -toolchain still needs to be installed. In particular, a Theos install and an -iPhoneOS SDK are required before `make package` can work. +EVE has SSH, jailbreak package management, a Procursus native build toolchain, +Theos at `/var/theos`, and the packaged iPhoneOS SDK linked under +`/var/theos/sdks`. Expected EVE target: @@ -52,12 +52,15 @@ iPadOS: 14.4 install path: /Applications/EveCanvas.app ``` -## First Deployment Plan +## Deployment -1. Install or stage Theos on EVE. -2. Stage a compatible iPhoneOS SDK under `$THEOS/sdks`. -3. Copy this project to EVE, for example `/var/mobile/Projects/Eve`. -4. Build on EVE: +Stage from the workstation: + +```powershell +powershell -ExecutionPolicy Bypass -File .\scripts\stage-to-eve.ps1 +``` + +Build and install on EVE: ```sh cd /var/mobile/Projects/Eve @@ -67,7 +70,15 @@ make install uicache -p /Applications/EveCanvas.app ``` -5. Launch `EveCanvas` from SpringBoard. +Launch `EveCanvas` from SpringBoard, or over SSH: + +```sh +uiopen --bundleid org.gamecult.evecanvas +``` + +If OpenGL ES context creation fails on-device, the app stays alive with the +UIKit overlay instead of aborting launch. The render surface can then be fixed +without losing the basic app deployment path. ## Next Cut diff --git a/Sources/EVEGLView.mm b/Sources/EVEGLView.mm index 369f086..754c2c0 100644 --- a/Sources/EVEGLView.mm +++ b/Sources/EVEGLView.mm @@ -38,7 +38,12 @@ }; self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES3]; - NSAssert(self.context != nil, @"EVE requires OpenGL ES 3.0."); + if (!self.context) { + self.context = [[EAGLContext alloc] initWithAPI:kEAGLRenderingAPIOpenGLES2]; + } + if (!self.context) { + return self; + } [EAGLContext setCurrentContext:self.context]; glGenFramebuffers(1, &_framebuffer); @@ -52,6 +57,9 @@ } - (void)dealloc { + if (!self.context) { + return; + } [EAGLContext setCurrentContext:self.context]; if (_colorRenderbuffer) { glDeleteRenderbuffers(1, &_colorRenderbuffer); @@ -68,6 +76,9 @@ } - (void)resizeDrawableIfNeeded { + if (!self.context) { + return; + } [EAGLContext setCurrentContext:self.context]; glBindRenderbuffer(GL_RENDERBUFFER, self.colorRenderbuffer); [self.context renderbufferStorage:GL_RENDERBUFFER fromDrawable:(CAEAGLLayer *)self.layer]; @@ -77,6 +88,9 @@ } - (void)renderAtTime:(NSTimeInterval)time { + if (!self.context) { + return; + } [EAGLContext setCurrentContext:self.context]; glBindFramebuffer(GL_FRAMEBUFFER, self.framebuffer); glViewport(0, 0, self.drawableWidth, self.drawableHeight); diff --git a/Sources/EVEViewController.mm b/Sources/EVEViewController.mm index d5a64f2..60e8270 100644 --- a/Sources/EVEViewController.mm +++ b/Sources/EVEViewController.mm @@ -113,7 +113,7 @@ self.overlayLabel.text = [NSString stringWithFormat: @"EVE Canvas\n" - "OpenGL ES 3.0 + UIKit text\n" + "native shell + UIKit text\n" "points %.0fx%.0f pixels %.0fx%.0f @ %.1fx\n" "fps %.1f touches %lu\n" "accel %+0.2f %+0.2f %+0.2f\n" diff --git a/scripts/stage-to-eve.ps1 b/scripts/stage-to-eve.ps1 index ed981f6..8977005 100644 --- a/scripts/stage-to-eve.ps1 +++ b/scripts/stage-to-eve.ps1 @@ -12,8 +12,13 @@ if (Test-Path $archive) { Remove-Item -LiteralPath $archive -Force } -tar -cf $archive -C $projectRoot . -ssh $Target "mkdir -p '$RemotePath'" +tar ` + --exclude=.git ` + --exclude=.theos ` + --exclude=packages ` + -cf $archive ` + -C $projectRoot . +ssh $Target "mkdir -p '$RemotePath' && rm -rf '$RemotePath/.git' '$RemotePath/.theos' '$RemotePath/packages'" scp $archive "${Target}:/tmp/eve-canvas-source.tar" ssh $Target "tar -xf /tmp/eve-canvas-source.tar -C '$RemotePath' && rm /tmp/eve-canvas-source.tar && find '$RemotePath' -maxdepth 2 -type f | sort"