nuclear@15: #ifndef RENDERER_H_ nuclear@15: #define RENDERER_H_ nuclear@15: nuclear@23: class Level; nuclear@23: nuclear@41: class Renderer { nuclear@41: protected: nuclear@41: int width, height; nuclear@15: nuclear@41: public: nuclear@41: Renderer(); nuclear@41: virtual ~Renderer(); nuclear@33: nuclear@41: virtual bool init(int xsz, int ysz); nuclear@23: nuclear@41: virtual int get_tangent_location() const; nuclear@41: virtual unsigned int get_current_program() const; nuclear@41: nuclear@41: virtual void resize(int xsz, int ysz); nuclear@41: nuclear@62: virtual void render_pre(const Level *level) const; nuclear@41: virtual void render(const Level *level) const = 0; nuclear@62: virtual void render_post(const Level *level) const; nuclear@41: }; nuclear@41: nuclear@41: nuclear@41: class FwdRenderer : public Renderer { nuclear@41: protected: nuclear@41: unsigned int sdrprog; nuclear@41: int tang_attr; nuclear@41: nuclear@41: public: nuclear@41: FwdRenderer(); nuclear@41: ~FwdRenderer(); nuclear@41: nuclear@41: bool init(int xsz, int ysz); nuclear@41: nuclear@41: int get_tangent_location() const; nuclear@41: unsigned int get_current_program() const; nuclear@41: nuclear@41: void render(const Level *level) const; nuclear@41: }; nuclear@41: nuclear@41: nuclear@41: extern Renderer *rend; nuclear@41: nuclear@15: nuclear@15: #endif // RENDERER_H_