added diffuse and specular colors to Material, switched all "private:" to "protected:"
git-svn-id: svn://anubis/fart/trunk@69 7f9b0f55-74a9-4bce-be96-3c2cd072584d
This commit is contained in:
1 parent
04b8ea5f9e
commit
18c0c8d45f
8 files changed
+15
-11
No files matched your search
+1
-1
@@ -42,7 +42,7 @@ public:
|
||||
int getWidth() { return m_info.width; }
|
||||
int getHeight() { return m_info.height; }
|
||||
|
||||
private:
|
||||
protected:
|
||||
FILE * m_fp;
|
||||
header_t m_header;
|
||||
info_t m_info;
|
||||
|
||||
+4
-3
@@ -1,9 +1,10 @@
|
||||
|
||||
#include "Material.h"
|
||||
|
||||
const Material Material::white(Color::white);
|
||||
const Material Material::white;
|
||||
|
||||
Material::Material(const Color & rgb)
|
||||
Material::Material()
|
||||
{
|
||||
m_rgb = rgb;
|
||||
m_diffuse_color = Color::white;
|
||||
m_specular_color = Color::white;
|
||||
}
|
||||
+5
-2
@@ -7,11 +7,14 @@
|
||||
class Material
|
||||
{
|
||||
public:
|
||||
Material(const Color & rgb = Color::white);
|
||||
/* static members */
|
||||
static const Material white;
|
||||
|
||||
Material();
|
||||
|
||||
protected:
|
||||
Color m_rgb;
|
||||
Color m_diffuse_color;
|
||||
Color m_specular_color;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+1
-1
@@ -32,7 +32,7 @@ class Scene
|
||||
~Scene();
|
||||
void render();
|
||||
|
||||
private:
|
||||
protected:
|
||||
/* private methods */
|
||||
void load(const char * filename);
|
||||
void renderPixel(int x, int y, unsigned char * pixel);
|
||||
|
||||
Reference in new issue
Block a user