From 1c49ffa07ff510e21b87a6c910db395a7e9ba4f0 Mon Sep 17 00:00:00 2001 From: nothke Date: Wed, 12 Jun 2024 12:58:14 +0200 Subject: [PATCH] Better readme, added why zig and sokol --- readme.md | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/readme.md b/readme.md index f03d251..bd706e5 100644 --- a/readme.md +++ b/readme.md @@ -1,3 +1,29 @@ A little learning playground of [sokol](https://github.com/floooh/sokol) in [zig](https://ziglang.org/). Started on the gamejam at Decentrala, 9th June 2024. -To build, you need to have zig master. Then just `zig build run` and that should be it! \ No newline at end of file +The goal of this project is not fixed, and is just to try out some sokol features. But here's a few things I'd like to try out: +- [x] Draw a circle +- [ ] Load and render textures +- [ ] Render a 3D object +- [ ] Compile it for WebAssembly and run it in the browser + +## Build + +To build, you need to have zig master (you can use [zvm](https://www.zvm.app/) to help you with this). Then just `zig build run` and that should be it! + +Note that if you change shaders, you have to recompile them manually - run compile_shaders.bat. + +## Why zig? + +Zig is a low level language and toolchain that is designed as a "better C". Its main goal is to be simple, robust and fast. A few strong points: +- It can cross-compile from any platform to any platform. +- It can include C headers and you can use it in zig directly. +- It has a built-in build system that is also written in zig, so no other build systems like cmake are needed. +- Unlike C++, it's not OOP, there are no hidden constructor and destructor calls and overcomplicated copy/move rules. +- Unlike C, it solves A LOT of problems of C, and is MUCH harder to shoot yourself in the foot. +- There are no hidden allocations, everything that is heap-allocating has to be done explicitely. +- It has a powerful metaprogramming facility "comptime", which provides full static reflection. +- I can go on listing more cool features, but that is enough for now.. :) + +## Why sokol? + +Sokol is a cross platform graphics library with minimal footprint that can compile to any backend like DirectX, OpenGL, Vulcan, Metal or even WebAssembly. \ No newline at end of file