Skip to content

Commit

Permalink
Merge pull request #56 from eandr127/master
Browse files Browse the repository at this point in the history
Use regular exception so logging is nicer
  • Loading branch information
ryanlarkin committed Apr 27, 2015
2 parents 7d26786 + 3b5833f commit 67a905a
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
5 changes: 2 additions & 3 deletions Luminescent/src/astechzgo/luminescent/main/Luminescent.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import java.util.Date;

import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;
import org.lwjgl.input.Cursor;
import org.lwjgl.input.Mouse;
import org.lwjgl.opengl.Display;
Expand Down Expand Up @@ -47,7 +46,7 @@ public static void Init()
Cursor emptyCursor = new Cursor(1, 1, 0, 0, 1, BufferUtils.createIntBuffer(1), null);
Mouse.setNativeCursor(emptyCursor);
}
catch (LWJGLException e)
catch (Exception e)
{
LoggingUtils.logException(LoggingUtils.LOGGER, e);
}
Expand Down Expand Up @@ -176,7 +175,7 @@ public static void Tick()
{
DisplayUtils.takeScreenshot(newFile("screenshots/" + S + ".png"));
}
catch (LWJGLException e)
catch (Exception e)
{
LoggingUtils.logException(LoggingUtils.LOGGER, e);
}
Expand Down
3 changes: 1 addition & 2 deletions Luminescent/src/astechzgo/luminescent/main/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static astechzgo.luminescent.utils.DisplayUtils.setDisplayMode;

import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;

import astechzgo.luminescent.utils.Constants;
Expand Down Expand Up @@ -47,7 +46,7 @@ public void Init()
);
Display.create();
}
catch (LWJGLException e)
catch (Exception e)
{
LoggingUtils.logException(LoggingUtils.LOGGER, e);
System.exit(0);
Expand Down
7 changes: 3 additions & 4 deletions Luminescent/src/astechzgo/luminescent/utils/DisplayUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import javax.imageio.ImageIO;

import org.lwjgl.BufferUtils;
import org.lwjgl.LWJGLException;
import org.lwjgl.opengl.Display;
import org.lwjgl.opengl.DisplayMode;
import org.lwjgl.opengl.GL11;
Expand Down Expand Up @@ -93,7 +92,7 @@ public static void setDisplayMode(int width, int height, boolean fullscreen) {
Display.setDisplayMode(targetDisplayMode);
Display.setFullscreen(fullscreen);

} catch (LWJGLException e) {
} catch (Exception e) {
System.out.println("Unable to setup mode " + width + "x" + height
+ " fullscreen=" + fullscreen + e);
}
Expand All @@ -116,9 +115,9 @@ public static void setIcons(String[] nIcon, Object c) {
Display.setIcon(icons.toArray(new ByteBuffer[icons.size()]));
}

public static void takeScreenshot(File file) throws LWJGLException {
public static void takeScreenshot(File file) throws Exception {
if(!Display.isFullscreen()) {
throw new LWJGLException("Must be fullscreen to take screenshot");
throw new Exception("Must be fullscreen to take screenshot");
}

GL11.glReadBuffer(GL11.GL_FRONT);
Expand Down

0 comments on commit 67a905a

Please sign in to comment.