Add Ant compatibility

This commit is contained in:
MrDev023 2016-09-15 13:10:11 +02:00
parent 55fcb82edd
commit 84f1dca031
24 changed files with 375 additions and 348 deletions

1
.gitignore vendored
View file

@ -1,3 +1,4 @@
bin/* bin/*
.project .project
.classpath .classpath
*.jar

3
.travis.yml Normal file
View file

@ -0,0 +1,3 @@
language: java
jdk:
- oraclejdk8

View file

@ -1,4 +1,8 @@
# First-Game-Lighting # First-Game-Lighting
Compile status: ![Status](https://travis-ci.org/mrdev023/First-Game-Lighting.svg?branch=master)
Ce projet est seulement a projet utiliser pour apprendre le forward rendering pour ensuite l'integrer dans mon moteur de jeu qui Ce projet est seulement a projet utiliser pour apprendre le forward rendering pour ensuite l'integrer dans mon moteur de jeu qui
sera conçus avec ces derniere technologie pour ensuite faire des jeux avec celui-ci. sera conçus avec ces derniere technologie pour ensuite faire des jeux avec celui-ci.
![Image](https://pbs.twimg.com/media/Cc3DuwnWIAII5Zw.jpg:large)

38
build.xml Normal file
View file

@ -0,0 +1,38 @@
<project name="lwjgl-examples">
<property file="build.properties" />
<property name="src.dir" value="src" />
<property name="build.dir" value="bin"/>
<property name="lwjgl_jars.dir" value="./libs/"/>
<property name="lwjgl_natives.dir" value="./libs/"/>
<property name="build.sysclasspath" value="last"/>
<path id="my_cp">
<fileset dir="${lwjgl_jars.dir}" includes="lwjgl.jar"/>
</path>
<target name="compile">
<mkdir dir="${build.dir}"/>
<javac srcdir="${src.dir}" destdir="${build.dir}" classpathref="my_cp"/>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="test" depends="compile">
<!--
fork="true" seems to be absolutely
necessary for the setting of java.library.path
to be effective.-->
<java fork="true" classname="fr/technicalgames/Main">
<classpath>
<path refid="my_cp"/>
<path location="${build.dir}"/>
</classpath>
<sysproperty key="java.library.path"
value="${lwjgl_natives.dir}"/>
</java>
</target>
</project>

BIN
libs/OpenAL.dll Normal file

Binary file not shown.

BIN
libs/OpenAL32.dll Normal file

Binary file not shown.

BIN
libs/glfw.dll Normal file

Binary file not shown.

BIN
libs/glfw32.dll Normal file

Binary file not shown.

BIN
libs/jemalloc.dll Normal file

Binary file not shown.

BIN
libs/jemalloc32.dll Normal file

Binary file not shown.

BIN
libs/libglfw.dylib Normal file

Binary file not shown.

BIN
libs/libglfw.so Normal file

Binary file not shown.

BIN
libs/libjemalloc.dylib Normal file

Binary file not shown.

BIN
libs/libjemalloc.so Normal file

Binary file not shown.

BIN
libs/liblwjgl.dylib Normal file

Binary file not shown.

BIN
libs/liblwjgl.so Normal file

Binary file not shown.

BIN
libs/libopenal.dylib Normal file

Binary file not shown.

BIN
libs/libopenal.so Normal file

Binary file not shown.

BIN
libs/lwjgl.dll Normal file

Binary file not shown.

BIN
libs/lwjgl32.dll Normal file

Binary file not shown.

View file

@ -42,7 +42,7 @@ public class Main {
}; };
// glfwSetErrorCallback(errorCallback); // glfwSetErrorCallback(errorCallback);
if(glfwInit() != GL11.GL_TRUE)throw new Exception("GLFW not init"); if(glfwInit())throw new Exception("GLFW not init");
glfwDefaultWindowHints(); glfwDefaultWindowHints();
glfwWindowHint(GLFW_VISIBLE, GL11.GL_FALSE); glfwWindowHint(GLFW_VISIBLE, GL11.GL_FALSE);
glfwWindowHint(GLFW_RESIZABLE, GL11.GL_FALSE); glfwWindowHint(GLFW_RESIZABLE, GL11.GL_FALSE);
@ -75,7 +75,7 @@ public class Main {
Camera.transform(); Camera.transform();
//------------------------------------------------------------------------------------ //------------------------------------------------------------------------------------
while(glfwWindowShouldClose(windowID) == GL11.GL_FALSE){ while(glfwWindowShouldClose(windowID)){
if(System.currentTimeMillis() - previousTicks >= 1000/60){//Update TICKS if(System.currentTimeMillis() - previousTicks >= 1000/60){//Update TICKS
glfwPollEvents(); glfwPollEvents();

View file

@ -1,9 +1,8 @@
package fr.technicalgames.audio; package fr.technicalgames.audio;
import static org.lwjgl.openal.AL.createCapabilities;
import static org.lwjgl.openal.AL10.*; import static org.lwjgl.openal.AL10.*;
import static org.lwjgl.openal.ALC10.*; import static org.lwjgl.openal.ALC10.*;
import static org.lwjgl.openal.ALC11.*;
import static org.lwjgl.openal.ALUtil.*;
import static org.lwjgl.stb.STBVorbis.*; import static org.lwjgl.stb.STBVorbis.*;
import static org.lwjgl.system.MemoryUtil.*; import static org.lwjgl.system.MemoryUtil.*;
@ -19,323 +18,305 @@ import org.lwjgl.openal.*;
import org.lwjgl.stb.STBVorbisInfo; import org.lwjgl.stb.STBVorbisInfo;
public abstract class Audio { public class Audio {
//Variables global //Variables global
//------------------------------------------------------ //------------------------------------------------------
public static ALDevice device; public static long device;
public static ALCCapabilities caps; public static ALCCapabilities caps;
public static ALContext context; public static long context;
public static final int INITIAL_STATE = 4113,PAUSED_STATE = 4115,STOPPED_STATE = 4116,PLAYING_STATE = 4114; public static final int INITIAL_STATE = 4113,PAUSED_STATE = 4115,STOPPED_STATE = 4116,PLAYING_STATE = 4114;
//------------------------------------------------------ //------------------------------------------------------
//Variable de l'objet audio ou du son a lire //Variable de l'objet audio ou du son a lire
//------------------------------------------------------ //------------------------------------------------------
private int buffer,source; private int buffer,source;
private String fileName; private String fileName;
private String format; private String format;
//------------------------------------------------------ //------------------------------------------------------
//Fonction global //Fonction global
//------------------------------------------------------ //------------------------------------------------------
public static void create(){ public static void create(){
device = ALDevice.create(null); device = alcOpenDevice((ByteBuffer)null);
if ( device == null ) ALCCapabilities deviceCaps = ALC.createCapabilities(device);
throw new IllegalStateException("Failed to open the default device.");
caps = device.getCapabilities();
System.out.println("---------------------------- Create Audio Device -------------------------------------");
System.out.println("OpenALC10: " + caps.OpenALC10);
System.out.println("OpenALC11: " + caps.OpenALC11);
System.out.println("caps.ALC_EXT_EFX = " + caps.ALC_EXT_EFX);
String defaultDeviceSpecifier = alcGetString(0L, ALC_DEFAULT_DEVICE_SPECIFIER); context = alcCreateContext(device, (IntBuffer)null);
System.out.println("Default device: " + defaultDeviceSpecifier); alcMakeContextCurrent(context);
createCapabilities(deviceCaps);
}
context = ALContext.create(device); public static void destroy(){
alcCloseDevice(device);
alcDestroyContext(context);
}
//------------------------------------------------------
System.out.println("ALC_FREQUENCY: " + alcGetInteger(device.address(), ALC_FREQUENCY) + "Hz"); //Fonction de l'objet audio ou du son a lire
System.out.println("ALC_REFRESH: " + alcGetInteger(device.address(), ALC_REFRESH) + "Hz"); //------------------------------------------------------
System.out.println("ALC_SYNC: " + (alcGetInteger(device.address(), ALC_SYNC) == ALC_TRUE));
System.out.println("ALC_MONO_SOURCES: " + alcGetInteger(device.address(), ALC_MONO_SOURCES));
System.out.println("ALC_STEREO_SOURCES: " + alcGetInteger(device.address(), ALC_STEREO_SOURCES));
System.out.println("---------------------------------------------------------------------------------------");
}
public static void destroy(){ public Audio(String fileName) throws Exception{
context.destroy(); this.fileName = fileName;
device.destroy(); setSound();
} }
//------------------------------------------------------
//Fonction de l'objet audio ou du son a lire private void setSound() throws Exception{
//------------------------------------------------------ if(fileName.endsWith(".ogg")){
loadOGGFormat();
public Audio(String fileName) throws Exception{ format = "OGG";
this.fileName = fileName; }else if(fileName.endsWith(".wav")){
setSound(); loadWavFormat();
} format = "WAV";
}else{
private void setSound() throws Exception{ throw new Exception("Format not supported !");
if(fileName.endsWith(".ogg")){ }
loadOGGFormat();
format = "OGG";
}else if(fileName.endsWith(".wav")){
loadWavFormat();
format = "WAV";
}else{
throw new Exception("Format not supported !");
}
alSourcei(source, AL_BUFFER, buffer); alSourcei(source, AL_BUFFER, buffer);
checkALError();
int size = alGetBufferi(buffer,AL_SIZE); int size = alGetBufferi(buffer,AL_SIZE);
int bits = alGetBufferi(buffer, AL_BITS); int bits = alGetBufferi(buffer, AL_BITS);
int channels = alGetBufferi(buffer, AL_CHANNELS); int channels = alGetBufferi(buffer, AL_CHANNELS);
int freq = alGetBufferi(buffer, AL_FREQUENCY); int freq = alGetBufferi(buffer, AL_FREQUENCY);
System.out.println(fileName + " loaded !" + " | TIME : " + (size/channels/(bits/8)/freq) + "s | BITS : " + bits + " | CHANNELS : " + channels + " | FREQUENCE : " + freq + " FORMAT : " + format); System.out.println(fileName + " loaded !" + " | TIME : " + (size/channels/(bits/8)/freq) + "s | BITS : " + bits + " | CHANNELS : " + channels + " | FREQUENCE : " + freq + " FORMAT : " + format);
} }
public void loadWavFormat() throws Exception{ public void loadWavFormat() throws Exception{
AudioInputStream ais = AudioSystem.getAudioInputStream(new BufferedInputStream(new FileInputStream(fileName))); AudioInputStream ais = AudioSystem.getAudioInputStream(new BufferedInputStream(new FileInputStream(fileName)));
AudioFormat audioformat = ais.getFormat(); AudioFormat audioformat = ais.getFormat();
// get channels // get channels
int channels = 0; int channels = 0;
if (audioformat.getChannels() == 1) { if (audioformat.getChannels() == 1) {
if (audioformat.getSampleSizeInBits() == 8) { if (audioformat.getSampleSizeInBits() == 8) {
channels = AL10.AL_FORMAT_MONO8; channels = AL10.AL_FORMAT_MONO8;
} else if (audioformat.getSampleSizeInBits() == 16) { } else if (audioformat.getSampleSizeInBits() == 16) {
channels = AL10.AL_FORMAT_MONO16; channels = AL10.AL_FORMAT_MONO16;
} else { } else {
assert false : "Illegal sample size"; assert false : "Illegal sample size";
} }
} else if (audioformat.getChannels() == 2) { } else if (audioformat.getChannels() == 2) {
if (audioformat.getSampleSizeInBits() == 8) { if (audioformat.getSampleSizeInBits() == 8) {
channels = AL10.AL_FORMAT_STEREO8; channels = AL10.AL_FORMAT_STEREO8;
} else if (audioformat.getSampleSizeInBits() == 16) { } else if (audioformat.getSampleSizeInBits() == 16) {
channels = AL10.AL_FORMAT_STEREO16; channels = AL10.AL_FORMAT_STEREO16;
} else { } else {
assert false : "Illegal sample size"; assert false : "Illegal sample size";
} }
} else { } else {
assert false : "Only mono or stereo is supported"; assert false : "Only mono or stereo is supported";
} }
int available = ais.available(); int available = ais.available();
if(available <= 0) { if(available <= 0) {
available = ais.getFormat().getChannels() * (int) ais.getFrameLength() * ais.getFormat().getSampleSizeInBits() / 8; available = ais.getFormat().getChannels() * (int) ais.getFrameLength() * ais.getFormat().getSampleSizeInBits() / 8;
} }
byte[] buf = new byte[ais.available()]; byte[] buf = new byte[ais.available()];
int read = 0, total = 0; int read = 0, total = 0;
while ((read = ais.read(buf, total, buf.length - total)) != -1 while ((read = ais.read(buf, total, buf.length - total)) != -1
&& total < buf.length) { && total < buf.length) {
total += read; total += read;
} }
byte[] audio_bytes = buf; byte[] audio_bytes = buf;
boolean two_bytes_data = audioformat.getSampleSizeInBits() == 16; boolean two_bytes_data = audioformat.getSampleSizeInBits() == 16;
ByteOrder order = audioformat.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN; ByteOrder order = audioformat.isBigEndian() ? ByteOrder.BIG_ENDIAN : ByteOrder.LITTLE_ENDIAN;
ByteBuffer dest = ByteBuffer.allocateDirect(audio_bytes.length); ByteBuffer dest = ByteBuffer.allocateDirect(audio_bytes.length);
dest.order(ByteOrder.nativeOrder()); dest.order(ByteOrder.nativeOrder());
ByteBuffer src = ByteBuffer.wrap(audio_bytes); ByteBuffer src = ByteBuffer.wrap(audio_bytes);
src.order(order); src.order(order);
if (two_bytes_data) { if (two_bytes_data) {
ShortBuffer dest_short = dest.asShortBuffer(); ShortBuffer dest_short = dest.asShortBuffer();
ShortBuffer src_short = src.asShortBuffer(); ShortBuffer src_short = src.asShortBuffer();
while (src_short.hasRemaining()) while (src_short.hasRemaining())
dest_short.put(src_short.get()); dest_short.put(src_short.get());
} else { } else {
while (src.hasRemaining()) while (src.hasRemaining())
dest.put(src.get()); dest.put(src.get());
} }
dest.rewind(); dest.rewind();
this.buffer = alGenBuffers(); this.buffer = alGenBuffers();
this.source = alGenSources(); this.source = alGenSources();
alBufferData(this.buffer, channels, dest, (int)audioformat.getSampleRate()); alBufferData(this.buffer, channels, dest, (int)audioformat.getSampleRate());
dest.clear(); dest.clear();
} }
public void loadOGGFormat(){ public void loadOGGFormat(){
STBVorbisInfo info = STBVorbisInfo.malloc(); STBVorbisInfo info = STBVorbisInfo.malloc();
ByteBuffer buff = BufferUtils.createByteBuffer(0); ByteBuffer buff = BufferUtils.createByteBuffer(0);
//lecture du fichier //lecture du fichier
//---------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------
try { try {
File file = new File(fileName); File file = new File(fileName);
if ( file.isFile() ) { if ( file.isFile() ) {
FileInputStream fis = new FileInputStream(file); FileInputStream fis = new FileInputStream(file);
FileChannel fc = fis.getChannel(); FileChannel fc = fis.getChannel();
buff = BufferUtils.createByteBuffer((int)fc.size() + 1); buff = BufferUtils.createByteBuffer((int)fc.size() + 1);
while ( fc.read(buff) != -1 ) ; while ( fc.read(buff) != -1 ) ;
fis.close(); fis.close();
fc.close(); fc.close();
} else { } else {
System.err.println("File not found !"); System.err.println("File not found !");
return; return;
} }
buff.flip(); buff.flip();
} catch (IOException e) { } catch (IOException e) {
throw new RuntimeException(e); throw new RuntimeException(e);
} }
//---------------------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------------------
IntBuffer error = BufferUtils.createIntBuffer(1); IntBuffer error = BufferUtils.createIntBuffer(1);
long decoder = stb_vorbis_open_memory(buff, error, null); long decoder = stb_vorbis_open_memory(buff, error, null);
if ( decoder == NULL ) if ( decoder == NULL )
throw new RuntimeException("Failed to open Ogg Vorbis file. Error: " + error.get(0)); throw new RuntimeException("Failed to open Ogg Vorbis file. Error: " + error.get(0));
stb_vorbis_get_info(decoder, info); stb_vorbis_get_info(decoder, info);
int channels = info.channels(); int channels = info.channels();
stb_vorbis_seek_start(decoder); stb_vorbis_seek_start(decoder);
int lengthSamples = stb_vorbis_stream_length_in_samples(decoder); int lengthSamples = stb_vorbis_stream_length_in_samples(decoder);
ByteBuffer pcm = BufferUtils.createByteBuffer(lengthSamples * 2 * channels); ShortBuffer pcm = BufferUtils.createShortBuffer(lengthSamples * channels);
stb_vorbis_get_samples_short_interleaved(decoder, channels, pcm, lengthSamples); stb_vorbis_get_samples_short_interleaved(decoder, channels, pcm);
stb_vorbis_close(decoder); stb_vorbis_close(decoder);
buffer = alGenBuffers(); buffer = alGenBuffers();
checkALError();
source = alGenSources(); source = alGenSources();
checkALError();
if(channels == 1)alBufferData(buffer, AL_FORMAT_MONO16, pcm, info.sample_rate()); if(channels == 1)alBufferData(buffer, AL_FORMAT_MONO16, pcm, info.sample_rate());
else alBufferData(buffer, AL_FORMAT_STEREO16, pcm, info.sample_rate()); else alBufferData(buffer, AL_FORMAT_STEREO16, pcm, info.sample_rate());
checkALError(); }
}
public void playSound(){ public void playSound(){
if(source == 0 || buffer == 0) return; if(source == 0 || buffer == 0) return;
alSourcePlay(source); alSourcePlay(source);
} }
public int getPosition(){ public int getPosition(){
return alGetSourcei(source, AL_POSITION); return alGetSourcei(source, AL_POSITION);
} }
public int getDurationInSeconds(){ public int getDurationInSeconds(){
if(source == 0 || buffer == 0) return 0; if(source == 0 || buffer == 0) return 0;
int size = alGetBufferi(buffer,AL_SIZE); int size = alGetBufferi(buffer,AL_SIZE);
int bits = alGetBufferi(buffer, AL_BITS); int bits = alGetBufferi(buffer, AL_BITS);
int channels = alGetBufferi(buffer, AL_CHANNELS); int channels = alGetBufferi(buffer, AL_CHANNELS);
int freq = alGetBufferi(buffer, AL_FREQUENCY); int freq = alGetBufferi(buffer, AL_FREQUENCY);
return size/channels/(bits/8)/freq; return size/channels/(bits/8)/freq;
} }
public int getStateSound(){ public int getStateSound(){
if(source == 0 || buffer == 0) return 0; if(source == 0 || buffer == 0) return 0;
return alGetSourcei(source, AL_SOURCE_STATE); return alGetSourcei(source, AL_SOURCE_STATE);
} }
public boolean isStopped(){ public boolean isStopped(){
if(source == 0 || buffer == 0) return false; if(source == 0 || buffer == 0) return false;
if(alGetSourcei(source, AL_SOURCE_STATE) == STOPPED_STATE)return true; if(alGetSourcei(source, AL_SOURCE_STATE) == STOPPED_STATE)return true;
else return false; else return false;
} }
public boolean isPaused(){ public boolean isPaused(){
if(source == 0 || buffer == 0) return false; if(source == 0 || buffer == 0) return false;
if(alGetSourcei(source, AL_SOURCE_STATE) == PAUSED_STATE)return true; if(alGetSourcei(source, AL_SOURCE_STATE) == PAUSED_STATE)return true;
else return false; else return false;
} }
public boolean isPlaying(){ public boolean isPlaying(){
if(source == 0 || buffer == 0) return false; if(source == 0 || buffer == 0) return false;
if(alGetSourcei(source, AL_SOURCE_STATE) == PLAYING_STATE)return true; if(alGetSourcei(source, AL_SOURCE_STATE) == PLAYING_STATE)return true;
else return false; else return false;
} }
public boolean isInitial(){ public boolean isInitial(){
if(source == 0 || buffer == 0) return false; if(source == 0 || buffer == 0) return false;
if(alGetSourcei(source, AL_SOURCE_STATE) == INITIAL_STATE)return true; if(alGetSourcei(source, AL_SOURCE_STATE) == INITIAL_STATE)return true;
else return false; else return false;
} }
public void stopSound(){ public void stopSound(){
if(source == 0 || buffer == 0) return; if(source == 0 || buffer == 0) return;
alSourceStop(source); alSourceStop(source);
} }
public void pauseSound(){ public void pauseSound(){
if(source == 0 || buffer == 0) return; if(source == 0 || buffer == 0) return;
alSourcePause(source); alSourcePause(source);
} }
public void rewindSound(){ public void rewindSound(){
if(source == 0 || buffer == 0) return; if(source == 0 || buffer == 0) return;
alSourceRewind(source); alSourceRewind(source);
} }
public void setGain(float gain){ public void setGain(float gain){
if(source == 0 || buffer == 0) return; if(source == 0 || buffer == 0) return;
if(gain > 1.0f)gain = 1.0f; if(gain > 1.0f)gain = 1.0f;
if(gain < 0.0f)gain = 0.0f; if(gain < 0.0f)gain = 0.0f;
alSourcef(source, AL_GAIN, gain); alSourcef(source, AL_GAIN, gain);
} }
public void setPitch(float pitch){ public void setPitch(float pitch){
if(source == 0 || buffer == 0) return; if(source == 0 || buffer == 0) return;
if(pitch < 0.0f)pitch = 0.0f; if(pitch < 0.0f)pitch = 0.0f;
alSourcef(source, AL_PITCH, pitch); alSourcef(source, AL_PITCH, pitch);
} }
public float getGain(){ public float getGain(){
if(source == 0 || buffer == 0) return 0; if(source == 0 || buffer == 0) return 0;
return alGetSourcef(source, AL_GAIN); return alGetSourcef(source, AL_GAIN);
} }
public float getPitch(){ public float getPitch(){
if(source == 0 || buffer == 0) return 0; if(source == 0 || buffer == 0) return 0;
return alGetSourcef(source, AL_PITCH); return alGetSourcef(source, AL_PITCH);
} }
public void setLooping(boolean looping){ public void setLooping(boolean looping){
if(source == 0 || buffer == 0) return; if(source == 0 || buffer == 0) return;
if(looping){ if(looping){
alSourcef(source, AL_LOOPING, AL_TRUE); alSourcef(source, AL_LOOPING, AL_TRUE);
}else{ }else{
alSourcef(source, AL_LOOPING, AL_FALSE); alSourcef(source, AL_LOOPING, AL_FALSE);
} }
} }
public void destroySound(){ public void destroySound(){
alDeleteSources(source); alDeleteSources(source);
alDeleteBuffers(buffer); alDeleteBuffers(buffer);
source = 0; source = 0;
buffer = 0; buffer = 0;
} }
public String getFileName() { public String getFileName() {
return fileName; return fileName;
} }
public void setFileName(String fileName) throws Exception { public void setFileName(String fileName) throws Exception {
this.fileName = fileName; this.fileName = fileName;
destroySound(); destroySound();
setSound(); setSound();
} }
public int getBuffer() { public int getBuffer() {
return buffer; return buffer;
} }
public void setBuffer(int buffer) { public void setBuffer(int buffer) {
this.buffer = buffer; this.buffer = buffer;
} }
public int getSource() { public int getSource() {
return source; return source;
} }
public void setSource(int source) { public void setSource(int source) {
this.source = source; this.source = source;
} }
//------------------------------------------------------ //------------------------------------------------------
} }

View file

@ -93,8 +93,8 @@ public class Input{
} }
public static void destroy(){ public static void destroy(){
mousePos.release(); mousePos.free();
scroll.release(); scroll.free();
} }
public static void scroll(long window, double xoffset, double yoffset) { public static void scroll(long window, double xoffset, double yoffset) {

View file

@ -51,7 +51,7 @@ public class Camera {
if(Input.isKey(GLFW.GLFW_KEY_SPACE)){ if(Input.isKey(GLFW.GLFW_KEY_SPACE)){
pos.y += speed; pos.y += speed;
} }
if(Input.isKeyDown(GLFW_KEY_ESCAPE))glfwSetWindowShouldClose(Main.windowID, GL11.GL_TRUE); if(Input.isKeyDown(GLFW_KEY_ESCAPE))glfwSetWindowShouldClose(Main.windowID, true);
if(Input.isButtonDown(0))glfwSetInputMode(Main.windowID, GLFW_CURSOR, GLFW_CURSOR_DISABLED); if(Input.isButtonDown(0))glfwSetInputMode(Main.windowID, GLFW_CURSOR, GLFW_CURSOR_DISABLED);
if(Input.isButtonDown(1))glfwSetInputMode(Main.windowID, GLFW_CURSOR, GLFW_CURSOR_NORMAL); if(Input.isButtonDown(1))glfwSetInputMode(Main.windowID, GLFW_CURSOR, GLFW_CURSOR_NORMAL);
} }