From: John Tsiombikas Date: Mon, 21 Dec 2020 11:16:29 +0000 (+0200) Subject: liberebus: moved public header to src/ X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=b5cff57ff6e83f7660e31636a986d2fcedf786e5;p=erebus2020 liberebus: moved public header to src/ --- diff --git a/erebus/Makefile b/erebus/Makefile index 9e8bdb5..ea7300a 100644 --- a/erebus/Makefile +++ b/erebus/Makefile @@ -4,7 +4,7 @@ dep = $(src:.c=.d) bin = erebus -incdir = -I../liberebus/include +incdir = -I../liberebus/src libdir = -L../liberebus CFLAGS = -pedantic -Wall $(opt_dbg) $(opt_opt) $(incdir) diff --git a/liberebus/Makefile b/liberebus/Makefile index fdcf704..0ec834b 100644 --- a/liberebus/Makefile +++ b/liberebus/Makefile @@ -5,9 +5,7 @@ dep = $(src:.c=.d) name = erebus alib = lib$(name).a -incdir = -Iinclude - -CFLAGS = -pedantic -Wall $(opt_dbg) $(opt_opt) $(incdir) +CFLAGS = -pedantic -Wall $(opt_dbg) $(opt_opt) LDFLAGS = -lm $(alib): $(obj) @@ -27,10 +25,9 @@ cleandep: install: $(alib) mkdir -p $(DESTDIR)$(PREFIX)/include/erebus $(DESTDIR)$(PREFIX)/lib cp $(alib) $(DESTDIR)$(PREFIX)/lib/$(alib) - cp include/*.h $(DESTDIR)$(PREFIX)/include/erebus/ + cp src/erebus.h $(DESTDIR)$(PREFIX)/include/erebus.h .PHONY: uninstall uninstall: rm -f $(DESTDIR)$(PREFIX)/lib/$(alib) - rm -f $(DESTDIR)$(PREFIX)/include/erebus/*.h - rmdir $(DESTDIR)$(PREFIX)/include/erebus + rm -f $(DESTDIR)$(PREFIX)/include/erebus.h diff --git a/liberebus/include/erebus.h b/liberebus/include/erebus.h deleted file mode 100644 index c439e43..0000000 --- a/liberebus/include/erebus.h +++ /dev/null @@ -1,44 +0,0 @@ -#ifndef RENDLIB_H_ -#define RENDLIB_H_ - -#include - -struct erb_node; -struct erb_surf; -struct erb_ray; -struct erb_hit; - -typedef int (*erb_intersect_func)(struct erb_surf *surf, struct erb_ray *ray, struct erb_hit *hit); -typedef void (*erb_sample_func)(struct erb_surf *surf, cgm_vec3 *pos); - -struct erb_node { - struct erb_node *par; /* parent node */ - struct erb_node *clist; /* child nodes */ - struct erb_surf *surflist; /* surfaces in this node */ - float xform[16], inv_xform[16]; /* global transformation */ - float node_xform[16], inv_node_xform[16]; /* local transformation */ -}; - -struct erb_surf { - struct erb_node *node; /* transformation node for this surface */ - - erb_intersect_func isect; /* intersection routine */ - erb_sample_func sample; /* random sample generation */ -}; - -struct erb_ray { - cgm_vec3 o, d; /* origin and direction */ - float tmin, tmax; /* segment bounds */ - float ior; /* IOR of the medium through which this ray travels */ - float total_dist; /* travel distance accumulator */ -}; - -struct erb_hit { - float t, err; - struct erb_surf *surf; -}; - -int erb_init(void); -void erb_cleanup(void); - -#endif /* RENDLIB_H_ */ diff --git a/liberebus/src/erebus.h b/liberebus/src/erebus.h new file mode 100644 index 0000000..c439e43 --- /dev/null +++ b/liberebus/src/erebus.h @@ -0,0 +1,44 @@ +#ifndef RENDLIB_H_ +#define RENDLIB_H_ + +#include + +struct erb_node; +struct erb_surf; +struct erb_ray; +struct erb_hit; + +typedef int (*erb_intersect_func)(struct erb_surf *surf, struct erb_ray *ray, struct erb_hit *hit); +typedef void (*erb_sample_func)(struct erb_surf *surf, cgm_vec3 *pos); + +struct erb_node { + struct erb_node *par; /* parent node */ + struct erb_node *clist; /* child nodes */ + struct erb_surf *surflist; /* surfaces in this node */ + float xform[16], inv_xform[16]; /* global transformation */ + float node_xform[16], inv_node_xform[16]; /* local transformation */ +}; + +struct erb_surf { + struct erb_node *node; /* transformation node for this surface */ + + erb_intersect_func isect; /* intersection routine */ + erb_sample_func sample; /* random sample generation */ +}; + +struct erb_ray { + cgm_vec3 o, d; /* origin and direction */ + float tmin, tmax; /* segment bounds */ + float ior; /* IOR of the medium through which this ray travels */ + float total_dist; /* travel distance accumulator */ +}; + +struct erb_hit { + float t, err; + struct erb_surf *surf; +}; + +int erb_init(void); +void erb_cleanup(void); + +#endif /* RENDLIB_H_ */ diff --git a/xerebus/Makefile b/xerebus/Makefile index 6a3101d..dfb0861 100644 --- a/xerebus/Makefile +++ b/xerebus/Makefile @@ -5,7 +5,7 @@ dep = $(src:.c=.d) bin = xerebus def = -DMINIGLUT_USE_LIBC -incdir = -I../liberebus/include +incdir = -I../liberebus/src libdir = -L../liberebus CFLAGS = -pedantic -Wall $(opt_dbg) $(opt_opt) $(def) $(incdir)