Keep EveCanvas alive without ES3 context
This commit is contained in:
parent
c6c73d60c0
commit
beaed6bc7e
5 changed files with 44 additions and 14 deletions
2
Makefile
2
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
|
||||
|
||||
|
|
|
|||
29
README.md
29
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
|
||||
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue