43 return _framebuffer_size;
52 return (_last_written != _last_read);
61 return (_last_written == _last_read);
74 return (
void *)(
this + 1);
82 _last_read = _last_written;
95 return (
void *)(
this + 1);
111 if (((_event_in + 1) % max_events) == _event_out) {
115 _events[_event_in] = event;
116 _event_in = (_event_in + 1) % max_events;
126 return (_event_in != _event_out);
135 if (_event_in == _event_out) {
138 event = _events[_event_out];
139 _event_out = (_event_out + 1) % max_events;
void close_write_framebuffer()
Releases the framebuffer after a previous call to open_write_framebuffer().
bool ready_for_read() const
Returns true if the framebuffer data has been updated since open_read_framebuffer() was last called.
void close_read_framebuffer()
Releases the framebuffer after a previous call to open_read_framebuffer().
size_t get_framebuffer_size() const
Returns the total number of bytes in the framebuffer.
bool add_event(const Event &event)
Adds a new Event to the queue.
int get_y_size() const
Returns the height of the framebuffer in pixels.
bool get_event(Event &event)
If the queue is nonempty, fills event with the first Event on the queue and returns true.
bool has_event() const
Returns true if the queue has at least one Event to extract, false if it is empty.
void * open_write_framebuffer()
Returns a writable pointer to the framebuffer.
bool ready_for_write() const
Returns true if the framebuffer data has been read since open_write_framebuffer() was last called.
size_t get_row_size() const
Returns the length of a row of the framebuffer, in bytes.
const void * open_read_framebuffer()
Returns a read-only pointer to the framebuffer.
int get_x_size() const
Returns the width of the framebuffer in pixels.