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.
Very work in progress. Right now it's more a proof of concept than everything else
- 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
- Pixel perfect drawing of
- Lines
- Rectangles
- Images
- Basic "copy full texture to rectangle"
- Copy portion of texture ("atlas rendering")
- TTF font rendering via
stb_ttf
- Image loading via
zigimg
- Stack based/nested scissoring
- Support for desktop linux
- Mobile linux (PinePhone) supported as well
- Browser support via Wasm
- coming soon: Android support
- Pixel perfect 2D rendering
- SDL2
- Android SDK
- Android NDK
- Android Build Tools
- OpenJDK
- some other tools
Requires SDL2
to be installed.
zig build run
A window should open with the application in fullscreen.
Includes a teeny tiny web server for debugging.
zig build install run-wasm
Now visit http://127.0.0.1:8000/index.htm to see the demo.
Connect your phone first and install both a JDK as well as the Android SDK with NDK included. The ZeroGraphics build system will tell you if it couldn't auto-detect the SDK paths.
zig build -Denable-android run-app
The app should now be installed and started on your phone.