N64ModernRuntime/ultramodern/include/ultramodern/error_handling.hpp
Anghelo Carvajal b4dbddb555
Remove RT64 dependency (#35)
* `RendererContext` abstract class

* Delete rt64_layer

* Implement renderer creation callback

* Make `GraphicsConfig` an abstract class

* Remove rt64

* Add renderer callback to `ultramodern::set_callbacks`

* Fix rebase

* Change setup_result's visibility to protected

* Declare abstract `is_equal` method instead of operators

* Various fixes

* Fix issues

* trigger_config_action

* Move GraphicsConfig back to ultramodern

* Change `update_config` to return if any changes were applied

* Rename renderer_wrapper to renderer_context

* Remove SDL2 and other libraries

* Allow registering get_graphics_api_name

* Move WindowHandle to renderer namespace

* Comments explaining which callbacks are required

* Fix CI

* Update readme

* `ULTRAMODERN_QUICK_EXIT` macro

* Remove --config from readme

* Add `add_compile_definitions(NOMINMAX)`
2024-06-10 09:43:38 -04:00

29 lines
782 B
C++

#ifndef __ERROR_HANDLING_HPP__
#define __ERROR_HANDLING_HPP__
#include <cstdlib>
#define ULTRAMODERN_QUICK_EXIT() ultramodern::error_handling::quick_exit(__FILE__, __LINE__, __func__)
namespace ultramodern {
namespace error_handling {
struct callbacks_t {
using message_box_t = void(const char* msg);
/**
* Show an OS dialog with the given `msg`.
*
* The `msg` parameter is always non-`nullptr`.
*/
message_box_t *message_box;
};
void set_callbacks(const callbacks_t& callbacks);
void message_box(const char* msg);
[[noreturn]] void quick_exit(const char* filename, int line, const char *func, int exit_status = EXIT_FAILURE);
}
}
#endif