+
+ /** Begins rendering, allowing commands to be issued. */
+ void begin();
+
+ /** Ends rendering. Any global state is reset to defaults. No further
+ commands are allowed before the next call to begin(). */
+ void end();
+
+ using RendererBackend::begin;
+ using RendererBackend::end;
+
+ /** Saves the current state so it can be restored later. */
+ void push_state();
+
+ /** Restores a previously saved state. Must be matched with an earlier
+ push_state call. */
+ void pop_state();
+
+private:
+ State &get_state() const;
+
+public:
+ void set_pipeline_key(std::uintptr_t);
+ void set_pipeline_key(const void *p) { set_pipeline_key(reinterpret_cast<uintptr_t>(p)); }
+
+ template<typename T>
+ void set_pipeline_key(std::uintptr_t k, T d)
+ { set_pipeline_key(k^(static_cast<uintptr_t>(d)<<((sizeof(std::uintptr_t)-sizeof(T))*std::numeric_limits<char>::digits))); }
+
+ template<typename T>
+ void set_pipeline_key(const void *p, T d) { set_pipeline_key(reinterpret_cast<uintptr_t>(p), d); }