-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add borderless fullscreen, make fullscreen choose the appropriate mon…
…itor (#162) * Add borderless fullscreen, make fullscreen choose the appropriate monitor * Replace wildcard imports --------- Co-authored-by: Raven Szewczyk <[email protected]>
- Loading branch information
1 parent
c96a1f1
commit 0e16c68
Showing
5 changed files
with
200 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/me/eigenraven/lwjgl3ify/mixins/game/MixinBorderlessWindow.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package me.eigenraven.lwjgl3ify.mixins.game; | ||
|
||
import static org.lwjgl.glfw.GLFW.*; | ||
|
||
import net.minecraft.client.Minecraft; | ||
|
||
import org.lwjglx.opengl.Display; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; | ||
|
||
import me.eigenraven.lwjgl3ify.core.Config; | ||
|
||
@Mixin(Minecraft.class) | ||
public class MixinBorderlessWindow { | ||
|
||
@Inject(method = "Lnet/minecraft/client/Minecraft;toggleFullscreen()V", at = @At("HEAD"), cancellable = true) | ||
public void toggleFullscreen(CallbackInfo ci) { | ||
if (Config.WINDOW_BORDERLESS_REPLACES_FULLSCREEN) { | ||
ci.cancel(); | ||
|
||
Display.toggleBorderless(); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters