1 #include "core/window.hpp"
8 uint64_t next_message_to_print
= 0;
11 void dummy_init() throw()
13 platform::pausing_allowed
= false;
16 void dummy_quit() throw()
20 void dummy_notify_message() throw()
22 //Read without lock becase we run in the same thread.
23 while(platform::msgbuf
.get_msg_first() + platform::msgbuf
.get_msg_count() > next_message_to_print
) {
24 if(platform::msgbuf
.get_msg_first() > next_message_to_print
)
25 next_message_to_print
= platform::msgbuf
.get_msg_first();
27 std::cout
<< platform::msgbuf
.get_message(next_message_to_print
++) << std::endl
;
31 void dummy_error_message(const std::string
& text
) throw()
33 std::cerr
<< "Error message: " << text
<< std::endl
;
36 void dummy_fatal_error() throw()
38 std::cerr
<< "Exiting on fatal error." << std::endl
;
41 void dummy_request_rom(rom_request
& req
)
43 throw std::runtime_error("Headless build does not support ROM requests");
46 const char* dummy_name() { return "Dummy graphics plugin"; }
48 struct _graphics_driver driver
= {
51 .notify_message
= dummy_notify_message
,
52 .error_message
= dummy_error_message
,
53 .fatal_error
= dummy_fatal_error
,
55 .request_rom
= dummy_request_rom
60 graphics_driver::graphics_driver(_graphics_driver drv
)
66 bool graphics_driver_is_dummy()
71 void graphics_driver_init() throw()
76 void graphics_driver_quit() throw()
81 void graphics_driver_notify_message() throw()
83 driver
.notify_message();
86 void graphics_driver_error_message(const std::string
& text
) throw()
88 driver
.error_message(text
);
91 void graphics_driver_fatal_error() throw()
96 const char* graphics_driver_name()
101 void graphics_driver_request_rom(rom_request
& req
)
103 driver
.request_rom(req
);