summaryrefslogtreecommitdiffstats
path: root/libdimension/dimension
diff options
context:
space:
mode:
Diffstat (limited to 'libdimension/dimension')
-rw-r--r--libdimension/dimension/finishes.h31
-rw-r--r--libdimension/dimension/texture.h27
2 files changed, 58 insertions, 0 deletions
diff --git a/libdimension/dimension/finishes.h b/libdimension/dimension/finishes.h
new file mode 100644
index 0000000..da18a6f
--- /dev/null
+++ b/libdimension/dimension/finishes.h
@@ -0,0 +1,31 @@
+/*************************************************************************
+ * Copyright (C) 2009 Tavian Barnes <tavianator@gmail.com> *
+ * *
+ * This file is part of The Dimension Library. *
+ * *
+ * The Dimension Library is free software; you can redistribute it and/ *
+ * or modify it under the terms of the GNU Lesser General Public License *
+ * as published by the Free Software Foundation; either version 3 of the *
+ * License, or (at your option) any later version. *
+ * *
+ * The Dimension Library is distributed in the hope that it will be *
+ * useful, but WITHOUT ANY WARRANTY; without even the implied warranty *
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
+ * Lesser General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU Lesser General Public *
+ * License along with this program. If not, see *
+ * <http://www.gnu.org/licenses/>. *
+ *************************************************************************/
+
+/*
+ * Custom finishes.
+ */
+
+#ifndef DIMENSION_FINISHES_H
+#define DIMENSION_FINISHES_H
+
+/* A specular finish */
+dmnsn_finish *dmnsn_new_specular_finish();
+
+#endif /* DIMENSION_FINISHES_H */
diff --git a/libdimension/dimension/texture.h b/libdimension/dimension/texture.h
index c26e840..4d0e2d7 100644
--- a/libdimension/dimension/texture.h
+++ b/libdimension/dimension/texture.h
@@ -50,11 +50,38 @@ dmnsn_pigment *dmnsn_new_pigment();
void dmnsn_delete_pigment(dmnsn_pigment *pigment);
/*
+ * Finishes
+ */
+
+/* Forward-declare dmnsn_finish */
+typedef struct dmnsn_finish dmnsn_finish;
+
+/* Finish callback */
+typedef dmnsn_color dmnsn_finish_fn(const dmnsn_finish *finish,
+ dmnsn_color color, dmnsn_vector x0,
+ dmnsn_vector normal,
+ dmnsn_vector reflected);
+
+/* dmnsn_finish definition */
+struct dmnsn_finish {
+ /* Callbacks */
+ dmnsn_finish_fn *finish_fn;
+ dmnsn_free_fn *free_fn;
+
+ /* Generic pointer */
+ void *ptr;
+};
+
+dmnsn_finish *dmnsn_new_finish();
+void dmnsn_delete_finish(dmnsn_finish *finish);
+
+/*
* A complete texture
*/
typedef struct {
dmnsn_pigment *pigment;
+ dmnsn_finish *finish;
} dmnsn_texture;
dmnsn_texture *dmnsn_new_texture();