From 51c79b9b766261f0a3e225745566232f9f22d13a Mon Sep 17 00:00:00 2001 From: Eryn Wells Date: Wed, 11 Sep 2013 08:56:28 -0700 Subject: [PATCH] Add Material class --- src/SConscript | 1 + src/material.cc | 23 +++++++++++++++++++++++ src/material.h | 24 ++++++++++++++++++++++++ 3 files changed, 48 insertions(+) create mode 100644 src/material.cc create mode 100644 src/material.h diff --git a/src/SConscript b/src/SConscript index 0adc23b..0305912 100644 --- a/src/SConscript +++ b/src/SConscript @@ -7,6 +7,7 @@ Import('env') files = Split(""" basics.cc light.cc + material.cc object.cc object_sphere.cc scene.cc diff --git a/src/material.cc b/src/material.cc new file mode 100644 index 0000000..574ff58 --- /dev/null +++ b/src/material.cc @@ -0,0 +1,23 @@ +/* material.h + * + * Materials are applied to shapes and determine color, texture mapping, shading, etc. + * + * Eryn Wells + */ + +#include "material.h" + + +Color +Material::get_color() + const +{ + return color; +} + + +void +Material::set_color(const Color &c) +{ + color = c; +} diff --git a/src/material.h b/src/material.h new file mode 100644 index 0000000..4f28fa0 --- /dev/null +++ b/src/material.h @@ -0,0 +1,24 @@ +/* material.h + * + * Materials are applied to shapes and determine color, texture mapping, shading, etc. + * + * Eryn Wells + */ + +#ifndef __MATERIAL_H__ +#define __MATERIAL_H__ + +#include "basics.h" + + +class Material +{ +public: + Color get_color(); + void set_color(const Color &c); + +private: + Color color; +}; + +#endif