hongtae / swiftvvd Goto Github PK
View Code? Open in Web Editor NEWSwift 3D Game Engine for Windows, macOS, iOS, Linux
License: Apache License 2.0
Swift 3D Game Engine for Windows, macOS, iOS, Linux
License: Apache License 2.0
I'm new to this repo. Looks like either: some stuff is compiling for linux that shouldn't be, or some things that should compile are using Mac-specific types
❯ swift build
Building for debugging...
/home/arckex/SwiftVVD/Sources/DKGUI/Views/Gesture/ButtonGesture.swift:36:19: error: cannot find type 'CGPoint' in scope
var location: CGPoint
^~~~~~~
/home/arckex/SwiftVVD/Sources/DKGUI/Views/Gesture/ButtonGesture.swift:57:65: error: cannot find type 'CGPoint' in scope
override func began(deviceID: Int, buttonID: Int, location: CGPoint) {
^~~~~~~
/home/arckex/SwiftVVD/Sources/DKGUI/Views/Gesture/ButtonGesture.swift:57:19: error: method does not override any method from its superclass
override func began(deviceID: Int, buttonID: Int, location: CGPoint) {
~~~~~~~~ ^
/home/arckex/SwiftVVD/Sources/DKGUI/Views/Gesture/ButtonGesture.swift:68:65: error: cannot find type 'CGPoint' in scope
override func moved(deviceID: Int, buttonID: Int, location: CGPoint) {
^~~~~~~
/home/arckex/SwiftVVD/Sources/DKGUI/Views/Gesture/ButtonGesture.swift:68:19: error: method does not override any method from its superclass
override func moved(deviceID: Int, buttonID: Int, location: CGPoint) {
~~~~~~~~ ^
/home/arckex/SwiftVVD/Sources/DKGUI/Views/Gesture/ButtonGesture.swift:41:26: error: cannot infer contextual base in reference to member 'zero'
self.location = .zero
~^~~~
Around 6 months ago, I asked if this would be available on iPad via swift playgrounds, and was responded with @Hongtae saying that there is no plans currently, but you may add it in the future. As I stated at the beginning, it has been 6 months. I wanted to get an update on where the swift playground version currently is at. Not planned, planned, started, forgot, etc. I hope/expect your quick reply!
How do you open this on swift playgrounds for iPadOS? I don’t have a computer but I really wanna try this, it seem cool!
I cloned repository with LFS, opened package in Xcode 15.2, run TestApp1 and got runtime error:
[DKGame:debug:E8944C00] Notification: name = NSApplicationWillFinishLaunchingNotification, object = Optional(<NSApplication: 0x12861ba50>), userInfo = nil [DKGame:error:E8944C00] SPIRV-Cross: Invalid SPIRV format. [DKGame:error:E8944C00] Shader.compile() error: "Invalid SPIRV format.", spvc_result(rawValue: -1) [DKGame:error:E8944C00] URL(file:///Users/fedor/Library/Developer/Xcode/DerivedData/SwiftVVD-ayyxphwodmnkithitdfowuberhio/Build/Products/Debug/DKGame_DKGUI.bundle/Contents/Resources/SPIRV/default.vert.spv) error: LoadError(message: "Failed to load shader: default.vert") DKGUI/GraphicsContext+Pipeline.swift:452: Fatal error: GraphicsPipelineStates.sharedInstance(commandQueue:) Error: LoadError(message: "Failed to load shader: default.vert")
I've tried on MacBook Pro with M1 and Sonoma 14.5
Not sure what is best solution, but here's one. Maybe windows needs that too? IDK
//
// File: VulkanUnsafePointer.swift
// Author: Hongtae Kim ([email protected])
//
// Copyright (c) 2022-2023 Hongtae Kim. All rights reserved.
//
#if ENABLE_VULKAN
import Foundation
import Vulkan
#if os(Linux)
import Glibc
func strncpy_s(_ dest: UnsafeMutablePointer<CChar>, _ destSize: Int, _ src: UnsafePointer<CChar>, _ count: Int) -> Int {
// Check if the destination size is zero or less
if destSize <= 0 {
return -1 // Invalid destination size
}
// Ensure that we do not copy more than the destination can hold
let copyCount = min(count, destSize - 1)
// Perform the copy
strncpy(dest, src, copyCount)
// Ensure null termination
dest[copyCount] = 0
// If the source string is longer than the destination buffer, return an error
if count >= destSize {
return -1 // Indicate truncation error
}
return 0 // Indicate success
}
#endif
Swift info
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
Output of swift build
swift build
warning: 'vulkan': ignoring declared target(s) 'Vulkan' in the system package
warning: 'vulkan': system packages are deprecated; use system library targets instead
Building for debugging...
error: unknown argument: '-fprofile-instr-generate'
[0/7] Compiling SPIRV-Cross-static spirv_msl.cpp
Not sure how to get around this
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.