void Wayland_touch_create(SDL_VideoData *data, uint32_t id) { if (data->touch) { Wayland_touch_destroy(data); } data->touch = malloc(sizeof(struct SDL_WaylandTouch)); struct SDL_WaylandTouch *touch = data->touch; touch->touch_extension = wl_registry_bind(data->registry, id, &qt_touch_extension_interface, 1); qt_touch_extension_add_listener(touch->touch_extension, &touch_listener, data); }
void Wayland_touch_create(SDL_VideoData *data, uint32_t id) { struct SDL_WaylandTouch *touch; if (data->touch) { Wayland_touch_destroy(data); } /* !!! FIXME: check for failure, call SDL_OutOfMemory() */ data->touch = SDL_malloc(sizeof(struct SDL_WaylandTouch)); touch = data->touch; touch->touch_extension = wl_registry_bind(data->registry, id, &qt_touch_extension_interface, 1); qt_touch_extension_add_listener(touch->touch_extension, &touch_listener, data); }