All Projects → floooh → sokol-zig

floooh / sokol-zig

Licence: other
Zig bindings for the sokol headers (https://github.com/floooh/sokol)

Programming Languages

c
50402 projects - #5 most used programming language
Zig
133 projects
objective c
16641 projects - #2 most used programming language
GLSL
2045 projects

Projects that are alternatives of or similar to sokol-zig

Cross
Cross++ Lightweight Crossplatform Game Engine
Stars: ✭ 26 (-80.15%)
Mutual labels:  crossplatform
Qbittorrent
qBittorrent BitTorrent client
Stars: ✭ 13,738 (+10387.02%)
Mutual labels:  crossplatform
pynotifier
Python notifications
Stars: ✭ 54 (-58.78%)
Mutual labels:  crossplatform
Lector
Qt based ebook reader
Stars: ✭ 1,218 (+829.77%)
Mutual labels:  crossplatform
Gitlab Time Tracker Taskbar
🦊🕘 A crossplatform menubar/taskbar application for GitLabs time tracking feature. Currently in BETA!
Stars: ✭ 127 (-3.05%)
Mutual labels:  crossplatform
PengueeBot
Automation tool, visit our discord channel if you have anything to ask
Stars: ✭ 27 (-79.39%)
Mutual labels:  crossplatform
Guilitesamples
✨Small interesting GUI effects could be reused everywhere
Stars: ✭ 409 (+212.21%)
Mutual labels:  crossplatform
react-native-wheel-datepicker
Android & iOS iOS-style Picker & DatePicker Components for ReactNative
Stars: ✭ 72 (-45.04%)
Mutual labels:  crossplatform
Siris
DEPRECATED: The community driven fork of Iris. The fastest web framework for Golang!
Stars: ✭ 146 (+11.45%)
Mutual labels:  crossplatform
react-native-multiplayer-starter
Your next multiplayer game starter using react-native
Stars: ✭ 27 (-79.39%)
Mutual labels:  crossplatform
Moolticute
Mooltipass crossplatform daemon/tools
Stars: ✭ 82 (-37.4%)
Mutual labels:  crossplatform
Swiftcrossplatformframework
Tutorial to create cross platform framework for Swift compatible with Carthage and SwiftPM
Stars: ✭ 98 (-25.19%)
Mutual labels:  crossplatform
gameframework2d
Core Example Program for 2D Game Programming Class
Stars: ✭ 16 (-87.79%)
Mutual labels:  crossplatform
Rnl
RNL - Realtime Network Library - The opensource reliable UDP network library
Stars: ✭ 59 (-54.96%)
Mutual labels:  crossplatform
CLI-Autocomplete
Cross-platform flexible autocomplete library for your CLI applications.
Stars: ✭ 21 (-83.97%)
Mutual labels:  crossplatform
Flutter login
100% Shared Code Android/iOS Login Example - JSON API
Stars: ✭ 589 (+349.62%)
Mutual labels:  crossplatform
Jaya
Cross platform file manager application for Windows, Mac and Linux operating systems. (planned mobile support)
Stars: ✭ 219 (+67.18%)
Mutual labels:  crossplatform
sokol gp
Minimal modern efficient cross platform 2D graphics painter in C
Stars: ✭ 228 (+74.05%)
Mutual labels:  sokol
symreader-converter
Converts between Windows PDB and Portable PDB formats.
Stars: ✭ 50 (-61.83%)
Mutual labels:  crossplatform
hacktrack
HackaTrack 🛤: Say goodbye 👋🏾 to stress and unproductivity in hackathons 👩🏾‍💻!
Stars: ✭ 61 (-53.44%)
Mutual labels:  crossplatform

build

Auto-generated Zig bindings for the sokol headers.

For Zig version 0.9.0 (current 0.10.0 dev version should also work)

If you're on an older Zig version, check the following branches (note that these also contain older versions of the Sokol C headers):

  • zig-0.8.1
  • zig-0.8.0
  • zig-0.7.1

Related projects:

BUILD

Supported platforms are: Windows, macOS, Linux (with X11)

On Linux install the following packages: libglu1-mesa-dev, mesa-common-dev, xorg-dev, libasound-dev (or generally: the dev packages required for X11, GL and ALSA development)

# just build:
> zig build
# build and run samples:
> zig build run-clear
> zig build run-triangle
> zig build run-quad
> zig build run-bufferoffsets
> zig build run-cube
> zig build run-noninterleaved
> zig build run-texcube
> zig build run-offscreen
> zig build run-instancing
> zig build run-mrt
> zig build run-saudio
> zig build run-sgl
> zig build run-sgl-context
> zig build run-sgl-points
> zig build run-debugtext
> zig build run-debugtext-print
> zig build run-debugtext-userfont
> zig build run-shapes

(also run zig build --help to inspect the build targets)

By default, the backend 3D API will be selected based on the target platform:

  • macOS: Metal
  • Windows: D3D11
  • Linux: GL

To force the GL backend on macOS or Windows, build with -Dgl=true:

> zig build -Dgl=true run-clear

The clear sample prints the selected backend to the terminal:

sokol-zig ➤ zig build -Dgl=true run-clear
Backend: .sokol.gfx.Backend.GLCORE33

Use as Library

Clone this repo into your project via git submodule add https://github.com/floooh/sokol-zig.git (for this example into a folder called lib within your project).

Add to your build.zig:

const sokol = @import("lib/sokol-zig/build.zig");

// ...
// pub fn build(b: *std.build.Builder) void {
// ...

const sokol_build = sokol.buildSokol(b, target, mode, Backend.auto, "lib/sokol-zig/");

// ...
// const exe = b.addExecutable("demo", "src/main.zig");
// ...

exe.addPackagePath("sokol", "lib/sokol-zig/src/sokol/sokol.zig");
exe.linkLibrary(sokol_build);
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].