Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mouse Interaction for Zooming and Panning in SDL Application #6

Open
Suchit1938 opened this issue Oct 10, 2024 · 3 comments
Open

Mouse Interaction for Zooming and Panning in SDL Application #6

Suchit1938 opened this issue Oct 10, 2024 · 3 comments

Comments

@Suchit1938
Copy link

SDL application that involves scrolling and zooming.

Expected Behavior :-

  1. Mouse wheel should zoom in and out of the texture using both keyboard and mouse interactions.
  2. Left-click drag should pan the view smoothly.
  3. Points should move randomly within the texture.
@Suchit1938
Copy link
Author

Hi, @nots1dd . Plz, assign this to me as I am currently start learning SDL2.
and also I am Eager to contribute under hacktoberfest.

@nots1dd
Copy link
Owner

nots1dd commented Oct 10, 2024

SDL application that involves scrolling and zooming.

Expected Behavior :-

1. Mouse wheel should zoom in and out of the texture using both keyboard and mouse interactions.

2. Left-click drag should pan the view smoothly.

3. Points should move randomly within the texture.

Hello there, can you explain the issue in depth and how this is related to how LiteFM works and uses SDL2?

SDL2 and SDL_Mixer is being used in LiteFM only for one thing:

-> Handling the audio stream of an audio file

-> Previewing of audio files

@Suchit1938
Copy link
Author

As i recently start learning about SDL2. As per now do not know related about audio stream and SDL_mixer. But shortly i will learn about it.
Breakdown of Current project

  1. Zooming with Mouse Wheel:

How it works:
. When you scroll the mouse wheel, SDL2 detects this event and adjusts the zoom level of the texture.
. Implementation: You'll need to handle SDL_MOUSEWHEEL events and modify the zoom level accordingly.

  1. Panning with Left-Click Drag:

How it works:
. When you click and drag the mouse, SDL2 detects the mouse movement and pans the view smoothly.
. Implementation: You'll handle SDL_MOUSEMOTION events and update the view position based on the mouse movement.

  1. Random Point Movement:

How it works:
. Points move randomly within the texture, creating a dynamic visual effect.

. Implementation: You'll use random number generation to change the position of points and update their positions in each frame.

As, I am beginner I eager to contribute to the hacktoberfest. So, plz give the great opportunity to contribute.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants