[swift-users] Fwd: Design and performance of Vector2/3/4 and Matrix

David Turnbull dturnbull at gmail.com
Fri Dec 18 17:13:58 CST 2015

On Fri, Dec 18, 2015 at 2:31 PM, Janosch Hildebrand via swift-users <
swift-users at swift.org> wrote:

> You will also want to have this code in the same module that is using this
> type.
> If you're using these types from another module you're limited to
> unspecialized generics which are (unsurprisingly) very slow.

This is becoming clear. Hopefully these patterns can be optimized across
modules eventually. It's easy enough to write a pre-processor that expands
the generics into four specializations. But it doesn't solve everything so
not a priority.

> And since you probably need to drop generics anyway it might make sense to
> simply wrap the respective GLKit types on OS X and iOS for the GLFloat
> variants as they are already highly optimized. I have some wrappers for the
> GLKMatrix and GLKVector types lying around in my own OpenGL wrapper
> (incidentally also named SwiftGL ;-)) which might save you some typing if
> you're interested...

I'm trailblazing cross-platform OpenGL in Swift. Given there's only one
other platform, the key question is, "Does it work on Linux?"

Is your SwiftGL online somewhere? A cursory search didn't yield anything.

-david (https://github.com/AE9RB/SwiftGL)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-users/attachments/20151218/170bf6e0/attachment.html>

More information about the swift-users mailing list