mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-03 01:12:42 +08:00
Add EventTarget & EventBus (#13100)
This commit is contained in:
@@ -32,10 +32,6 @@
|
||||
|
||||
namespace cc {
|
||||
|
||||
SystemWindowManager::SystemWindowManager(IEventDispatch *delegate)
|
||||
: _eventDispatcher(delegate) {
|
||||
}
|
||||
|
||||
int SystemWindowManager::init() {
|
||||
return SDLHelper::init();
|
||||
}
|
||||
@@ -46,12 +42,12 @@ void SystemWindowManager::processEvent(bool *quit) {
|
||||
SDL_Window *sdlWindow = SDL_GetWindowFromID(sdlEvent.window.windowID);
|
||||
// SDL_Event like SDL_QUIT does not associate a window
|
||||
if (!sdlWindow) {
|
||||
SDLHelper::dispatchSDLEvent(_eventDispatcher, 0, sdlEvent, quit);
|
||||
SDLHelper::dispatchSDLEvent(0, sdlEvent, quit);
|
||||
} else {
|
||||
ISystemWindow *window = getWindowFromSDLWindow(sdlWindow);
|
||||
CC_ASSERT(window);
|
||||
uint32_t windowId = window->getWindowId();
|
||||
SDLHelper::dispatchSDLEvent(_eventDispatcher, windowId, sdlEvent, quit);
|
||||
SDLHelper::dispatchSDLEvent(windowId, sdlEvent, quit);
|
||||
}
|
||||
if (*quit) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user