Code Monkey home page Code Monkey logo

swiftsdl2's Issues

Can't start an iosApp

Bug Description

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

Information

  • Package version: 1.4.1
  • Platform version: mac/ios
  • Swift version: swift-driver version: 1.87.1 Apple Swift version 5.9 (swiftlang-5.9.0.128.108 clang-1500.0.40.1)
    Target: x86_64-apple-macosx14.0

Checklist

  • If possible, I've reproduced the issue using the main/master branch of this package.
  • I've searched for existing issues under the issues tab.
  • The bug is reproducible

Steps to Reproduce

Steps to reproduce the behavior:

  1. Create a new XCode project (single app)
  2. Add the package dependency
  3. Copy the minimal example to main.swift file (create the new main file)
  4. comment out the appdelegate
  5. run the app

Expected behavior

To not crash

Actual behavior

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?

Conversion of scancodes to keycodes fails

Bug Description

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 !

Information

  • Package version: 1.3.1
  • Platform version: macOS 12.1
  • Swift version: 5.5.2

Checklist

  • If possible, I've reproduced the issue using the main/master branch of this package.
  • I've searched for existing issues under the issues tab.
  • The bug is reproducible

Support for SDL_ttf

Feature request

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.

Describe the solution you'd like

Add support for SDL_ttf.

Describe alternatives you've considered

I looked for other Swift packages that interface with SDL_ttf but could not find any.

Building on Windows

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:

  • install SDL2 via vcpkg
  • install pkfconf via vcpkg
  • setup the required environment
  • let SPM handle the includes and lib linking for the build

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.

Resources:

Xcode 13 build fails - Module '_Builtin_intrinsics.intel' requires feature 'x86'

Bug Description

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'

Information

  • Package version: master branch
  • Platform version: macOS 11.6
  • Swift version:
 % 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

Checklist

  • If possible, I've reproduced the issue using the main/master branch of this package.
  • I've searched for existing issues under the issues tab.
  • The bug is reproducible

Steps to Reproduce

  • Add as a dependency to an existing project in Xcode 13
  • Attempt to build

Expected behavior

Dependency builds successfully

Actual behavior

Build fails

Screenshots

Screen Shot 2021-11-17 at 1 33 05 PM

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.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
mint
Mintfile
  • realm/SwiftLint 0.52.3
  • nicklockwood/SwiftFormat 0.51.12

  • Check this box to trigger a request for Renovate to run again on this repository

Question about usage

No bugs actually.
Just wonder usage when I have a custom SDL_main function, could I integrate it into this project?
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.