mirror of
https://github.com/CTCaer/RetroArch.git
synced 2025-01-03 00:28:27 +00:00
Add pending_events function callback
This commit is contained in:
parent
dbf59a72bd
commit
3f44ba59eb
@ -23,6 +23,14 @@
|
||||
#include "cocoa_common.h"
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static bool ui_application_cocoa_pending_events(void)
|
||||
{
|
||||
NSEvent *event = [NSApp nextEventMatchingMask:NSAnyEventMask untilDate:[NSDate distantPast] inMode:NSDefaultRunLoopMode dequeue:YES];
|
||||
if (!event)
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ui_application_cocoa_process_events(void)
|
||||
{
|
||||
while (1)
|
||||
@ -37,6 +45,7 @@ static void ui_application_cocoa_process_events(void)
|
||||
}
|
||||
|
||||
const ui_application_t ui_application_cocoa = {
|
||||
ui_application_cocoa_pending_events,
|
||||
ui_application_cocoa_process_events,
|
||||
"cocoa"
|
||||
};
|
||||
|
@ -21,11 +21,17 @@
|
||||
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static bool ui_application_null_pending_events(void)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
static void ui_application_null_process_events(void)
|
||||
{
|
||||
}
|
||||
|
||||
const ui_application_t ui_application_null = {
|
||||
ui_application_null_pending_events,
|
||||
ui_application_null_process_events,
|
||||
"null"
|
||||
};
|
||||
|
@ -23,23 +23,28 @@
|
||||
|
||||
#include "../../ui_companion_driver.h"
|
||||
|
||||
static void ui_application_win32_process_events(void)
|
||||
static bool ui_application_win32_pending_events(void)
|
||||
{
|
||||
MSG msg;
|
||||
return PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE);
|
||||
}
|
||||
|
||||
while (PeekMessage(&msg, NULL, 0, 0, PM_NOREMOVE))
|
||||
static void ui_application_win32_process_events(void)
|
||||
{
|
||||
while (ui_application_win32_pending_events())
|
||||
{
|
||||
MSG msg2;
|
||||
MSG msg;
|
||||
|
||||
if (PeekMessage(&msg2, 0, 0, 0, PM_REMOVE))
|
||||
if (PeekMessage(&msg, 0, 0, 0, PM_REMOVE))
|
||||
{
|
||||
TranslateMessage(&msg2);
|
||||
DispatchMessage (&msg2);
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage (&msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const ui_application_t ui_application_win32 = {
|
||||
ui_application_win32_pending_events,
|
||||
ui_application_win32_process_events,
|
||||
"win32"
|
||||
};
|
||||
|
@ -33,6 +33,7 @@ RETRO_BEGIN_DECLS
|
||||
|
||||
typedef struct ui_application
|
||||
{
|
||||
bool (*pending_events)(void);
|
||||
void (*process_events)(void);
|
||||
const char *ident;
|
||||
} ui_application_t;
|
||||
|
Loading…
Reference in New Issue
Block a user