1 #ifndef _framebuffer__hpp__included__
2 #define _framebuffer__hpp__included__
4 #include "core/window.hpp"
5 #include "library/framebuffer.hpp"
6 #include "library/triplebuffer.hpp"
10 class subtitle_commentary
;
22 * Emulator frame buffer.
27 emu_framebuffer(subtitle_commentary
& _subtitles
, settingvar::group
& _settings
, memwatch_set
& _mwatch
,
28 keyboard::keyboard
& _keyboard
);
30 * The main framebuffer.
32 framebuffer::raw main_framebuffer
;
34 * Special screen: "SYSTEM STATE CORRUPT".
36 static framebuffer::raw screen_corrupt
;
38 * The main screen to draw on.
40 framebuffer::fb
<false> main_screen
;
42 * Initialize special screens.
44 * throws std::bad_alloc: Not enough memory.
46 static void init_special_screens() throw(std::bad_alloc
);
48 * Copy framebuffer to backing store, running Lua hooks if any.
50 void redraw_framebuffer(framebuffer::raw
& torender
, bool no_lua
= false, bool spontaneous
= false);
52 * Redraw the framebuffer, reusing contents from last redraw. Runs lua hooks if last redraw ran them.
54 void redraw_framebuffer();
56 * Return last complete framebuffer.
58 framebuffer::raw
get_framebuffer() throw(std::bad_alloc
);
60 * Render framebuffer to main screen.
62 void render_framebuffer();
64 * Get the size of current framebuffer.
66 std::pair
<uint32_t, uint32_t> get_framebuffer_size();
68 * Take a screenshot to specified file.
70 void take_screenshot(const std::string
& file
) throw(std::bad_alloc
, std::runtime_error
);
72 * Kill pending requests associated with object.
74 void render_kill_request(void* obj
);
76 * Get latest screen received from core.
78 framebuffer::raw
& render_get_latest_screen();
79 void render_get_latest_screen_end();
83 framebuffer::raw fbuf
;
84 framebuffer::queue rq
;
95 triplebuffer::triplebuffer
<render_info
> buffering
;
96 bool last_redraw_no_lua
;
97 subtitle_commentary
& subtitles
;
98 settingvar::group
& settings
;
100 keyboard::keyboard
& keyboard
;