Skip to content

Commit

Permalink
instead of grabbing the mouse cursor, game now creates an invisible one
Browse files Browse the repository at this point in the history
  • Loading branch information
Althoumb committed Apr 3, 2018
1 parent 6755f3a commit 9997c18
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/game/RhythmState.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
import javax.sound.sampled.LineUnavailableException;
import javax.sound.sampled.UnsupportedAudioFileException;

import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Cursor;
import org.newdawn.slick.Color;
import org.newdawn.slick.GameContainer;
import org.newdawn.slick.Graphics;
Expand Down Expand Up @@ -76,10 +79,17 @@ public RhythmState(int id) {
public void enter(GameContainer gc, StateBasedGame arg1) throws SlickException {
gamecontainer = gc;
inp = gc.getInput();
gc.setMouseGrabbed(true);

cursor = new Image("res/cursor.png");
cursorcenter = new Vector2f(cursor.getWidth() / 2, cursor.getHeight() / 2);

Cursor emptyCursor;
try {
emptyCursor = new Cursor(1, 1, 0, 0, 1, BufferUtils.createIntBuffer(1), null);
gc.setMouseCursor(emptyCursor, 0, 0);
} catch (LWJGLException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
String beatmapzipfilename = "725875 Sanshuu Chuugaku Yuushabu - Hoshi to Hana.osz";
String beatmaporigin = "res/sample_osu_beatmaps/";

Expand Down

0 comments on commit 9997c18

Please sign in to comment.