mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-26 19:58:36 +01:00
Add facility to run callbacks on the window thread
This commit is contained in:
1 parent
616ee81f84
commit
9ec5efdcc5
6 files changed
+31
-2
No files matched your search
@@ -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