Using Swift with OpenGL

https://developer.apple.com/swift/http://www.opengl.org/

Programming with Mac has changed a lot since the introduction of Swift to the platform.  It's a great language that has grown so much since its conception a year ago.  The tendency is to continue to use old paradigms with new tools; however, Swift is so different from C and Obj-C.  It demands that we rethink how we program on the Mac so we aren't limiting the potential of this new language.

With those ideas in mind, I have endeavored to rethink OpenGL programming in terms of using Swift.  Classically a C++ dominated topic, graphics programming in Swift offers some interesting twists this programming genre.  Though there are some great tutorials for using OpenGL in a Swift project, most of them do not utilize some of the new Swift paradigms (namely protocols, extensions, and more value types instead of reference types).  I am not an expert or even professional programmer by any means, but the tutorials that I shall write here work and are intended to be in line (as much as possible) with the latest information out the WWDC's.  We're going to look into using OpenGL with Swift instead of Metal with Swift because I have older Macs that do not run Metal.  When I get a new Mac one day, then I'll look into writing some tutorials on using Metal with Swift, but until then it is OpenGL all the way.  Also, with the announcement of Swift going open source, a Swift/OpenGL app has the potential to go cross-platform--the reason C++/OpenGL has been such a favorite.

I've been working on some OpenGL with Swift tutorials for a little while, but after WWDC '15, my eyes have been opened to some new possibilities with Swift 2.0.  The tutorials are all prototypes so I encourage you to add some constructive criticism (Note that if you're comment isn't not constructive and plain rude, I will delete it).  Hopefully, I shall be able to develop an extensive library of tutorials on this topic to collect into a book or teaching app.

I encourage you to help me and others as we travel this road together.  To get started, click here.

**The above images are property of Apple and OpenGL, respectively.

Comments

Popular posts from this blog

4.0.0: MVC OpenGL Part 1

0.0: Swift OpenGL Setup