@@ -28,12 +28,15 @@ void RenderLoop::Run()
28
28
while (!_wantsToQuit)
29
29
{
30
30
limiter.StartFrame ();
31
+
31
32
PollEvents ();
32
33
CheckViewportSize ();
33
34
_audioCapture.FillBuffer ();
34
35
_projectMWrapper.RenderFrame ();
35
36
_presetSelectionGui.Draw ();
37
+
36
38
_sdlRenderingWindow.Swap ();
39
+
37
40
limiter.EndFrame ();
38
41
}
39
42
@@ -51,7 +54,12 @@ void RenderLoop::PollEvents()
51
54
switch (event.type )
52
55
{
53
56
case SDL_MOUSEWHEEL:
54
- ScrollEvent (event.wheel );
57
+
58
+ if (!_presetSelectionGui.WantsMouseInput ())
59
+ {
60
+ ScrollEvent (event.wheel );
61
+ }
62
+
55
63
break ;
56
64
57
65
case SDL_KEYDOWN:
@@ -63,11 +71,19 @@ void RenderLoop::PollEvents()
63
71
break ;
64
72
65
73
case SDL_MOUSEBUTTONDOWN:
66
- MouseDownEvent (event.button );
74
+ if (!_presetSelectionGui.WantsMouseInput ())
75
+ {
76
+ MouseDownEvent (event.button );
77
+ }
78
+
67
79
break ;
68
80
69
81
case SDL_MOUSEBUTTONUP:
70
- MouseUpEvent (event.button );
82
+ if (!_presetSelectionGui.WantsMouseInput ())
83
+ {
84
+ MouseUpEvent (event.button );
85
+ }
86
+
71
87
break ;
72
88
73
89
case SDL_QUIT:
@@ -229,11 +245,6 @@ void RenderLoop::KeyEvent(const SDL_KeyboardEvent& event, bool down)
229
245
230
246
void RenderLoop::ScrollEvent (const SDL_MouseWheelEvent& event)
231
247
{
232
- if (_presetSelectionGui.WantsMouseInput ())
233
- {
234
- return ;
235
- }
236
-
237
248
// Wheel up is positive
238
249
if (event.y > 0 )
239
250
{
@@ -293,11 +304,6 @@ void RenderLoop::MouseDownEvent(const SDL_MouseButtonEvent& event)
293
304
294
305
void RenderLoop::MouseUpEvent (const SDL_MouseButtonEvent& event)
295
306
{
296
- if (_presetSelectionGui.WantsMouseInput ())
297
- {
298
- return ;
299
- }
300
-
301
307
if (event.button == SDL_BUTTON_LEFT)
302
308
{
303
309
_mouseDown = false ;
0 commit comments