- View(Document & document) : m_document(document), m_bounds(0,0,1,1) {}
- virtual ~View() {}
+ View(Document & document, Screen & screen, const Rect & bounds = Rect(0,0,1,1), const Colour & colour = Colour(0.f,0.f,0.f,1.f));
+ virtual ~View();
+
+ void Render(int width = 0, int height = 0);
+
+ void Translate(Real x, Real y);
+ void ScaleAroundPoint(Real x, Real y, Real scale_amount);
+
+ Rect TransformToViewCoords(const Rect& inp) const;
+
+ const Rect& GetBounds() const { return m_bounds; }
+
+ const bool UsingGPUTransform() const { return m_use_gpu_transform; } // whether view transform calculated on CPU or GPU
+ const bool UsingGPURendering() const { return m_use_gpu_rendering; } // whether GPU shaders are used or CPU rendering
+ void ToggleGPUTransform() { m_use_gpu_transform = (!m_use_gpu_transform); m_bounds_dirty = true; m_buffer_dirty = true; }
+ void ToggleGPURendering() { m_use_gpu_rendering = (!m_use_gpu_rendering); m_bounds_dirty = true; m_buffer_dirty = true; }
+
+
+ void ForceBoundsDirty() {m_bounds_dirty = true;}
+ void ForceBufferDirty() {m_buffer_dirty = true;}
+ void ForceRenderDirty() {m_render_dirty = true;}
+