#ifndef RENDERER_H_
#define RENDERER_H_
-/*
- this might change:
- atm we are going to have 1 renderer per scene and 1 shader program
- for the scene
- */
-class Camera;
+class OrbitCamera;
+class Object;
class Scene;
class ShaderProgram;
-class Object;
+class Texture;
class Renderer {
protected:
+ int diff_loc;
+ int spec_loc;
+ int shin_loc;
+ int mmviewproj_loc;
+ int mview_loc;
+ int mmod_loc;
+ int fog_loc;
+ int dstex_loc;
+ int stex_loc;
+
ShaderProgram *sprog;
- virtual void draw_object(Object *object) const = 0;
+
+ /* debug shader to draw normals */
+ ShaderProgram *nprog;
+
+ Texture *skytex, *dskytex;
+
+ virtual void draw_object(Object *object) const;
+ virtual void draw_skybox() const;
public:
+ float fog_density;
+
Scene *scene;
- Camera *camera;
+ OrbitCamera *camera;
Renderer();
- Renderer(ShaderProgram *sprog, Scene *scene, Camera *camera);
virtual ~Renderer();
- /* for the moment each Renderer creates and destroys the ShaderProgram
- because we are using only a couple of shaders, in the future we might need a shader
- manager that stores the shaders and replace these functions with something like:
- void set_shader_program(ShaderProgram *sprog) */
- virtual bool init_shaders(const char *vfname, const char *ffname) = 0;
- virtual void destroy_shaders() = 0;
+ virtual bool create();
+ virtual void draw() const;
- virtual void draw() const = 0;
+ virtual void set_sky_tex(Texture *stex);
+ virtual void set_diffuse_sky_tex(Texture *dstex);
};
#endif // RENDERER_H_
\ No newline at end of file