X-Git-Url: https://git.ucc.asn.au/?p=ipdf%2Fcode.git;a=blobdiff_plain;f=src%2Fview.h;h=ff34415d165bf3e35f1164b7bd487b077743246a;hp=ca4c80837147c58f559c3b75ae29ba7be79c22eb;hb=5456793e2aad4235c3db2ca75532c868aaa7c518;hpb=35e4687acd16a28fc923a75d254cdb4fd2fbc524 diff --git a/src/view.h b/src/view.h index ca4c808..ff34415 100644 --- a/src/view.h +++ b/src/view.h @@ -36,22 +36,25 @@ namespace IPDF 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 SetGPURendering(bool state) {m_use_gpu_rendering = state; 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;} - private: struct GPUObjBounds { float x0, y0; float x1, y1; - }; + } __attribute__((packed)); void PrepareRender(); // call when m_render_dirty is true - void UpdateObjBoundsVBO(); // call when m_buffer_dirty is true + void UpdateObjBoundsVBO(unsigned first_obj, unsigned last_obj); // call when m_buffer_dirty is true + + void RenderRange(int width, int height, unsigned first_obj, unsigned last_obj); bool m_use_gpu_transform; bool m_use_gpu_rendering; @@ -77,6 +80,7 @@ namespace IPDF #ifndef QUADTREE_DISABLED QuadTreeIndex m_current_quadtree_node; // The highest node we will traverse. int m_quadtree_max_depth; // The maximum quadtree depth. + void RenderQuadtreeNode(int width, int height, QuadTreeIndex node, int remaining_depth); #endif };