Skip to content

Instantly share code, notes, and snippets.

@ryanzec

ryanzec/examples.cpp

Created May 29, 2018
Embed
What would you like to do?
c++ / sdl / etc examples
// @example scrolling example
case SDL_MOUSEMOTION:
{
bool mouseInUiNow = isInRect(sideUiBackground, event.motion.x, event.motion.y);
if (mouseInUiNow && !mouseInUi) {
mouseInUi = true;
} else if (!mouseInUiNow && mouseInUi) {
mouseInUi = false;
}
break;
}
case SDL_MOUSEWHEEL:
{
yUiOffset += event.wheel.y;
std::cout << event.wheel.x << "x" << event.wheel.y << std::endl;
break;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment