]> git.tdb.fi Git - libs/gl.git/blobdiff - source/renderer.h
Add begin() method to make Renderer reusable
[libs/gl.git] / source / renderer.h
index dd9464127d025ee0ae4ba9612084f91617f8ad67..1f198dae7007b00db30d4c699f0832ce06d0cca1 100644 (file)
@@ -114,6 +114,11 @@ public:
        Renderer(const Camera *);
        ~Renderer();
 
+       /** Resets all internal state and restarts rendering.  There must be no
+       unpopped state in the stack.  It is permissible to call begin() multiple
+       times without an intervening end(). */
+       void begin(const Camera *);
+
        MatrixStack &matrix_stack() { return mtx_stack; }
 
        const Camera *get_camera() const { return camera; }
@@ -151,8 +156,9 @@ public:
        Renderer.  DEPRECATED. */
        void escape();
 
-       /** Ends rendering, unbinding all objects and resetting state.  There must
-       be no unpopped state in the stack. */
+       /** Unbinds all objects and resets related state.  There must be no unpopped
+       state in the stack.  Rendering with the same camera can be restarted without
+       an explicit begin() call. */
        void end();
 
        void exclude(const Renderable &);
@@ -163,6 +169,7 @@ public:
 
 private:
        void apply_state();
+       void reset_state();
 };
 
 } // namespace GL