Code sections
Published in

Code sections

SDL graphics: coordinates on macOS

TL;DR: Y range is h–2×h, not 0–h… due to Cocoa!

A few days ago I just wanted to show something new (OK, very old, in fact) to my children: how C can be used to draw things on a screen.

So, I’ve tried to create a simple graphics program using C and SDL library. I’ve chosen SDL because it’s linked by default if we go within Expresso-C on macOS…



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Sorin Dolha

Software developer • happy, married, father×2 • Rust, Swift, WPF, Web • founder of DlhSoft • MacBook enthusiast • writing from Cluj