00001 00002 #ifndef __renderer_hpp__ 00003 #define __renderer_hpp__ 00004 00005 #include <crbn/basic/basic.h> 00006 #include <crbn/basic/ray.hpp> 00007 #include <crbn/basic/intersection.hpp> 00008 00009 #include <crbn/matter/matter.hpp> 00010 #include <crbn/matter/minterface.hpp> 00011 #include <crbn/sampler/sinterface.hpp> 00012 #include <crbn/graphics/grinterface.hpp> 00013 00028 class Renderer 00029 { 00030 public: 00031 Renderer( int smin, int smax ); 00032 virtual ~Renderer(); 00033 00034 inline uint32 memory() { return _memory_used; } 00035 00036 inline void set_minterface( MatterInterface* minterface ) { _minterface = minterface; } 00037 inline void set_sinterface( SamplerInterface* sinterface ) { _sinterface = sinterface; } 00038 inline void set_grinterface( GraphicsInterface* grinterface ) { _grinterface = grinterface; } 00039 00043 virtual bool init() = 0; 00044 00052 virtual bool eval( ray& r, vec3& col ) = 0; 00053 00054 protected: 00055 uint32 _memory_used; 00056 vec3 *_vtab, *_ntab; 00057 int _shadow_min; 00058 int _shadow_max; 00059 int _shadow_step; 00060 00061 MatterInterface* _minterface; 00062 SamplerInterface* _sinterface; 00063 GraphicsInterface* _grinterface; 00064 }; 00065 00066 #endif // __renderer_hpp__