ctreffs / swiftsdl2 Goto Github PK
View Code? Open in Web Editor NEWSwift wrapper around Simple Direct Media Layer (SDL2) for macOS, iOS, Linux and Windows
License: zlib License
Swift wrapper around Simple Direct Media Layer (SDL2) for macOS, iOS, Linux and Windows
License: zlib License
I just created a new project, added the SDL Dependency, created the main.swift file, and when launching the app I get this error
sdlenginetest/main.swift:5: Fatal error: SDL could not initialize! SDL_Error: Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?
I'm using the minimal example you provide
main
/master
branch of this package.Steps to reproduce the behavior:
To not crash
Crash with the following error
sdlenginetest/main.swift:5: Fatal error: SDL could not initialize! SDL_Error: Application didn't initialize properly, did you include SDL_main.h in the file containing your main() function?
SDL_GetScancodeFromKey
and SDL_GetKeyFromScancode
always return 0
For example:
In C:
SDLK_9 // 57
SDL_SCANCODE_9 // 38
SDL_GetScancodeFromKey(SDLK_9) // 38
SDL_GetKeyFromScancode(SDL_SCANCODE_9) // 57
In Swift:
SDLK_9.rawValue // 57
SDL_SCANCODE_9.rawValue // 38
SDL_GetScancodeFromKey(Int32(SDLK_9.rawValue)) // 0 !
SDL_GetKeyFromScancode(SDL_SCANCODE_9) // 0 !
main
/master
branch of this package.Is it possible to provide a minimal cross-platform example?
The Metal example is a bit too complex as a first introduction.
I would like to be able to call SDL_ttf functions from my Swift project. As far as I can tell, the project doesn't currently support this.
Add support for SDL_ttf.
I looked for other Swift packages that interface with SDL_ttf but could not find any.
It's currently hard to build SwiftSDL2 on Windows.
In fact on CI it is not working for now (https://github.com/ctreffs/SwiftSDL2/actions/workflows/ci-windows.yml).
The idea is to:
As of Swift 5.8 everything for this should be in place.
For macOS (brew) and Linux (apt) this way works for ages.
For now it does not however for the Windows platform.
I'm attempting to add this as a dependency to the sm64ex-ios project but building with Xcode 13 fails with the following error:
module.modulemap:38:19: Module '_Builtin_intrinsics.intel' requires feature 'x86'
master
branch % swift --version
swift-driver version: 1.26.9 Apple Swift version 5.5.1 (swiftlang-1300.0.31.4 clang-1300.0.29.6)
Target: x86_64-apple-macosx11.0
main
/master
branch of this package.Dependency builds successfully
Build fails
This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.
These updates have all been created already. Click a checkbox below to force a retry/rebase of any.
.github/workflows/ci-linux.yml
actions/checkout v3.5.3
actions/cache v3.3.1
actions/cache v3.3.1
.github/workflows/ci-macos.yml
actions/checkout v3.5.3
actions/upload-artifact v3.1.2
actions/upload-artifact v3.1.2
actions/upload-artifact v3.1.2
actions/checkout v3.5.3
actions/upload-artifact v3.1.2
actions/upload-artifact v3.1.2
macos 13
macos 12
.github/workflows/ci-windows.yml
actions/checkout v3.5.3
actions/cache v3.3.1
.github/workflows/markdown-link-check.yml
Mintfile
realm/SwiftLint 0.52.3
nicklockwood/SwiftFormat 0.51.12
No bugs actually.
Just wonder usage when I have a custom SDL_main function, could I integrate it into this project?
Thanks.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.