Skip to content

Commit

Permalink
Merge branch 'master' into gwt-2.8.0
Browse files Browse the repository at this point in the history
  • Loading branch information
badlogic committed Dec 4, 2016
2 parents 7a4ae8e + 88f4438 commit 8a0941a
Show file tree
Hide file tree
Showing 113 changed files with 2,485 additions and 895 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Expand Up @@ -64,6 +64,9 @@ libgdx-*.zip.MD5
/extensions/gdx-image/libs/
/extensions/gdx-setup/gdx-setup.jar

#the LWJGL3 libs are pulled via fetch.xml
/backends/gdx-backend-lwjgl3/libs/lwjgl*.jar

#ensure gdx-setup.jar works properly
!/extensions/gdx-setup/src/com/badlogic/gdx/setup/resources/gwt/war

Expand Down
21 changes: 19 additions & 2 deletions CHANGES
@@ -1,9 +1,26 @@
[1.9.5]
[LATEST]
- Fix NPE swallowing "video driver unsupported" error on LWJGL 2 backend.
- Allow window icons to be set in Lwjgl3ApplicationConfiguration or Lwjgl3WindowConfiguration.
- Allow window icon and title to be changed in Lwjgl3Window
- API Addition: ApplicationLogger interface, allowing easier access to custom logging
- DefaultRenderableSorter accounts for center of Renderable mesh, see https://github.com/libgdx/libgdx/pull/4319
- Bullet: added FilterableVehicleRaycaster, see https://github.com/libgdx/libgdx/pull/4361
- Bullet: updated to 2.85, see: http://bulletphysics.org/wordpress/?p=456
- Updated iOS native build scripts to iOS 10.0 and TVOS 10.0
- Updated iOS native build scripts to iOS 10.1 and TVOS 10.0
- API Addition: BitmapFont#blankLineScale.
- Fixed rounding of Drawables in ProgressBar. Allow rounding to be disabled with setRound().
- Updated LWJGL3 backend to LWJGL 3.1.0, see https://blog.lwjgl.org/lwjgl-3-1-0-released/
- LWJGL3 backend now supports non-continuous rendering, see https://github.com/libgdx/libgdx/pull/3772
- API Change: Lwjgl3WindowListener.refreshRequested() is called when the windowing system (GLFW) reports contents of a window are dirty and need to be redrawn.
- API Change: Lwjgl3WindowListener.maximized() is called when a window enters or exits a maximized state.
- API Change: Lwjgl3WindowListener.deiconified() removed, combined with .iconified().
- API Change: Lwjgl3Window.deiconify() renamed to .restore() since it can also be used to de-maximize a window.
- Lwjgl3Window now has a maximize() method, and windows can be started maximized using the window or app configuration's setMaximized() method.
- NinePatch can now be drawn rotated or scaled.
- NinepatchDrawable is now a TransformDrawable.
- API Change: Group add* methods no longer remove and re-add the actor if it is already in the group, instead they do nothing.
- API Change: g2d.Animation is now generic so it can support Drawables, PolygonRegions, NinePatches, etc. To fix existing code, specify the TextureRegion type in animation declarations (and instantiations in Java 6), i.e. Animation<TextureRegion> myAnimation = new Animation<TextureRegion>(...);
- Added ShaderProgramLoader for AssetManager.

[1.9.4]
- Moved snapping from ProgressBar to Slider to prevent snapping when setting the value programmatically.
Expand Down
2 changes: 2 additions & 0 deletions CONTRIBUTORS
Expand Up @@ -176,3 +176,5 @@ ClaudiuBele https://github.com/ClaudiuBele
realitix https://github.com/realitix
vmilea https://github.com/vmilea
intrigus https://github.com/intrigus
code-disaster https://github.com/code-disaster
3xp0n3nt https://github.com/3xp0n3nt
Expand Up @@ -19,6 +19,10 @@
import static com.badlogic.gdx.utils.SharedLibraryLoader.*;
import static com.badlogic.jglfw.Glfw.*;

import java.awt.EventQueue;
import java.util.HashMap;
import java.util.Map;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.ApplicationLogger;
Expand All @@ -33,10 +37,6 @@
import com.badlogic.jglfw.GlfwCallbackAdapter;
import com.badlogic.jglfw.GlfwCallbacks;

import java.awt.EventQueue;
import java.util.HashMap;
import java.util.Map;

