From 4578b75aee70e2ca3af9a3e6a36f3df0b2d98fe0 Mon Sep 17 00:00:00 2001 From: Sri Harsha Chilakapati Date: Fri, 25 Dec 2015 07:35:35 +0530 Subject: [PATCH] Use per module java language levels --- .../examples/client/TextureExample.java | 24 +++++++------------ .../examples/client/TexturedCubeExample.java | 24 +++++++------------ webgl4j/build.gradle | 3 +++ 3 files changed, 21 insertions(+), 30 deletions(-) diff --git a/examples/src/main/java/com/shc/webgl4j/examples/client/TextureExample.java b/examples/src/main/java/com/shc/webgl4j/examples/client/TextureExample.java index 7d82d91..fe0efc3 100644 --- a/examples/src/main/java/com/shc/webgl4j/examples/client/TextureExample.java +++ b/examples/src/main/java/com/shc/webgl4j/examples/client/TextureExample.java @@ -25,8 +25,6 @@ package com.shc.webgl4j.examples.client; import com.google.gwt.canvas.client.Canvas; -import com.google.gwt.event.dom.client.LoadEvent; -import com.google.gwt.event.dom.client.LoadHandler; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.RootPanel; import org.joml.Matrix4f; @@ -136,23 +134,19 @@ public void init() glEnableVertexAttribArray(texcoordLoc); final Image image = new Image("texture.png"); - image.addLoadHandler(new LoadHandler() + image.addLoadHandler(event -> { - @Override - public void onLoad(LoadEvent event) - { - // Make current again, this is asynchronous event - context.makeCurrent(); - int texID = glCreateTexture(); - glBindTexture(GL_TEXTURE_2D, texID); + // Make current again, this is asynchronous event + context.makeCurrent(); + int texID = glCreateTexture(); + glBindTexture(GL_TEXTURE_2D, texID); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, image); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, image); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glUniform1i(glGetUniformLocation(programID, "tex"), 0); - } + glUniform1i(glGetUniformLocation(programID, "tex"), 0); }); image.setVisible(false); RootPanel.get().add(image); diff --git a/examples/src/main/java/com/shc/webgl4j/examples/client/TexturedCubeExample.java b/examples/src/main/java/com/shc/webgl4j/examples/client/TexturedCubeExample.java index ea58075..c152c98 100644 --- a/examples/src/main/java/com/shc/webgl4j/examples/client/TexturedCubeExample.java +++ b/examples/src/main/java/com/shc/webgl4j/examples/client/TexturedCubeExample.java @@ -25,8 +25,6 @@ package com.shc.webgl4j.examples.client; import com.google.gwt.canvas.client.Canvas; -import com.google.gwt.event.dom.client.LoadEvent; -import com.google.gwt.event.dom.client.LoadHandler; import com.google.gwt.user.client.ui.Image; import com.google.gwt.user.client.ui.RootPanel; import org.joml.Matrix4f; @@ -219,23 +217,19 @@ public void init() glEnableVertexAttribArray(texcoordLoc); final Image image = new Image("texture.png"); - image.addLoadHandler(new LoadHandler() + image.addLoadHandler(event -> { - @Override - public void onLoad(LoadEvent event) - { - // Make current again, this is asynchronous event - context.makeCurrent(); - int texID = glCreateTexture(); - glBindTexture(GL_TEXTURE_2D, texID); + // Make current again, this is asynchronous event + context.makeCurrent(); + int texID = glCreateTexture(); + glBindTexture(GL_TEXTURE_2D, texID); - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, image); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, image); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); - glUniform1i(glGetUniformLocation(programID, "tex"), 0); - } + glUniform1i(glGetUniformLocation(programID, "tex"), 0); }); image.setVisible(false); RootPanel.get().add(image); diff --git a/webgl4j/build.gradle b/webgl4j/build.gradle index 83bccdc..c6c2f2b 100644 --- a/webgl4j/build.gradle +++ b/webgl4j/build.gradle @@ -2,6 +2,9 @@ apply plugin: 'java' apply plugin: 'maven' apply plugin: 'signing' +sourceCompatibility = 1.7 +targetCompatibility = 1.7 + group = "com.goharsha" archivesBaseName = "webgl4j" version = "0.2.7"