Code Monkey home page Code Monkey logo

zig3d's Introduction

Zig3D

The Zig3D library is maintaned by me and is made to make 3D games. It provides the user bindings to the glfw, glad, stb libraries and others. The functions are adapted to the Zig conventions and avoid using C strings in profit of slices (and thus a lot of memory allocation sorry).

How to use

To use this library you have to fetch it with zig: zig fetch --save https://github.com/Darkfllame/Zig3D/archive/<commit>.tar.gz, replace <commit> by the commit hash of you choice or replace it with main (or master, the two works the same) for the latest update.

After adding the dependency, you'll need to add:

const zig3d = b.dependency("zig3d", .{
  .optimize = optimize,
  .target = target,
  // if you're on windows this wont work, look at this [issue](https://github.com/Darkfllame/Zig3D/issues/1) for more infos
  .shared = false,
  .exposeC = true, // optional, set whether to expose c apis under a "capi" namespace. This is for glad, glfw, stb and freetype (even though freetype is always exposed since I did not make the zig API yet)
});

...

exe.root_module.addImport("zig3d", zig3d.module("zig3d"));

to your build.zig file.

You can check out the demos for examples on how to use the library.

Notes:

  • There is low (almost no) documentation, so you'll need to check out on khronos group's site for errors and what parameters do.
  • Most of the library is entirely compiled using zig, so you can expect slow compilation especially when first build.
  • Expect bugs, the library is pretty recent and I'm litteraly going back and forth with this one (I do multiple projects at once, dumb me)

Help me I guess.

Feel free to use, test it and give me ideas for this, you can also help me by proposing pull requests.

Now on 0.12.0

Now works on zig 0.12.0, probably will update it further more on more recent zig updates.

Little things so I don't get sued

Also thanks to mach-engine's dev(s?) for zig support on GLFW and freetype, big mwah

zig3d's People

Contributors

darkfllame avatar

Stargazers

 avatar Ryan S. Northrup (RyNo) avatar

Watchers

 avatar

zig3d's Issues

Shared not working on WIndows

Yeah, for some reasons compiling zig3d on windows causes a bug lld-link: ___chkstk_ms was replaced, sadly i can't do anything about and it's up to the zig foundation to fix it. i guess the bug come from the fact that they recompile libc in a "customy" way and the linker doesn't like it very well. hope they fix it soon, there already is an issue posted on the zig repo about this since a long time (prior to 0.12.0 release).

Also the bug is marked for 0.14.0 release, looking forward to it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.