mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-09-11 15:13:37 +02:00
Add facility to run callbacks on the window thread
This commit is contained in:
@@ -764,6 +764,13 @@ namespace MainWindow
|
||||
}
|
||||
break;
|
||||
|
||||
case WM_USER_RUN_CALLBACK:
|
||||
{
|
||||
auto callback = reinterpret_cast<void (*)(void *window, void *userdata)>(wParam);
|
||||
void *userdata = reinterpret_cast<void *>(lParam);
|
||||
callback(hWnd, userdata);
|
||||
break;
|
||||
}
|
||||
case WM_USER_GET_BASE_POINTER:
|
||||
Reporting::NotifyDebugger();
|
||||
switch (lParam) {
|
||||
@@ -1135,4 +1142,8 @@ namespace MainWindow
|
||||
return g_isFullscreen;
|
||||
}
|
||||
|
||||
void RunCallbackInWndProc(void (*callback)(void *, void *), void *userdata) {
|
||||
PostMessage(hwndMain, WM_USER_RUN_CALLBACK, reinterpret_cast<WPARAM>(callback), reinterpret_cast<LPARAM>(userdata));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
Reference in New Issue
Block a user