[qwaq] Add an event handler for graphics

It's very much a hack, but it will do for now until I can rewrite the
whole thing: it's not at all thread safe, but it is over eight years
old and has survived a lot of bit-rot.
This commit is contained in:
Bill Currie 2021-12-22 15:06:17 +09:00
parent f3918471d5
commit 3ffdaccd50

View file

@ -57,6 +57,8 @@ static __attribute__ ((used)) const char rcsid[] = "$Id$";
#include "QF/sys.h"
#include "QF/vid.h"
#include "QF/input/event.h"
#include "QF/plugin/console.h"
#include "QF/plugin/vid_render.h"
@ -82,6 +84,7 @@ quit_f (void)
static progs_t *bi_rprogs;
static func_t qc2d;
static int event_handler_id;
static void
bi_2d (void)
@ -129,6 +132,12 @@ static builtin_t builtins[] = {
{0}
};
static int
event_handler (const IE_event_t *ie_event, void *_pr)
{
return IN_Binding_HandleEvent (ie_event);
}
static void
bi_shutdown (void *data)
{
@ -169,6 +178,9 @@ BI_Graphics_Init (progs_t *pr)
RUA_Game_Init (pr, thread->rua_security);
S_Progs_Init (pr);
event_handler_id = IE_Add_Handler (event_handler, pr);
IE_Set_Focus (event_handler_id);
Con_Init ("client");
if (con_module) {
con_module->data->console->realtime = &con_realtime;