/** An OpenGL surface fullscreen or in a lightweight window using GLFW.
* @author mzechner
* @author Nathan Sweet */
Expand Down Expand Up @@ -208,6 +208,12 @@ protected void frame () {

boolean shouldRender = false;

int width = glfwGetWindowWidth(graphics.window), height = glfwGetWindowHeight(graphics.window);
if (width != graphics.width || height != graphics.height) {
graphics.sizeChanged(width, height); // Seems OS X Sierra doesn't notify of some window size changes.
shouldRender = true;
}

if (executeRunnables()) shouldRender = true;

if (!running) return;
Expand Down
Expand Up @@ -28,20 +28,23 @@
* @author mzechner */
public class JglfwClipboard implements Clipboard, ClipboardOwner {
public String getContents () {
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(null);
if (contents != null && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) {
try {
try {
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(null);
if (contents != null && contents.isDataFlavorSupported(DataFlavor.stringFlavor)) {
return (String)contents.getTransferData(DataFlavor.stringFlavor);
} catch (Exception ignored) {
}
} catch (Exception ignored) { // Ignore JDK crashes sorting data flavors.
}
return "";
}

public void setContents (String content) {
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(new StringSelection(content), this);
try {
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(new StringSelection(content), this);
} catch (Exception ignored) { // Ignore JDK crashes sorting data flavors.
}
}

public void lostOwnership (java.awt.datatransfer.Clipboard clipboard, Transferable transferable) {
Expand Down
Expand Up @@ -18,25 +18,24 @@

import static com.badlogic.jglfw.Glfw.*;

import java.awt.Toolkit;

import com.badlogic.gdx.Application;
import com.badlogic.gdx.ApplicationListener;
import com.badlogic.gdx.Gdx;
import com.badlogic.gdx.Graphics;
import com.badlogic.gdx.graphics.Color;
import com.badlogic.gdx.graphics.Cursor;
import com.badlogic.gdx.graphics.Cursor.SystemCursor;
import com.badlogic.gdx.graphics.GL20;
import com.badlogic.gdx.graphics.GL30;
import com.badlogic.gdx.graphics.Pixmap;
import com.badlogic.gdx.graphics.Cursor.SystemCursor;
import com.badlogic.gdx.graphics.glutils.GLVersion;
import com.badlogic.gdx.utils.Array;
import com.badlogic.gdx.utils.GdxRuntimeException;
import com.badlogic.jglfw.Glfw;
import com.badlogic.jglfw.GlfwVideoMode;
import com.badlogic.jglfw.gl.GL;

import java.awt.Toolkit;

/** An implementation of the {@link Graphics} interface based on GLFW.
* @author Nathan Sweet */
public class JglfwGraphics implements Graphics {
Expand All @@ -53,7 +52,7 @@ public class JglfwGraphics implements Graphics {
private boolean resizable, undecorated;
private BufferFormat bufferFormat;
private boolean vSync;
private int x, y, width, height;
int x, y, width, height;
private boolean visible;
private Color initialBackgroundColor;
private volatile boolean isContinuous = true, renderRequested;
Expand Down Expand Up @@ -127,7 +126,7 @@ private boolean createWindow (int width, int height, boolean fullscreen) {
boolean mouseCaptured = window != 0 && glfwGetInputMode(window, GLFW_CURSOR_MODE) == GLFW_CURSOR_CAPTURED;

long oldWindow = window;
long newWindow = glfwCreateWindow(width, height, title, fullscreen ? fullscreenMonitor : 0, oldWindow);
long newWindow = glfwCreateWindow(width + (fullscreen ? 0 : -1), height, title, fullscreen ? fullscreenMonitor : 0, oldWindow);
if (newWindow == 0) return false;
if (oldWindow != 0) glfwDestroyWindow(oldWindow);
window = newWindow;
Expand All @@ -146,7 +145,9 @@ private boolean createWindow (int width, int height, boolean fullscreen) {

if (!mouseCaptured) glfwSetInputMode(window, GLFW_CURSOR_MODE, GLFW_CURSOR_NORMAL); // Prevent fullscreen from taking mouse.

glfwMakeContextCurrent(newWindow);
glfwSetWindowSize(window, width, height);

glfwMakeContextCurrent(window);
setVSync(vSync);
if (visible) glfwShowWindow(window);

Expand Down
Expand Up @@ -32,26 +32,29 @@ public class LwjglClipboard implements Clipboard, ClipboardOwner {
@Override
public String getContents () {
String result = "";
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(null);
boolean hasTransferableText = (contents != null) && contents.isDataFlavorSupported(DataFlavor.stringFlavor);
if (hasTransferableText) {
try {
result = (String)contents.getTransferData(DataFlavor.stringFlavor);
} catch (UnsupportedFlavorException ex) {
// doh...
} catch (IOException ex) {
// doh...
try {
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
Transferable contents = clipboard.getContents(null);
boolean hasTransferableText = (contents != null) && contents.isDataFlavorSupported(DataFlavor.stringFlavor);
if (hasTransferableText) {
try {
result = (String)contents.getTransferData(DataFlavor.stringFlavor);
} catch (Exception ex) {
}
}
} catch (Exception ignored) { // Ignore JDK crashes sorting data flavors.
}
return result;
}

@Override
public void setContents (String content) {
StringSelection stringSelection = new StringSelection(content);
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, this);
try {
StringSelection stringSelection = new StringSelection(content);
java.awt.datatransfer.Clipboard clipboard = Toolkit.getDefaultToolkit().getSystemClipboard();
clipboard.setContents(stringSelection, this);
} catch (Exception ignored) { // Ignore JDK crashes sorting data flavors.
}
}

@Override
Expand Down
Expand Up @@ -319,7 +319,7 @@ private void createDisplayPixelFormat (boolean useGL30, int gles30ContextMajor,
createDisplayPixelFormat(useGL30, gles30ContextMajor, gles30ContextMinor);
return;
}
throw new GdxRuntimeException("OpenGL is not supported by the video driver: " + glVersion.getDebugVersionString(), ex3);
throw new GdxRuntimeException("OpenGL is not supported by the video driver.", ex3);
}
if (getDisplayMode().bitsPerPixel == 16) {
bufferFormat = new BufferFormat(5, 6, 5, 0, 8, 0, 0, false);
Expand Down
21 changes: 20 additions & 1 deletion backends/gdx-backend-lwjgl3/.classpath
Expand Up @@ -3,10 +3,29 @@
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry exported="true" kind="lib" path="/gdx/libs/gdx-natives.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-natives.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jlayer-1.0.1-libgdx.jar"/>
<classpathentry exported="true" kind="lib" path="libs/jorbis.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-natives-macos.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-glfw.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-glfw-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-glfw-natives-macos.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-glfw-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-jemalloc.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-jemalloc-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-jemalloc-natives-macos.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-jemalloc-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-openal.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-openal-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-openal-natives-macos.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-openal-natives-windows.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-opengl.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-stb.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-stb-natives-linux.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-stb-natives-macos.jar"/>
<classpathentry exported="true" kind="lib" path="libs/lwjgl-stb-natives-windows.jar"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/gdx"/>
<classpathentry exported="true" kind="lib" path="libs/AppleJavaExtensions-1.4.jar"/>
<classpathentry kind="output" path="bin"/>
Expand Down
Binary file removed backends/gdx-backend-lwjgl3/libs/lwjgl-natives.jar
Binary file not shown.
Binary file removed backends/gdx-backend-lwjgl3/libs/lwjgl.jar
Binary file not shown.
105 changes: 96 additions & 9 deletions backends/gdx-backend-lwjgl3/pom.xml
Expand Up @@ -19,32 +19,119 @@
<version>${project.version}</version>
</dependency>

<dependency>
<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl3.version}</version>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-platform</artifactId>
<version>${lwjgl3.platformVersion}</version>
<artifactId>lwjgl</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-windows</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-linux</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-macos</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl3.version}</version>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-windows</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-platform</artifactId>
<version>${lwjgl3.platformVersion}</version>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-linux</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-platform</artifactId>
<version>${lwjgl3.platformVersion}</version>
<classifier>natives-osx</classifier>
</dependency>
<artifactId>lwjgl-glfw</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-macos</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-jemalloc</artifactId>
<version>${lwjgl3.version}</version>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-jemalloc</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-windows</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-jemalloc</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-linux</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-jemalloc</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-macos</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-opengl</artifactId>
<version>${lwjgl3.version}</version>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-openal</artifactId>
<version>${lwjgl3.version}</version>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-openal</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-windows</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-openal</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-linux</classifier>
</dependency>

<dependency>
<groupId>org.lwjgl</groupId>
<artifactId>lwjgl-openal</artifactId>
<version>${lwjgl3.version}</version>
<classifier>natives-macos</classifier>
</dependency>

<dependency>
<groupId>com.badlogicgames.jlayer</groupId>
Expand Down

0 comments on commit 8a0941a

Please sign in to comment.