| 240 | } |
| 241 | |
| 242 | MaaController* MaaGamepadControllerCreate(void* hWnd, MaaGamepadType gamepad_type, MaaWin32ScreencapMethod screencap_method) |
| 243 | { |
| 244 | LogFunc << VAR_VOIDP(hWnd) << VAR(gamepad_type) << VAR(screencap_method); |
| 245 | |
| 246 | #ifndef _WIN32 |
| 247 | |
| 248 | LogError << "This API " << __FUNCTION__ << " is only available on Windows"; |
| 249 | return nullptr; |
| 250 | |
| 251 | #else |
| 252 | |
| 253 | auto control_unit = MAA_NS::GamepadControlUnitLibraryHolder::create_control_unit(hWnd, gamepad_type, screencap_method); |
| 254 | |
| 255 | if (!control_unit) { |
| 256 | LogError << "Failed to create control unit"; |
| 257 | return nullptr; |
| 258 | } |
| 259 | |
| 260 | return new MAA_CTRL_NS::ControllerAgent(std::move(control_unit)); |
| 261 | #endif |
| 262 | } |
| 263 | |
| 264 | MaaController* MaaWlRootsControllerCreate(const char* wlr_socket_path, MaaBool use_win32_vk_code) |
| 265 | { |