GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - twstokes/swift-gfx-wrapper: A Swift wrapper around the Adafruit GFX library.

BranchesTags
Open more actions menu

Latest commit

 

History

53 Commits
53 Commits

Folders and files

NameName
Last commit message
Last commit date
Media
Media
 
 
Shared
Shared
 
 
SwiftGFXPlayground.playground
SwiftGFXPlayground.playground
 
 
SwiftGFXWrapper.xcodeproj
SwiftGFXWrapper.xcodeproj
 
 
SwiftGFXWrapper.xcworkspace
SwiftGFXWrapper.xcworkspace
 
 
SwiftGFXWrapper
SwiftGFXWrapper
 
 
SwiftGFXWrapperExample
SwiftGFXWrapperExample
 
 
SwiftGFXWrapperMacOS
SwiftGFXWrapperMacOS
 
 
SwiftGFXWrapperMacOSTests
SwiftGFXWrapperMacOSTests
 
 
SwiftGFXWrapperTests
SwiftGFXWrapperTests
 
 
SwiftGFXWrapperWatchOS
SwiftGFXWrapperWatchOS
 
 
.gitignore
.gitignore
 
 
.gitmodules
.gitmodules
 
 
LICENSE
LICENSE
 
 
README.md
README.md
 
 

Repository files navigation

SwiftGFXWrapper

What is this?

This is a Swift -> Objective C -> C / C++ wrapper around the Adafruit GFX library meant to be ran in an iOS / macOS / watchOS environment.

Why would you use it?

  • Prototyping for a device that runs the Adafruit GFX library (e.g. a NeoMatrix)
  • Generating the pixel buffer for a device that you want to push to
  • Playing with pixel graphics in an iOS / macOS / watchOS environment

Getting started

Initialize Git submodules

Install the Adafruit GFX library by running: git submodule update --init

A Swift Playground and an example project are included in this library to get started. SwiftUI is optional. Anything that can observe changes to pixels will work. GFXMatrix can be subclassed to fit your needs.

Basic Usage

After initializing a GFXMatrix, you should be able to use it similarly to the Adafruit GFX library. The most important pieces are:

  • .setDrawCallback - this is the closure that's called for every pixel being drawn
  • .setFrameBlock - this is the closure that's ran on every "step" (equivalent to the loop() Arduino function)

The example code covers:

  1. Setting up a pixel buffer
  2. Initializing a matrix and setting the draw callback function
  3. Initializing a driver to run the step function on the matrix
  4. Calling a graphics routine that sets the frame block

Supported platforms

  • iOS 14.1+
  • macOS 11+
  • watchOS 7.2+

Carthage installation

Add this to your Cartfile: github "twstokes/swift-gfx-wrapper"

About

A Swift wrapper around the Adafruit GFX library.

Topics

adafruitneomatrixswift

Resources

Readme
MIT license
Activity

Stars

4 stars

Watchers

2 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.