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

rlj.core.GetMouseWheelMove() throws NullPointerException #70

Open
bramtechs opened this issue Sep 28, 2024 · 0 comments
Open

rlj.core.GetMouseWheelMove() throws NullPointerException #70

bramtechs opened this issue Sep 28, 2024 · 0 comments

Comments

@bramtechs
Copy link
Contributor

Describe the bug
Calling GetMouseWheelMove() throws a NullPointerException

To Reproduce
Steps to reproduce the behavior:

  1. Run example code (on Windows 10)
  2. See error
Exception in thread "main" java.lang.NullPointerException: Cannot read field "x" because "this.input.mouse.currentWheelMove" is null
	at com.raylib.java.core.rCore.GetMouseWheelMove(rCore.java:2316)
	at org.example.BasicWindow.main(BasicWindow.java:19)

Expected behavior
Mouse wheel value should be returned.

Code

public class BasicWindow {
    public static void main(String[] args) {

        final int SCREEN_WIDTH = 800;
        final int SCREEN_HEIGHT = 450;
        Raylib rlj = new Raylib();
        rlj.core.InitWindow(SCREEN_WIDTH, SCREEN_HEIGHT, "Raylib-J [core] example -- basic window");
        rlj.core.SetTargetFPS(60);

        while (!rlj.core.WindowShouldClose()) {
            rlj.core.BeginDrawing();
            rlj.core.ClearBackground(Color.RAYWHITE);

            float move = rlj.core.GetMouseWheelMove();
            rlj.text.DrawText("mouse wheel move: %f".formatted(move), 190, 200, 20, Color.LIGHTGRAY);

            rlj.core.EndDrawing();
        }
    }
}

Desktop (please complete the following information):

  • OS: Windows 10
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

1 participant