<div dir="ltr"><div><div>Behold, the power of Swift:</div><div><br></div><div><font face="monospace, monospace">public func +&lt;T:GLmathScalarType&gt;(x1: T, x2: T) -&gt; T {<br></font></div><div><font face="monospace, monospace">    return T(x1, x2, +)</font></div><div><font face="monospace, monospace">}</font></div></div><div><br></div><div>This is how the addition operator is implemented in SwiftGL. There&#39;s no gyb, no macros, and no shenanigans. In less than 80 characters we created an addition operator for 36 types.</div><div><br></div><div>SwiftGL fundamentals are now complete. Everything in the OpenGL 4.5 spec is available in the loader. All the types, operators, and functions in the GLSL 4.5 spec are available in the math library. This is a strong foundation for 3D programming with the open source Swift. Nobody is going to pull the rug out from under you since everything is implemented to a spec that&#39;s been developed for over 20 years.</div><div><br></div><div>Funny thing is, even though everything is written to a C spec, it&#39;s all very Swifty. All the types are MutableCollectionType, Hashable, and Equatable. Almost everything is generic with deep prototypes. Even most of the functions were already in Swift with exactly the same name. About the only disconnect is that GLSL types aren&#39;t capitalized.<br></div><div><br></div><div><div>To prove the math library I wrote a new demo. This one has basic lighting and camera movement with WASD. It will work on Mac and Linux. Give it a try.</div><div><br></div></div><div>Even if you&#39;re not interested in 3D programming, if the above example has you curious there&#39;s more where that came from. SwiftGL has over 36000 lines of code across 49 files. It was all written by one person after Swift became open source and no, that&#39;s not an extra zero.</div><div><br></div><div><a href="https://github.com/AE9RB/SwiftGL" target="_blank">https://github.com/AE9RB/SwiftGL</a><br></div><div><br></div><div>There&#39;s still plenty to do. Documentation, tutorials, more unit tests, libraries for resource loading, graph management, and functions that&#39;s aren&#39;t in the spec. I&#39;m optimistic that others will see Swift as a great tool for creative coding and we&#39;ll soon have awesome tools.</div><div><br></div><div>-David &quot;Expression too complex&quot; Turnbull</div></div>