TermOx
Public Member Functions | Public Attributes | List of all members
ox::detail::Screen_buffers Class Reference

Holds the current and next screen buffers as Canvas objects. More...

#include <screen_buffers.hpp>

Public Member Functions

 Screen_buffers (ox::Area a)
 Construct with both Canvas objects having Area a.
 
void resize (ox::Area a)
 Resizes both current and next Canvas objects to a.
 
auto area () const -> Area
 Return the current size of the screen buffers.
 
void merge ()
 Merges the next Canvas into the current Canvas. More...
 
auto merge_and_diff () -> Canvas::Diff const &
 Merges the next Canvas into the current Canvas and returns the changes. More...
 
auto generate_color_diff (Color c) -> Canvas::Diff const &
 Generates a Canvas::Diff, with every Glyph from current that has c. More...
 
auto current_screen_as_diff () -> Canvas::Diff const &
 Returns the entire current screen as a Diff. Used on Window Resize.
 

Public Attributes

Canvas current
 
Canvas next
 

Detailed Description

Holds the current and next screen buffers as Canvas objects.

Provides merge and diff capabilities for the two buffers to determine what has changed and what should be written to the screen.

Member Function Documentation

◆ generate_color_diff()

auto ox::detail::Screen_buffers::generate_color_diff ( Color  c) -> Canvas::Diff const&

Generates a Canvas::Diff, with every Glyph from current that has c.

This isn't a true difference, it is meant to be used to generate a list of Glyphs that need to be re-written to the screen. Used by Dynamic_color_engine.

◆ merge()

void ox::detail::Screen_buffers::merge ( )

Merges the next Canvas into the current Canvas.

This will copy every Glyph from next that differs with current into current Canvas.

◆ merge_and_diff()

auto ox::detail::Screen_buffers::merge_and_diff ( ) -> Canvas::Diff const&

Merges the next Canvas into the current Canvas and returns the changes.

This will copy every Glyph from next that differs with current into current, and writes that change to the returned Canvas::Diff object.


The documentation for this class was generated from the following files: