mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-07-05 23:02:58 +12:00
iOS: Add frontend & frontend build files (#746)
* iOS: Add SwiftUI part to repo * Add iOS build script * Update SDL2 submodule * Fix iOS build script * CI: Update xcode tools for iOS * Update iOS_Build.yml * Update iOS build * Lower XCode version * A * Update project.pbxproj * Update iOS_Build.yml * Update iOS_Build.yml * Update build.sh
This commit is contained in:
parent
761f9264ba
commit
e71cbc9bc3
17 changed files with 822 additions and 4 deletions
51
src/pandios/Pandios/ContentView.swift
Normal file
51
src/pandios/Pandios/ContentView.swift
Normal file
|
@ -0,0 +1,51 @@
|
|||
import AlberDriver
|
||||
import SwiftUI
|
||||
import MetalKit
|
||||
import Darwin
|
||||
|
||||
struct ContentView: UIViewRepresentable {
|
||||
@State var showFileImporter = true
|
||||
|
||||
/*
|
||||
func makeCoordinator() -> Renderer {
|
||||
Renderer(self)
|
||||
}
|
||||
*/
|
||||
|
||||
func makeUIView(context: UIViewRepresentableContext<ContentView>) -> MTKView {
|
||||
let mtkView = MTKView()
|
||||
mtkView.preferredFramesPerSecond = 60
|
||||
mtkView.enableSetNeedsDisplay = true
|
||||
mtkView.isPaused = true
|
||||
|
||||
if let metalDevice = MTLCreateSystemDefaultDevice() {
|
||||
mtkView.device = metalDevice
|
||||
}
|
||||
|
||||
mtkView.framebufferOnly = false
|
||||
mtkView.drawableSize = mtkView.frame.size
|
||||
|
||||
let dispatchQueue = DispatchQueue(label: "QueueIdentification", qos: .background)
|
||||
let metalLayer = mtkView.layer as! CAMetalLayer;
|
||||
|
||||
dispatchQueue.async{
|
||||
iosCreateEmulator()
|
||||
|
||||
while (true) {
|
||||
iosRunFrame(metalLayer);
|
||||
}
|
||||
}
|
||||
|
||||
return mtkView
|
||||
}
|
||||
|
||||
func updateUIView(_ uiView: MTKView, context: UIViewRepresentableContext<ContentView>) {
|
||||
print("Updating MTKView");
|
||||
}
|
||||
}
|
||||
|
||||
struct ContentView_Previews: PreviewProvider {
|
||||
static var previews: some View {
|
||||
ContentView()
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue