Skip to content
This repository has been archived by the owner on Jun 6, 2020. It is now read-only.

Add pan events #25

Merged
merged 7 commits into from
Dec 6, 2019
Merged

Add pan events #25

merged 7 commits into from
Dec 6, 2019

Conversation

szbergeron
Copy link

WIP: plumbs support for smooth scrolling

Adds a new "MousePan" event type that matches up with revery-ui/esy-sdl2#6

Needs to be integrated with Revery proper before it will work

@szbergeron
Copy link
Author

Builds probably failing due to missing symbols (relies on changes in esy-sdl2#6)

@@ -401,6 +401,8 @@ CAMLprim value Val_SDL_Event(SDL_Event *event) {

int tag, mouseButton;

printf("event type is %d while pan event type is %d and mousewheel is %d\n", event->type, SDL_PANEVENT, SDL_MOUSEWHEEL);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove the printfs for the final version

src/sdl2_wrapper.cpp Outdated Show resolved Hide resolved
Change to pushing errors to stderr as suggested by @Et7f3

Co-Authored-By: Et7f3 <cadeaudeelie@gmail.com>
@bryphe
Copy link
Member

bryphe commented Dec 6, 2019

I think if you bring in the latest master, this should be build now @szbergeron 👍

@@ -551,6 +567,7 @@ CAMLprim value Val_SDL_Event(SDL_Event *event) {
v = Val_SDL_WindowEvent(23, event->window.windowID);
break;
default:
fprintf(stderr, "Unknown event in sdl2_wrapper, event enum code was %d\n", event->type);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should remove this as well - might cause issues in the case where we run on Windows w/o a console allocated (we could hook into the SDL_Log mechanism though instead)

Copy link
Member

@bryphe bryphe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One minor change - we should remove the fprintf. Otherwise, everything else looks good - it should build now w/ master merged

@bryphe
Copy link
Member

bryphe commented Dec 6, 2019

Looks great, @szbergeron ! Thank you!

@bryphe bryphe merged commit 2f70b6f into revery-ui:master Dec 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants