README, Makefile, and license headers master
authorJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 19 Oct 2018 03:34:15 +0000 (06:34 +0300)
committerJohn Tsiombikas <nuclear@member.fsf.org>
Fri, 19 Oct 2018 03:34:15 +0000 (06:34 +0300)
Makefile [new file with mode: 0644]
README.md [new file with mode: 0644]
src/cgmath.h
src/cgmmat.inl
src/cgmquat.inl
src/cgmvec3.inl
src/cgmvec4.inl

diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..487f732
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,21 @@
+PREFIX = /usr/local
+
+.PHONY: all
+all:
+       @echo 'There is nothing to build. Either type "make install" to install the headers'
+       @echo 'system-wide, or just copy all files under "src" to your project.'
+
+
+.PHONY: clean
+clean:
+
+.PHONY: install
+install:
+       mkdir -p $(DESTDIR)$(PREFIX)/include/cgmath
+       cp src/*.h src/*.inl $(DESTDIR)$(PREFIX)/include/cgmath
+
+.PHONY: uninstall
+uninstall:
+       rm -f $(DESTDIR)$(PREFIX)/include/cgmath/*.h
+       rm -f $(DESTDIR)$(PREFIX)/include/cgmath/*.inl
+       rmdir $(DESTDIR)$(PREFIX)/include/cgmath
diff --git a/README.md b/README.md
new file mode 100644 (file)
index 0000000..119aa4a
--- /dev/null
+++ b/README.md
@@ -0,0 +1,29 @@
+gph-cmath: C math library for graphics
+======================================
+
+About
+-----
+gph-cmath is a C math library for graphics programs. It provides a plethora of
+operations on vectors, matrices and quaternions, among other things.
+
+It's conceptually a companion to my C++ math library
+[gph-math](http://github.com/jtsiomb/gph-math), but where gph-math is designed
+with intuitiveness and ease of use as the main priority, this C version is
+designed to be as low-overhead as possible, making it more suitable for more
+resource-constrained target systems.
+For instance most functions modify their first argument, instead of doing an
+extra copy to provide a more natural 3 operand interface. Leaving the copy to
+the user for the cases where it's necessary.
+
+License
+-------
+Copyright (C) 2016 John Tsiombikas <nuclear@member.fsf.org>
+
+This program is free software. Feel free to use, modify, and/or redistribute it
+under the terms of the MIT/X11 license. See LICENSE for details.
+
+How to use
+----------
+There's nothing to build. All functions are static inline, defined in the header
+files. Either type `make install` to install them system-wide, or just copy all
+files under `src/` to your project source tree.
index 675daba..33b0717 100644 (file)
@@ -1,4 +1,4 @@
-/* C version of the graphene math library
+/* gph-cmath - C graphics math library
  * Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
  *
  * This program is free software. Feel free to use, modify, and/or redistribute
  * Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
  *
  * This program is free software. Feel free to use, modify, and/or redistribute
@@ -18,7 +18,7 @@
  *
  * NOTE: matrices are treated by all operations as column-major, to match OpenGL
  * conventions, so everything is pretty much transposed.
  *
  * NOTE: matrices are treated by all operations as column-major, to match OpenGL
  * conventions, so everything is pretty much transposed.
- */
+*/
 #ifndef CGMATH_H_
 #define CGMATH_H_
 
 #ifndef CGMATH_H_
 #define CGMATH_H_
 
index e97099d..155c83b 100644 (file)
@@ -1,3 +1,12 @@
+/*
+gph-cmath - C graphics math library
+Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
+
+This program is free software. Feel free to use, modify, and/or redistribute
+it under the terms of the MIT/X11 license. See LICENSE for details.
+If you intend to redistribute parts of the code without the LICENSE file
+replace this paragraph with the full contents of the LICENSE file.
+*/
 static inline void cgm_mcopy(float *dest, const float *src)
 {
        memcpy(dest, src, 16 * sizeof(float));
 static inline void cgm_mcopy(float *dest, const float *src)
 {
        memcpy(dest, src, 16 * sizeof(float));
index f0b0ee3..79c622c 100644 (file)
@@ -1,3 +1,11 @@
+ /*
+Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
+
+This program is free software. Feel free to use, modify, and/or redistribute
+it under the terms of the MIT/X11 license. See LICENSE for details.
+If you intend to redistribute parts of the code without the LICENSE file
+replace this paragraph with the full contents of the LICENSE file.
+*/
 static inline void cgm_qcons(cgm_quat *q, float x, float y, float z, float w)
 {
        q->x = x;
 static inline void cgm_qcons(cgm_quat *q, float x, float y, float z, float w)
 {
        q->x = x;
index 429c34e..05bb895 100644 (file)
@@ -1,3 +1,11 @@
+ /*
+Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
+
+This program is free software. Feel free to use, modify, and/or redistribute
+it under the terms of the MIT/X11 license. See LICENSE for details.
+If you intend to redistribute parts of the code without the LICENSE file
+replace this paragraph with the full contents of the LICENSE file.
+*/
 static inline void cgm_vcons(cgm_vec3 *v, float x, float y, float z)
 {
        v->x = x;
 static inline void cgm_vcons(cgm_vec3 *v, float x, float y, float z)
 {
        v->x = x;
index f333403..4f83af7 100644 (file)
@@ -1,3 +1,11 @@
+ /*
+Copyright (C) 2018 John Tsiombikas <nuclear@member.fsf.org>
+
+This program is free software. Feel free to use, modify, and/or redistribute
+it under the terms of the MIT/X11 license. See LICENSE for details.
+If you intend to redistribute parts of the code without the LICENSE file
+replace this paragraph with the full contents of the LICENSE file.
+*/
 static inline void cgm_wcons(cgm_vec4 *v, float x, float y, float z, float w)
 {
        v->x = x;
 static inline void cgm_wcons(cgm_vec4 *v, float x, float y, float z, float w)
 {
        v->x = x;