2 #include "core/window.hpp"
9 uint64_t next_message_to_print
= 0;
12 void dummy_init() throw()
14 platform::pausing_allowed
= false;
17 void dummy_quit() throw()
21 void dummy_notify_message() throw()
23 //Read without lock becase we run in the same thread.
24 while(platform::msgbuf
.get_msg_first() + platform::msgbuf
.get_msg_count() > next_message_to_print
) {
25 if(platform::msgbuf
.get_msg_first() > next_message_to_print
)
26 next_message_to_print
= platform::msgbuf
.get_msg_first();
28 std::cout
<< platform::msgbuf
.get_message(next_message_to_print
++) << std::endl
;
32 void dummy_notify_status() throw()
36 void dummy_notify_screen() throw()
40 bool dummy_modal_message(const std::string
& text
, bool confirm
) throw()
42 std::cerr
<< "Modal message: " << text
<< std::endl
;
46 void dummy_fatal_error() throw()
48 std::cerr
<< "Exiting on fatal error." << std::endl
;
51 const char* dummy_name() { return "Dummy graphics plugin"; }
53 struct _graphics_driver driver
= {
56 .notify_message
= dummy_notify_message
,
57 .notify_status
= dummy_notify_status
,
58 .notify_screen
= dummy_notify_screen
,
59 .modal_message
= dummy_modal_message
,
60 .fatal_error
= dummy_fatal_error
,
66 graphics_driver::graphics_driver(_graphics_driver drv
)
72 bool graphics_driver_is_dummy()
77 void graphics_driver_init() throw()
82 void graphics_driver_quit() throw()
87 void graphics_driver_notify_message() throw()
89 driver
.notify_message();
92 void graphics_driver_notify_status() throw()
94 driver
.notify_status();
97 void graphics_driver_notify_screen() throw()
99 driver
.notify_screen();
102 bool graphics_driver_modal_message(const std::string
& text
, bool confirm
) throw()
104 return driver
.modal_message(text
, confirm
);
107 void graphics_driver_fatal_error() throw()
109 driver
.fatal_error();
112 const char* graphics_driver_name()
114 return driver
.name();