Skip to content

Commit

Permalink
Restructure
Browse files Browse the repository at this point in the history
  • Loading branch information
CharlesAverill committed Oct 11, 2023
1 parent 217dc8e commit a3637d1
Show file tree
Hide file tree
Showing 17 changed files with 24 additions and 22 deletions.
2 changes: 1 addition & 1 deletion bin/argparse.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open Zenith.Mesh
open Zenith.Obj
open Zenith.Objloader

type arguments = { obj_mesh : mesh }

Expand Down
2 changes: 1 addition & 1 deletion bin/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(executable
(public_name zenith)
(name main)
(libraries zenith graphics))
(libraries zenith zenith.logging graphics))
5 changes: 2 additions & 3 deletions bin/main.ml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
open Graphics
open Logging
open Zenith.Config
open Zenith.Logging
open Zenith.Mesh
open Zenith.Render
open List
open Zenith.Renderer

let clear_window color =
let fg = foreground in
Expand Down
2 changes: 1 addition & 1 deletion lib/config.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Vector
open Math.Vector
open Graphics

let viewportw, viewporth = (700, 700)
Expand Down
4 changes: 2 additions & 2 deletions lib/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(library
(name zenith)
(modules render vector matrix mesh obj config input constants logging)
(libraries graphics))
(modules renderer mesh objloader config)
(libraries graphics zenith.logging zenith.math))
6 changes: 0 additions & 6 deletions lib/input.ml

This file was deleted.

4 changes: 4 additions & 0 deletions lib/logging/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
(library
(name logging)
(public_name zenith.logging)
(modules logging))
File renamed without changes.
File renamed without changes.
5 changes: 5 additions & 0 deletions lib/math/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(library
(name math)
(public_name zenith.math)
(libraries zenith.logging)
(modules matrix vector constants))
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion lib/mesh.ml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
open Vector
open Math.Vector

type mesh = vec list * (int * int) list

Expand Down
2 changes: 1 addition & 1 deletion lib/obj.ml → lib/objloader.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open Mesh
open Vector
open Math.Vector

type vernacular = Vertex of vec | Edge of (int * int)

Expand Down
6 changes: 3 additions & 3 deletions lib/render.ml → lib/renderer.ml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
open Constants
open Math.Constants
open Config
open Graphics
open Matrix
open Math.Matrix
open Mesh
open Vector
open Math.Vector

let draw_line a b =
moveto (int_of_float a.x) (int_of_float a.y);
Expand Down
2 changes: 1 addition & 1 deletion test/dune
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
(test
(name zenith)
(libraries zenith alcotest))
(libraries zenith.math alcotest))
4 changes: 2 additions & 2 deletions test/zenith.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
open Zenith.Matrix
open Zenith.Vector
open Math.Matrix
open Math.Vector

(* Functions to test *)
module To_test = struct
Expand Down

0 comments on commit a3637d1

Please sign in to comment.