tjammer / raylib-ocaml

OCaml bindings for raylib and raygui
https://tjammer.github.io/raylib-ocaml/
MIT License
175 stars 14 forks source link

Implement models_first_person_maze #41

Closed yashrk closed 8 months ago

yashrk commented 8 months ago

https://github.com/raysan5/raylib/blob/master/examples/models/models_first_person_maze.c rewritten in OCaml.

The only expression I failed to translate directly is L45:

    model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;    // Set map diffuse texture

I just can't understand what MATERIAL_MAP_DIFFUSE in raylib-ocaml is.

Style and logic improvements are also welcome

tjammer commented 8 months ago

Thanks for the contribution! I will have time to take a look later today. As for

    model.materials[0].maps[MATERIAL_MAP_DIFFUSE].texture = texture;    // Set map diffuse texture

This line is also used in the mesh generation example, see here https://github.com/tjammer/raylib-ocaml/blob/master/examples/models/models_mesh_generation.ml#L43. Note that albedo and diffuse refer to the same texture.

tjammer commented 8 months ago

Thanks!