Skip to content

Application framework based on OpenGL ES 2.0. Runs on desktop machines, Android phones and the web

License

Notifications You must be signed in to change notification settings

ikskuh/zero-graphics

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Zero Graphics

A very minimal OpenGL ES 2.0 library for Zig. Opens you a window and let's you draw things. Comes with a pixel-perfect 2D renderer and maybe some day even with a bit of a 3D api.

Project status

Very work in progress. Right now it's more a proof of concept than everything else

Project Goals

Basic Framework

  • Support the following platforms
    • Wasm
    • Linux Desktop
    • Windows Desktop (not tested, but should work via SDL2)
    • Android
  • Create an OpenGL ES 2.0 context
  • Provide input events
    • Single pointer motion (finger or mouse)
    • Single click event (finger, mouse)
    • Text input for keyboard (utf-8 encoded)
  • Provide window events
    • Resize
    • Close
  • Provide access to the underlying backend
  • Allow creation of single-file applications
    • Single executable for easy distribution
    • Embedded resources

2D Rendering library

  • Pixel perfect drawing of
    • Lines
    • Rectangles
    • Images
  • TTF font rendering via stb_ttf
  • Image loading via stb_image

Features

  • Support for desktop linux
  • Mobile linux (PinePhone) supported as well
  • Browser support via Wasm
  • coming soon: Android support
  • Pixel perfect 2D rendering

Dependencies

Desktop

  • SDL2

Web

Android

  • Android SDK
  • Android NDK
  • Android Build Tools
  • OpenJDK
  • some other tools

Building / Running

Desktop PC

Requires SDL2 to be installed.

zig build -Dbackend=desktop_sdl2 run

A window should open with the application in fullscreen.

Web/Wasm version

Includes a teeny tiny web server for debugging.

zig build -Dbackend=wasm install run

Now visit http://127.0.0.1:8000/index.htm to see the demo.

Android

Connect your phone first and install both a JDK as well as the Android SDK with NDK included.

zig build -Dbackend=android run

The app should now be installed and started on your phone.

About

Application framework based on OpenGL ES 2.0. Runs on desktop machines, Android phones and the web

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

Contributors 3

  •  
  •  
  •