Pyrogenesis
trunk
|
#include "lib/os_path.h"
Go to the source code of this file.
Classes | |
struct | AppHooks |
holds a function pointer (allowed to be NULL) for each hook. More... | |
Macros | |
#define | AH_IS_DEFINED(name) app_hook_was_redefined(offsetof(AppHooks, name)) |
Functions | |
void | ah_override_gl_upload_caps () |
override default decision on using OpenGL extensions relating to texture upload. More... | |
const OsPath & | ah_get_log_dir () |
return path to directory into which crash dumps should be written. More... | |
void | ah_bundle_logs (FILE *f) |
gather all app-related logs/information and write it to file. More... | |
const wchar_t * | ah_translate (const wchar_t *text) |
translate text to the current locale. More... | |
void | ah_translate_free (const wchar_t *text) |
free text that was returned by translate. More... | |
void | ah_log (const wchar_t *text) |
write text to the app's log. More... | |
ErrorReactionInternal | ah_display_error (const wchar_t *text, size_t flags) |
display an error dialog, thus overriding sys_display_error. More... | |
LIB_API void | app_hooks_update (AppHooks *ah) |
update the app hook function pointers. More... | |
bool | app_hook_was_redefined (size_t offset_in_struct) |
was the app hook changed via app_hooks_update from its default value? More... | |
#define AH_IS_DEFINED | ( | name | ) | app_hook_was_redefined(offsetof(AppHooks, name)) |
void ah_bundle_logs | ( | FILE * | f | ) |
gather all app-related logs/information and write it to file.
used when writing a crash log so that all relevant info is in one file.
the default implementation attempts to gather 0ad data, but is fail-safe (doesn't complain if file not found).
f | file into which to write. |
ErrorReactionInternal ah_display_error | ( | const wchar_t * | text, |
size_t | flags | ||
) |
display an error dialog, thus overriding sys_display_error.
text | error message. |
flags | see DebugDisplayErrorFlags. |
the default implementation just returns ERI_NOT_IMPLEMENTED, which causes the normal sys_display_error to be used.
const OsPath& ah_get_log_dir | ( | ) |
return path to directory into which crash dumps should be written.
must be callable at any time - in particular, before VFS init. paths are typically relative to sys_ExecutablePathname.
void ah_log | ( | const wchar_t * | text | ) |
write text to the app's log.
text | to write. |
the default implementation uses stdout.
void ah_override_gl_upload_caps | ( | ) |
override default decision on using OpenGL extensions relating to texture upload.
this should call ogl_tex_override to disable/force their use if the current card/driver combo respectively crashes or supports it even though the extension isn't advertised.
the default implementation works but is hardwired in code and therefore not expandable.
translate text to the current locale.
text | to translate. |
the default implementation just returns the pointer unchanged.
void ah_translate_free | ( | const wchar_t * | text | ) |
free text that was returned by translate.
text | to free. |
the default implementation does nothing.
bool app_hook_was_redefined | ( | size_t | offset_in_struct | ) |
was the app hook changed via app_hooks_update from its default value?
offset_in_struct | byte offset within AppHooks (determined via offsetof) of the app hook function pointer. |