1 #ifndef _framebuffer__hpp__included__
2 #define _framebuffer__hpp__included__
4 #include "core/render.hpp"
7 * The main framebuffer.
9 extern lcscreen framebuffer
;
11 * Special screen: "NO SIGNAL".
13 extern lcscreen screen_nosignal
;
15 * Special screen: "SYSTEM STATE CORRUPT".
17 extern lcscreen screen_corrupt
;
19 * The main screen to draw on.
21 extern screen
<false> main_screen
;
23 * Initialize special screens.
25 * throws std::bad_alloc: Not enough memory.
27 void init_special_screens() throw(std::bad_alloc
);
29 * Copy framebuffer to backing store, running Lua hooks if any.
31 void redraw_framebuffer(lcscreen
& torender
, bool no_lua
= false);
33 * Redraw the framebuffer, reusing contents from last redraw. Runs lua hooks if last redraw ran them.
35 void redraw_framebuffer();
37 * Return last complete framebuffer.
39 lcscreen
get_framebuffer() throw(std::bad_alloc
);
41 * Render framebuffer to main screen.
43 void render_framebuffer();
45 * Get the size of current framebuffer.
47 std::pair
<uint32_t, uint32_t> get_framebuffer_size();
49 * Take a screenshot to specified file.
51 void take_screenshot(const std::string
& file
) throw(std::bad_alloc
, std::runtime_error
);
55 std::pair
<uint32_t, uint32_t> get_scale_factors(uint32_t width
, uint32_t height
);