Swift OpenGL 示例:跨平台图形编程

这个项目展示了如何使用 Swift 编写简单的 OpenGL 应用程序,并使其能够在多个平台上运行,包括 Ubuntu(Linux)、macOS、iOS 和 Android,未来还计划支持一些其他平台。

以下是不同平台上的运行步骤:

macOS 和 iOS:

1. 打开终端,克隆代码仓库到目标目录。

2. 运行 swift build 构建项目。

3. 在终端运行 .build/debug/app 或者使用 Xcode 打开 opengl_example.xcodeproj 项目运行。

Linux (Ubuntu 64 位):

1. 打开终端,克隆代码仓库到目标目录。

2. 运行 swift build 构建项目。

3. 运行 .build/debug/app。

zip
Swift_OpenGL_Example-main.zip 预估大小:74个文件
folder
Swift_OpenGL_Example-main 文件夹
file
.gitignore 162B
file
Package.swift 1KB
file
README.md 1KB
folder
Sources 文件夹
folder
CAndroidGL 文件夹
file
gl2.h 160B
file
gl3.h 208B
file
module.modulemap 199B
file
gl.h 174B
folder
AndroidLog 文件夹
file
AndroidLog.swift 2KB
folder
app 文件夹
file
MatrixTransform.swift 15KB
file
main.swift 529B
file
Shader.swift 8KB
file
Cube.swift 2KB
file
Geometry.swift 2KB
file
Scene.swift 4KB
file
App.swift 2KB
file
main_android.swift 1KB
folder
CAndroidLog 文件夹
file
shim.h 164B
file
module.modulemap 100B
file
LICENSE 1KB
file
screen1.png 56KB
file
Builder.sh 2KB
file
Default-568h@2x.png 36KB
folder
opengl_example.xcodeproj 文件夹
folder
project.xcworkspace 文件夹
file
contents.xcworkspacedata 135B
folder
xcshareddata 文件夹
file
IDEWorkspaceChecks.plist 238B
file
Info_ios.plist 1KB
file
project.pbxproj 20KB
folder
xcshareddata 文件夹
folder
xcschemes 文件夹
file
app.xcscheme 3KB
file
xcschememanagement.plist 257B
file
AppBase_Info.plist 723B
file
AppBase_Info_ios.plist 723B
folder
Android 文件夹
file
.gitignore 241B
folder
gradle 文件夹
folder
wrapper 文件夹
file
gradle-wrapper.jar 53KB
file
gradle-wrapper.properties 230B
file
local.properties 343B
file
build.gradle 1KB
file
gradlew.bat 2KB
file
gradlew 5KB
folder
app 文件夹
file
build.gradle 4KB
file
proguard-rules.pro 751B
folder
src 文件夹
folder
test 文件夹
folder
java 文件夹
folder
com 文件夹
folder
home 文件夹
folder
Swift_OpenGL_Example 文件夹
file
ExampleUnitTest.java 378B
folder
main 文件夹
file
AndroidManifest.xml 915B
folder
java 文件夹
folder
com 文件夹
folder
home 文件夹
folder
Swift_OpenGL_Example 文件夹
file
SwiftApp.java 429B
file
MainActivity.java 3KB
file
GLView.java 11KB
folder
res 文件夹
folder
values 文件夹
file
styles.xml 381B
file
colors.xml 208B
file
strings.xml 75B
folder
mipmap-xxhdpi 文件夹
file
ic_launcher_round.png 10KB
file
ic_launcher.png 6KB
folder
drawable-v24 文件夹
file
ic_launcher_foreground.xml 2KB
folder
mipmap-anydpi-v26 文件夹
file
ic_launcher.xml 270B
file
ic_launcher_round.xml 270B
folder
mipmap-xhdpi 文件夹
file
ic_launcher_round.png 7KB
file
ic_launcher.png 4KB
folder
mipmap-hdpi 文件夹
file
ic_launcher_round.png 5KB
file
ic_launcher.png 3KB
folder
drawable 文件夹
file
ic_launcher_background.xml 5KB
folder
mipmap-mdpi 文件夹
file
ic_launcher_round.png 3KB
file
ic_launcher.png 2KB
folder
mipmap-xxxhdpi 文件夹
file
ic_launcher_round.png 15KB
file
ic_launcher.png 9KB
folder
androidTest 文件夹
folder
java 文件夹
folder
com 文件夹
folder
home 文件夹
folder
Swift_OpenGL_Example 文件夹
file
ExampleInstrumentedTest.java 719B
file
Readme.md 858B
file
gradle.properties 912B
folder
.idea 文件夹
file
runConfigurations.xml 564B
file
encodings.xml 135B
file
vcs.xml 183B
file
misc.xml 530B
file
modules.xml 407B
file
gradle.xml 811B
file
settings.gradle 15B
file
screen2.png 308KB
file
screen3.png 152KB
file
swiftToolchain.rc 216B
...
zip 文件大小:691.19KB