MGL(Win32)
読み取り中…
検索中…
一致する文字列を見つけられません
mgl_mouse_delegate_apple_gc.h
[詳解]
1// SPDX-License-Identifier: Zlib
2/* ------------------------------------------------------------------------- */
9/* ------------------------------------------------------------------------- */
10
11#ifndef INCGUARD_MGL_MOUSE_DELEGATE_APPLE_GC_H_1656972059
12#define INCGUARD_MGL_MOUSE_DELEGATE_APPLE_GC_H_1656972059
13
14#include <mgl/mgl_environment.h>
15
16#if defined(MGL_TARGET_MACOS) || defined(MGL_TARGET_IOS) || defined(MGL_TARGET_TVOS)
17
18
19#if defined(__OBJC__)
20#include <GameController/GameController.h>
21#endif
22
24
25namespace MGL::Input
26{
28class AppleGCMouseDelegate : public MouseDelegate
29{
30public:
31 static bool IsAvailable() noexcept;
32
33 AppleGCMouseDelegate() noexcept;
34 ~AppleGCMouseDelegate() noexcept;
35
36 void UpdateState(MouseState &state) noexcept override;
37 void PostUpdatePosition(const MouseState &state) noexcept override;
38 bool SetCursorMode(CursorMode cursorMode) noexcept override;
39 [[nodiscard]] CursorMode GetCursorMode() const noexcept override;
40 void SetCursorVisibleMode(CursorVisibleMode visibleMode) noexcept override;
41 [[nodiscard]] CursorVisibleMode GetCursorVisibleMode() const noexcept override;
42
43 [[nodiscard]] bool IsConnecting() const noexcept override;
44
45private:
46 void RegisterNotification() noexcept;
47
48 void OnMove(float deltaX, float deltaY) noexcept;
49
50#if defined(__OBJC__)
51 API_AVAILABLE(macos(11.0), ios(14.0), tvos(14.0)) GCMouseInput *_currentInput;
52 NSObject *_becomeObserver;
53 NSObject *_stopObserver;
54#else
55 void *_currentInput;
56 void *_becomeObserver;
57 void *_stopObserver;
58#endif
59
60 float _deltaX;
61 float _deltaY;
62};
63} // namespace MGL::Input
64
65#endif // defined(MGL_TARGET_MACOS) || defined(MGL_TARGET_IOS) || defined(MGL_TARGET_TVOS)
66#endif // INCGUARD_MGL_MOUSE_DELEGATE_APPLE_GC_H_1656972059
67
68// vim: et ts=4 sw=4 sts=4
MGL 環境定義
MGL マウス入力デリゲート基底クラス