Graphics programming on macOS using C++ (Code)
Graphics programming on macOS using C++
Part 1: Introduction
About the Book
When people do multi-platform graphics programming on macOS they usually use Vulkan API.
The best resources on learning Vulkan include:
- The unofficial Sascha Willems tutorial
- Alexander Overrode unofficial tutorial
- Khronos documentation
These are absolutely amazing sources of information and I still recommend them to anyone.
However,
Writing a rendering framework is the next step and just like going through the Vulkan API details - it might just not be so obvious to everyone. Also, considering small tweaks one has to deal with when starting the implementation on macOS.
This brings me to my goal I put myself in front of:
I want to provide an introduction and some examples of steps one needs to take to write a Vulkan rendering framework on macOS, so that people familiar or unfamiliar with Vulkan being pros or beginners in C++ could take advantage from.
I decided to put together some information, which otherwise you would need to find by yourself including “How to”s of:
- Installing necessary software on macOS.
- Preparing the environment (Build systems, IDEs, and Window creation frameworks, SDK).
- Making a simple game-like example that will rely entirely on a single command buffer. To effectively use the CPU offloading features of this API.
- Some sneak peak of how to build with CMake all official Apple Metal examples (released during WWDC 2022) so you could have a base to learn Metal in future.
Why I decided to write the book ? What value does it bring ?
- Saves time (configuration, Vulkan specific things in regard to macOS)
- Small little things that make it possible to start more
- Share my approach to writing a Vulkan framework
Did I write all of this code by myself ?
- I used helper functions from Sascha Willems examples and many other official materials from Khronos are MIT licensed code regarding Vulkan.
- I used the official Apple Metal examples released during WWDC 2022.
- I used my own rendering framework written on top of Vulkan API.
Is this book for me ?
Targets of this book are:
- Beginners of graphics development in Vulkan.
- People moving from Windows and Linux to macOS with their Vulkan projects.
- People who already went through the unofficial tutorials and want to write actual application.
Advanced users may skip most of the book and go the code directly. Beginners are advices to go through the book first.
Table of Contents
- Introduction
- Why?
- Objective-C and Swift
- Going C++
- Examples structure
- Useful shortcuts
- Package Managers
- HomeBrew
- MacPorts
- Other
- Build Systems
- CMake
- Premake
- Code
- Integrated Development Environments
- Xcode
- Visual Studio Code
- Eclipse
- CLion
- Qt Creator
- Other
- Code
- Window management libraries
- SDL2
- GLFW
- Generic window
- Code
- Graphics APIs
- OpenGL / OpenGL ES
- Metal
- Vulkan and MoltenVK
- Code
- Application
- Entity Component System
- Minigame
- Code
- Summary
- Introduction
Causes Supported
Open Sourcing Mental Illness, Ltd
Changing how we talk about mental health in the tech community.
https://osmihelp.orgChanging how we talk about mental health in the tech community.
The Leanpub 60 Day 100% Happiness Guarantee
Within 60 days of purchase you can get a 100% refund on any Leanpub purchase, in two clicks.
Now, this is technically risky for us, since you'll have the book or course files either way. But we're so confident in our products and services, and in our authors and readers, that we're happy to offer a full money back guarantee for everything we sell.
You can only find out how good something is by trying it, and because of our 100% money back guarantee there's literally no risk to do so!
So, there's no reason not to click the Add to Cart button, is there?
See full terms...
Earn $8 on a $10 Purchase, and $16 on a $20 Purchase
We pay 80% royalties on purchases of $7.99 or more, and 80% royalties minus a 50 cent flat fee on purchases between $0.99 and $7.98. You earn $8 on a $10 sale, and $16 on a $20 sale. So, if we sell 5000 non-refunded copies of your book for $20, you'll earn $80,000.
(Yes, some authors have already earned much more than that on Leanpub.)
In fact, authors have earnedover $14 millionwriting, publishing and selling on Leanpub.
Learn more about writing on Leanpub
Free Updates. DRM Free.
If you buy a Leanpub book, you get free updates for as long as the author updates the book! Many authors use Leanpub to publish their books in-progress, while they are writing them. All readers get free updates, regardless of when they bought the book or how much they paid (including free).
Most Leanpub books are available in PDF (for computers) and EPUB (for phones, tablets and Kindle). The formats that a book includes are shown at the top right corner of this page.
Finally, Leanpub books don't have any DRM copy-protection nonsense, so you can easily read them on any supported device.
Learn more about Leanpub's ebook formats and where to read them