\r
@Override\r
public void windowIconified(WindowEvent arg0) { \r
- graphics.pause(); \r
+ graphics.pause(); \r
}\r
\r
@Override\r
+++ /dev/null
-\r
-package com.badlogic.gdx.backends.desktop;\r
-\r
-import java.awt.Canvas;\r
-import java.io.BufferedOutputStream;\r
-import java.io.File;\r
-import java.io.FileOutputStream;\r
-import java.io.InputStream;\r
-import java.util.ArrayList;\r
-\r
-import org.lwjgl.LWJGLException;\r
-import org.lwjgl.input.Keyboard;\r
-import org.lwjgl.input.Mouse;\r
-import org.lwjgl.opengl.Display;\r
-import org.lwjgl.opengl.DisplayMode;\r
-import org.lwjgl.opengl.PixelFormat;\r
-\r
-import com.badlogic.gdx.Application;\r
-import com.badlogic.gdx.ApplicationListener;\r
-import com.badlogic.gdx.Audio;\r
-import com.badlogic.gdx.Files;\r
-import com.badlogic.gdx.Gdx;\r
-import com.badlogic.gdx.Graphics;\r
-import com.badlogic.gdx.Input;\r
-import com.badlogic.gdx.RenderListener;\r
-import com.badlogic.gdx.Version;\r
-import com.badlogic.gdx.utils.GdxRuntimeException;\r
-\r
-@SuppressWarnings("unchecked") public class LwjglApplication implements Application {\r
- static {\r
- System.setProperty("org.lwjgl.input.Mouse.allowNegativeMouseCoords", "true");\r
- Version.loadLibrary();\r
-\r
- String os = System.getProperty("os.name");\r
- String arch = System.getProperty("os.arch");\r
- boolean is64Bit = false;\r
-\r
- if (arch.equals("amd64")) is64Bit = true;\r
-\r
- if (os.contains("Windows")) loadLibrariesWindows(is64Bit);\r
- if (os.contains("Linux")) loadLibrariesLinux(is64Bit);\r
- if (os.contains("Mac")) loadLibrariesMac();\r
-\r
- System.setProperty("org.lwjgl.librarypath", new File("").getAbsolutePath());\r
- }\r
-\r
- private static void loadLibrariesWindows (boolean is64Bit) {\r
- String[] libNames = null;\r
- if (is64Bit)\r
- libNames = new String[] {"OpenAL64.dll", "lwjgl64.dll", "jinput-raw_64.dll", "jinput-dx8_64.dll"};\r
- else\r
- libNames = new String[] {"OpenAL32.dll", "lwjgl.dll", "jinput-raw.dll", "jinput-dx8.dll"};\r
-\r
- for (String libName : libNames)\r
- loadLibrary(libName, "/native/windows/");\r
- }\r
-\r
- private static void loadLibrariesLinux (boolean is64Bit) {\r
- String[] libNames = null;\r
- if (is64Bit)\r
- libNames = new String[] {"libopenal64.so", "liblwjgl64.so", "jinput-linux64.so",};\r
- else\r
- libNames = new String[] {"libopenal.so", "liblwjgl.so", "jinput-linux.so",};\r
-\r
- for (String libName : libNames)\r
- loadLibrary(libName, "/native/linux/");\r
- }\r
-\r
- private static void loadLibrariesMac () {\r
- throw new GdxRuntimeException("loading native libs on Mac OS X not supported, mail contact@badlogicgames.com");\r
- }\r
-\r
- private static void loadLibrary (String libName, String classPath) {\r
- InputStream in = null;\r
- BufferedOutputStream out = null;\r
-\r
- try {\r
- in = LwjglApplication.class.getResourceAsStream(classPath + libName);\r
- out = new BufferedOutputStream(new FileOutputStream(libName));\r
- byte[] bytes = new byte[1024 * 4];\r
- while (true) {\r
- int read_bytes = in.read(bytes);\r
- if (read_bytes == -1) break;\r
-\r
- out.write(bytes, 0, read_bytes);\r
- }\r
- out.close();\r
- out = null;\r
- in.close();\r
- in = null;\r
- } catch (Throwable t) {\r
- new GdxRuntimeException("Couldn't load lwjgl native, " + libName, t);\r
- } finally {\r
- if (out != null) try {\r
- out.close();\r
- } catch (Exception ex) {\r
- }\r
- ;\r
- if (in != null) try {\r
- in.close();\r
- } catch (Exception ex) {\r
- }\r
- }\r
- }\r
-\r
- private final LwjglGraphics graphics;\r
- private final LwjglInput input;\r
- private final LwjglAudio audio;\r
-\r
- protected int width, height;\r
- private String title = "";\r
- private boolean mousePressed;\r
- private int mouseX, mouseY;\r
- private volatile boolean running = true;\r
- final ArrayList<RenderListener> listeners = new ArrayList();\r
- private Thread gameThread;\r
- private ApplicationListener appListener;\r
-\r
- public LwjglApplication (String title, int width, int height, boolean useGL20IfAvailable) {\r
- if (title == null) throw new IllegalArgumentException("title cannot be null.");\r
- this.title = title;\r
- this.width = width;\r
- this.height = height;\r
-\r
- graphics = new LwjglGraphics(this, title, width, height, useGL20IfAvailable);\r
- listeners.add(graphics);\r
- input = new LwjglInput();\r
- audio = new LwjglAudio();\r
-\r
- Gdx.app = this;\r
- Gdx.graphics = this.getGraphics();\r
- Gdx.input = this.getInput();\r
- Gdx.audio = this.getAudio();\r
- Gdx.files = this.getFiles();\r
-\r
- new Thread("LWJGL Application") {\r
- public void run () {\r
- try {\r
- LwjglApplication.this.start();\r
- } catch (LWJGLException ex) {\r
- throw new GdxRuntimeException(ex);\r
- }\r
- }\r
- }.start();\r
- }\r
-\r
- protected void setupDisplay () throws LWJGLException {\r
- Display.setDisplayMode(new DisplayMode(width, height));\r
- Display.setFullscreen(false);\r
- Display.setTitle(title);\r
- int samples = 0;\r
- try {\r
- Display.create(new PixelFormat(8, 8, 0, samples));\r
- } catch (Exception ex) {\r
- Display.destroy();\r
- try {\r
- Display.create(new PixelFormat(8, 8, 0));\r
- } catch (Exception ex2) {\r
- Display.destroy();\r
- Display.create(new PixelFormat());\r
- }\r
- }\r
- }\r
-\r
- public void setSize (int width, int height) {\r
- this.width = width;\r
- this.height = height;\r
- for (RenderListener listener : listeners)\r
- listener.resized(getWidth(), getHeight());\r
- }\r
-\r
- void start () throws LWJGLException {\r
- gameThread = Thread.currentThread();\r
-\r
- setupDisplay();\r
-\r
- for (RenderListener listener : listeners)\r
- listener.created();\r
- setSize(width, height);\r
- graphics.lastTime = System.nanoTime();\r
- for (RenderListener listener : listeners)\r
- listener.render();\r
-\r
- while (running && !Display.isCloseRequested()) {\r
-\r
- if (Keyboard.isCreated()) {\r
- while (Keyboard.next()) {\r
- if (Keyboard.getEventKeyState())\r
- input.fireKeyDown(LwjglInput.getKeyCode(Keyboard.getEventKey()));\r
- else {\r
- input.fireKeyUp(LwjglInput.getKeyCode(Keyboard.getEventKey()));\r
- input.fireKeyTyped(Keyboard.getEventCharacter());\r
- }\r
- }\r
- }\r
-\r
- if (Mouse.isCreated()) {\r
- int x = Mouse.getX();\r
- int y = height - Mouse.getY();\r
- while (Mouse.next()) {\r
- if (isButtonPressed()) {\r
- if (mousePressed == false) {\r
- mousePressed = true;\r
- mouseX = x;\r
- mouseY = y;\r
- input.fireTouchDown(x, y, 0);\r
- } else {\r
- if (mouseX != x || mouseY != y) {\r
- input.fireTouchDragged(x, y, 0);\r
- mouseX = x;\r
- mouseY = y;\r
- }\r
- }\r
- } else {\r
- if (mousePressed == true) {\r
- mousePressed = false;\r
- input.fireTouchUp(x, y, 0);\r
- }\r
- }\r
- }\r
- }\r
-\r
- for (int i = 0, n = listeners.size(); i < n; i++)\r
- listeners.get(i).render();\r
-\r
- Display.update();\r
- Display.sync(60);\r
- }\r
-\r
- if (appListener != null) appListener.pause();\r
- try {\r
- for (int i = 0, n = listeners.size(); i < n; i++)\r
- listeners.get(i).dispose();\r
- } finally {\r
- Display.destroy();\r
- }\r
- if (appListener != null) appListener.destroy();\r
- }\r
-\r
- private boolean isButtonPressed () {\r
- for (int i = 0; i < Mouse.getButtonCount(); i++)\r
- if (Mouse.isButtonDown(i)) return true;\r
- return false;\r
- }\r
-\r
- public void stop () {\r
- running = false;\r
- try {\r
- gameThread.join();\r
- } catch (InterruptedException ex) {\r
- ex.printStackTrace();\r
- }\r
- }\r
-\r
- public int getWidth () {\r
- return width;\r
- }\r
-\r
- public int getHeight () {\r
- return height;\r
- }\r
-\r
- public void close () {\r
- running = false;\r
- }\r
-\r
- public Audio getAudio () {\r
- return audio;\r
- }\r
-\r
- public Files getFiles () {\r
- return new LwjglFiles();\r
- }\r
-\r
- public Graphics getGraphics () {\r
- return graphics;\r
- }\r
-\r
- public Input getInput () {\r
- return input;\r
- }\r
-\r
- public void setApplicationListener (ApplicationListener appListener) {\r
- this.appListener = appListener;\r
- }\r
-\r
- public void log (String tag, String message) {\r
- System.out.println(tag + ": " + message);\r
- }\r
-\r
- public ApplicationType getType () {\r
- return ApplicationType.Desktop;\r
- }\r
-\r
- @Override public int getVersion () {\r
- return 0;\r
- }\r
-}\r
\r
package com.badlogic.gdx.backends.desktop;\r
\r
+import java.awt.Canvas;\r
import java.awt.image.BufferedImage;\r
import java.io.InputStream;\r
\r
import javax.imageio.ImageIO;\r
\r
+import org.lwjgl.LWJGLException;\r
+import org.lwjgl.opengl.Display;\r
+import org.lwjgl.opengl.DisplayMode;\r
+import org.lwjgl.opengl.PixelFormat;\r
+\r
import com.badlogic.gdx.Gdx;\r
import com.badlogic.gdx.Graphics;\r
-import com.badlogic.gdx.RenderListener;\r
import com.badlogic.gdx.files.FileHandle;\r
import com.badlogic.gdx.graphics.GL10;\r
import com.badlogic.gdx.graphics.GL11;\r
import com.badlogic.gdx.utils.GdxRuntimeException;\r
\r
/**\r
- * An implementation of the {@link Graphics} interface based on Jogl.\r
+ * An implementation of the {@link Graphics} interface based on Lwjgl.\r
* @author mzechner\r
*/\r
-public final class LwjglGraphics implements Graphics, RenderListener {\r
- private final LwjglApplication app;\r
- private GLCommon gl;\r
- private GL10 gl10;\r
- private GL11 gl11;\r
- private GL20 gl20;\r
- private final boolean useGL2;\r
- private float deltaTime = 0;\r
- private long frameStart = 0;\r
- private int frames = 0;\r
- private int fps;\r
-\r
- long lastTime;\r
-\r
- LwjglGraphics (final LwjglApplication application, String title, int width, int height, boolean useGL2IfAvailable) {\r
- this.app = application;\r
+public final class LwjglGraphics implements Graphics{ \r
+ GLCommon gl;\r
+ GL10 gl10;\r
+ GL11 gl11;\r
+ GL20 gl20;\r
+ final boolean useGL2;\r
+ float deltaTime = 0;\r
+ long frameStart = 0;\r
+ int frames = 0;\r
+ int fps;\r
+ long lastTime = System.nanoTime();\r
+ int width;\r
+ int height;\r
+ String title;\r
+ Canvas canvas;\r
+\r
+ LwjglGraphics (String title, int width, int height, boolean useGL2IfAvailable, Canvas canvas) { \r
useGL2 = useGL2IfAvailable;\r
+ this.title = title;\r
+ this.width = width;\r
+ this.height = height;\r
+ this.canvas = canvas;\r
}\r
\r
public GL10 getGL10 () {\r
}\r
\r
public int getHeight () {\r
- return app.getHeight();\r
+ return height;\r
}\r
\r
public int getWidth () {\r
- return app.getWidth();\r
+ return width;\r
}\r
\r
public boolean isGL11Available () {\r
throw new GdxRuntimeException("Texture dimensions must be a power of two: " + file);\r
\r
return new LwjglTexture((BufferedImage)pixmap.getNativePixmap(), minFilter, magFilter, uWrap, vWrap, false);\r
- }\r
+ } \r
\r
- public void setRenderListener (RenderListener listener) {\r
- app.listeners.add(listener);\r
+ public float getDeltaTime () {\r
+ return deltaTime;\r
}\r
\r
- public void dispose () {\r
+ public GraphicsType getType () {\r
+ return GraphicsType.LWJGL;\r
+ }\r
\r
+ public int getFramesPerSecond () {\r
+ return fps;\r
}\r
\r
- public void render () {\r
+ @Override public GLCommon getGLCommon () {\r
+ return gl;\r
+ }\r
+ \r
+ void updateTime () {\r
long time = System.nanoTime();\r
deltaTime = (time - lastTime) / 1000000000.0f;\r
lastTime = time;\r
}\r
frames++;\r
}\r
+ \r
+ protected void setupDisplay () throws LWJGLException {\r
+ if(canvas!=null) Display.setParent(canvas);\r
+ Display.setDisplayMode(new DisplayMode(width, height));\r
+ Display.setFullscreen(false);\r
+ Display.setTitle(title);\r
+ int samples = 0;\r
+ try {\r
+ Display.create(new PixelFormat(8, 8, 0, samples));\r
+ } catch (Exception ex) {\r
+ Display.destroy();\r
+ try {\r
+ Display.create(new PixelFormat(8, 8, 0));\r
+ } catch (Exception ex2) {\r
+ Display.destroy();\r
+ Display.create(new PixelFormat());\r
+ }\r
+ }\r
+ \r
+ initiateGLInstances();\r
+ }\r
\r
- public void created () {\r
+ void initiateGLInstances () {\r
String version = org.lwjgl.opengl.GL11.glGetString(GL11.GL_VERSION);\r
int major = Integer.parseInt("" + version.charAt(0));\r
int minor = Integer.parseInt("" + version.charAt(2));\r
Gdx.gl11 = gl11;\r
Gdx.gl20 = gl20;\r
}\r
-\r
- public float getDeltaTime () {\r
- return deltaTime;\r
- }\r
-\r
- public void resized (int width, int height) {\r
- }\r
-\r
- public GraphicsType getType () {\r
- return GraphicsType.LWJGL;\r
- }\r
-\r
- public int getFramesPerSecond () {\r
- return fps;\r
- }\r
-\r
- @Override public GLCommon getGLCommon () {\r
- return gl;\r
- }\r
}\r
package com.badlogic.gdx.backends.desktop;\r
\r
import java.util.ArrayList;\r
+import java.util.HashSet;\r
+import java.util.List;\r
+import java.util.Set;\r
\r
import javax.swing.JOptionPane;\r
import javax.swing.SwingUtilities;\r
import com.badlogic.gdx.Gdx;\r
import com.badlogic.gdx.Input;\r
import com.badlogic.gdx.InputProcessor;\r
-import com.badlogic.gdx.RenderListener;\r
+import com.badlogic.gdx.utils.Pool;\r
+import com.badlogic.gdx.utils.Pool.PoolObjectFactory;\r
\r
/**\r
* An implementation of the {@link Input} interface hooking a Jogl panel for input.\r
* @author mzechner\r
* \r
*/\r
-final class LwjglInput implements Input, RenderListener {\r
- String text;\r
- TextInputListener textListener;\r
- @SuppressWarnings("unchecked") private final ArrayList<InputProcessor> listeners = new ArrayList();\r
+final class LwjglInput implements Input {\r
+ class KeyEvent {\r
+ static final int KEY_DOWN = 0;\r
+ static final int KEY_UP = 1;\r
+ static final int KEY_TYPED = 2;\r
+\r
+ int type;\r
+ int keyCode;\r
+ char keyChar;\r
+ }\r
+\r
+ class TouchEvent {\r
+ static final int TOUCH_DOWN = 0;\r
+ static final int TOUCH_UP = 1;\r
+ static final int TOUCH_DRAGGED = 2;\r
\r
- public void addInputListener (InputProcessor listener) {\r
- listeners.add(listener);\r
+ int type;\r
+ int x;\r
+ int y;\r
+ int pointer;\r
}\r
\r
+ Pool<KeyEvent> freeKeyEvents = new Pool<KeyEvent>(\r
+ new PoolObjectFactory<KeyEvent>() {\r
+\r
+ @Override\r
+ public KeyEvent createObject() {\r
+ return new KeyEvent();\r
+ }\r
+ }, 1000);\r
+\r
+ Pool<TouchEvent> freeTouchEvents = new Pool<TouchEvent>(\r
+ new PoolObjectFactory<TouchEvent>() {\r
+\r
+ @Override\r
+ public TouchEvent createObject() {\r
+ return new TouchEvent();\r
+ }\r
+ }, 1000);\r
+\r
+ List<KeyEvent> keyEvents = new ArrayList<KeyEvent>();\r
+ List<TouchEvent> touchEvents = new ArrayList<TouchEvent>();\r
+ boolean mousePressed = false;\r
+ int mouseX = 0;\r
+ int mouseY = 0;\r
+ int pressedKeys = 0;\r
+ \r
public float getAccelerometerX () {\r
return 0;\r
}\r
public void getTextInput (final TextInputListener listener, final String title, final String text) {\r
SwingUtilities.invokeLater(new Runnable() {\r
public void run () {\r
- LwjglInput.this.text = JOptionPane.showInputDialog(null, title, text);\r
- if (LwjglInput.this.text != null) textListener = listener;\r
+ String output = JOptionPane.showInputDialog(null, title, text);\r
+ listener.input(output);\r
}\r
});\r
}\r
}\r
\r
public boolean isKeyPressed (int key) {\r
- return Keyboard.isKeyDown(getKeyCodeReverse(key));\r
+ if( key == Input.Keys.ANY_KEY )\r
+ return pressedKeys > 0;\r
+ else\r
+ return Keyboard.isKeyDown(getKeyCodeReverse(key));\r
}\r
\r
public boolean isTouched () {\r
- boolean button = Mouse.isButtonDown(0) || Mouse.isButtonDown(1) || Mouse.isButtonDown(2);\r
- if (button) System.out.println("button!!");\r
+ boolean button = Mouse.isButtonDown(0) || Mouse.isButtonDown(1) || Mouse.isButtonDown(2); \r
return button;\r
}\r
\r
- public void removeInputListener (InputProcessor listener) {\r
- listeners.remove(listener);\r
- }\r
-\r
- public void dispose () {\r
- listeners.clear();\r
- }\r
-\r
- public void render () {\r
- if (textListener != null) {\r
- textListener.input(text);\r
- textListener = null;\r
- }\r
- }\r
-\r
- public void created () {\r
- // TODO Auto-generated method stub\r
-\r
- }\r
-\r
- public void resized (int width, int height) {\r
- // TODO Auto-generated method stub\r
-\r
- }\r
-\r
public int getX (int pointer) {\r
if (pointer > 0)\r
return 0;\r
return false;\r
}\r
\r
- public void fireKeyDown (int keycode) {\r
- for (int i = 0; i < listeners.size(); i++)\r
- if (listeners.get(i).keyDown(keycode)) return;\r
- }\r
-\r
- public void fireKeyUp (int keycode) {\r
- for (int i = 0; i < listeners.size(); i++)\r
- if (listeners.get(i).keyUp(keycode)) return;\r
- }\r
-\r
- public void fireKeyTyped (char character) {\r
- for (int i = 0; i < listeners.size(); i++)\r
- if (listeners.get(i).keyTyped(character)) return;\r
+ @Override public void setOnscreenKeyboardVisible (boolean visible) {\r
+ \r
}\r
\r
- public void fireTouchDown (int x, int y, int pointer) {\r
- for (int i = 0; i < listeners.size(); i++)\r
- if (listeners.get(i).touchDown(x, y, pointer)) return;\r
+ @Override public boolean supportsOnscreenKeyboard () {\r
+ return false;\r
}\r
-\r
- public void fireTouchUp (int x, int y, int pointer) {\r
- for (int i = 0; i < listeners.size(); i++)\r
- if (listeners.get(i).touchUp(x, y, pointer)) return;\r
+ \r
+ @Override public void setCatchBackKey (boolean catchBack) {\r
+ \r
}\r
\r
- public void fireTouchDragged (int x, int y, int pointer) {\r
- for (int i = 0; i < listeners.size(); i++)\r
- if (listeners.get(i).touchDragged(x, y, pointer)) return;\r
+ @Override\r
+ public void processEvents(InputProcessor listener) {\r
+ synchronized(this) {\r
+ if(listener!=null) { \r
+ for(KeyEvent e: keyEvents) {\r
+ switch(e.type) {\r
+ case KeyEvent.KEY_DOWN:\r
+ listener.keyDown(e.keyCode);\r
+ break;\r
+ case KeyEvent.KEY_UP:\r
+ listener.keyUp(e.keyCode);\r
+ break;\r
+ case KeyEvent.KEY_TYPED:\r
+ listener.keyTyped(e.keyChar);\r
+ }\r
+ freeKeyEvents.free(e); \r
+ } \r
+ \r
+ for(TouchEvent e: touchEvents) {\r
+ switch(e.type) {\r
+ case TouchEvent.TOUCH_DOWN:\r
+ listener.touchDown(e.x, e.y, e.pointer);\r
+ break;\r
+ case TouchEvent.TOUCH_UP:\r
+ listener.touchUp(e.x, e.y, e.pointer);\r
+ break;\r
+ case TouchEvent.TOUCH_DRAGGED:\r
+ listener.touchDragged(e.x, e.y, e.pointer);\r
+ }\r
+ freeTouchEvents.free(e);\r
+ }\r
+ }\r
+ \r
+ keyEvents.clear();\r
+ touchEvents.clear();\r
+ }\r
}\r
-\r
+ \r
public static int getKeyCode (int keyCode) {\r
if (keyCode == Keyboard.KEY_0) return Input.Keys.KEYCODE_0;\r
if (keyCode == Keyboard.KEY_1) return Input.Keys.KEYCODE_1;\r
if (keyCode == Input.Keys.KEYCODE_SHIFT_RIGHT) return Keyboard.KEY_RSHIFT;\r
if (keyCode == Input.Keys.KEYCODE_SLASH) return Keyboard.KEY_SLASH;\r
if (keyCode == Input.Keys.KEYCODE_SPACE) return Keyboard.KEY_SPACE;\r
- if (keyCode == Input.Keys.KEYCODE_TAB) return Keyboard.KEY_TAB;\r
+ if (keyCode == Input.Keys.KEYCODE_TAB) return Keyboard.KEY_TAB; \r
return Keyboard.KEY_NONE;\r
}\r
\r
- @Override public void setOnscreenKeyboardVisible (boolean visible) {\r
- \r
+ public void update() {\r
+ updateMouse();\r
+ updateKeyboard();\r
}\r
-\r
- @Override public boolean supportsOnscreenKeyboard () {\r
+ \r
+ void updateMouse() {\r
+ if (Mouse.isCreated()) {\r
+ int x = Mouse.getX();\r
+ int y = Gdx.graphics.getHeight() - Mouse.getY();\r
+ while (Mouse.next()) {\r
+ if (isButtonPressed()) {\r
+ if (mousePressed == false) {\r
+ mousePressed = true;\r
+ TouchEvent event = freeTouchEvents.newObject();\r
+ event.x = x;\r
+ event.y = y;\r
+ event.pointer = 0;\r
+ event.type = TouchEvent.TOUCH_DOWN;\r
+ touchEvents.add(event); \r
+ mouseX = x;\r
+ mouseY = y;\r
+ } else {\r
+ if (mouseX != x || mouseY != y) {\r
+ TouchEvent event = freeTouchEvents.newObject();\r
+ event.x = x;\r
+ event.y = y;\r
+ event.pointer = 0;\r
+ event.type = TouchEvent.TOUCH_DRAGGED;\r
+ touchEvents.add(event); \r
+ mouseX = x;\r
+ mouseY = y;\r
+ }\r
+ }\r
+ } else {\r
+ if (mousePressed == true) {\r
+ mouseX = x;\r
+ mouseY = y;\r
+ mousePressed = false;\r
+ TouchEvent event = freeTouchEvents.newObject();\r
+ event.x = x;\r
+ event.y = y;\r
+ event.pointer = 0;\r
+ event.type = TouchEvent.TOUCH_UP;\r
+ touchEvents.add(event);\r
+ }\r
+ }\r
+ }\r
+ }\r
+ }\r
+ \r
+ boolean isButtonPressed () {\r
+ for (int i = 0; i < Mouse.getButtonCount(); i++)\r
+ if (Mouse.isButtonDown(i)) return true;\r
return false;\r
}\r
+\r
\r
- @Override public void setCatchBackKey (boolean catchBack) {\r
- \r
+ void updateKeyboard() {\r
+ if (Keyboard.isCreated()) {\r
+ while (Keyboard.next()) {\r
+ if (Keyboard.getEventKeyState()) {\r
+ int keyCode = getKeyCode(Keyboard.getEventKey());\r
+ char keyChar = Keyboard.getEventCharacter();\r
+ \r
+ KeyEvent event = freeKeyEvents.newObject(); \r
+ event.keyCode = keyCode;\r
+ event.keyChar = 0;\r
+ event.type = KeyEvent.KEY_DOWN;\r
+ keyEvents.add(event);\r
+ \r
+ event = freeKeyEvents.newObject();\r
+ event.keyCode = 0;\r
+ event.keyChar = keyChar;\r
+ event.type = KeyEvent.KEY_TYPED;\r
+ keyEvents.add(event); \r
+ pressedKeys++;\r
+ } \r
+ else {\r
+ int keyCode = LwjglInput.getKeyCode(Keyboard.getEventKey()); \r
+ \r
+ KeyEvent event = freeKeyEvents.newObject();\r
+ event.keyCode = keyCode;\r
+ event.keyChar = 0;\r
+ event.type = KeyEvent.KEY_UP;\r
+ keyEvents.add(event);\r
+ \r
+ pressedKeys--;\r
+ }\r
+ }\r
+ } \r
}\r
}\r
\r
package com.badlogic.gdx.hiero;\r
\r
-import static org.lwjgl.opengl.GL11.*;\r
+import static org.lwjgl.opengl.GL11.GL_BLEND;\r
+import static org.lwjgl.opengl.GL11.GL_LIGHTING;\r
+import static org.lwjgl.opengl.GL11.GL_MODELVIEW;\r
+import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;\r
+import static org.lwjgl.opengl.GL11.GL_PROJECTION;\r
+import static org.lwjgl.opengl.GL11.GL_QUADS;\r
+import static org.lwjgl.opengl.GL11.GL_SCISSOR_TEST;\r
+import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;\r
+import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;\r
+import static org.lwjgl.opengl.GL11.GL_TEXTURE_COORD_ARRAY;\r
+import static org.lwjgl.opengl.GL11.GL_VERTEX_ARRAY;\r
+import static org.lwjgl.opengl.GL11.glBegin;\r
+import static org.lwjgl.opengl.GL11.glBlendFunc;\r
+import static org.lwjgl.opengl.GL11.glClearColor;\r
+import static org.lwjgl.opengl.GL11.glClearDepth;\r
+import static org.lwjgl.opengl.GL11.glColor4f;\r
+import static org.lwjgl.opengl.GL11.glDisable;\r
+import static org.lwjgl.opengl.GL11.glEnable;\r
+import static org.lwjgl.opengl.GL11.glEnableClientState;\r
+import static org.lwjgl.opengl.GL11.glEnd;\r
+import static org.lwjgl.opengl.GL11.glLoadIdentity;\r
+import static org.lwjgl.opengl.GL11.glMatrixMode;\r
+import static org.lwjgl.opengl.GL11.glOrtho;\r
+import static org.lwjgl.opengl.GL11.glScissor;\r
+import static org.lwjgl.opengl.GL11.glTexCoord2f;\r
+import static org.lwjgl.opengl.GL11.glVertex3f;\r
+import static org.lwjgl.opengl.GL11.glViewport;\r
\r
import java.awt.BorderLayout;\r
import java.awt.Canvas;\r
import javax.swing.KeyStroke;\r
import javax.swing.ScrollPaneConstants;\r
import javax.swing.SpinnerNumberModel;\r
-import javax.swing.UIManager;\r
-import javax.swing.UIManager.LookAndFeelInfo;\r
import javax.swing.border.EmptyBorder;\r
import javax.swing.event.ChangeEvent;\r
import javax.swing.event.ChangeListener;\r
import javax.swing.event.ListSelectionEvent;\r
import javax.swing.event.ListSelectionListener;\r
\r
-import org.lwjgl.LWJGLException;\r
-import org.lwjgl.opengl.Display;\r
import org.lwjgl.opengl.GL11;\r
\r
-import sun.rmi.runtime.Log;\r
-\r
+import com.badlogic.gdx.ApplicationListener;\r
import com.badlogic.gdx.Gdx;\r
-import com.badlogic.gdx.RenderListener;\r
-import com.badlogic.gdx.backends.desktop.LwjglApplication;\r
+import com.badlogic.gdx.backends.desktop.LwjglApplicationNew;\r
import com.badlogic.gdx.graphics.BitmapFont;\r
import com.badlogic.gdx.graphics.Color;\r
import com.badlogic.gdx.graphics.Texture;\r
import com.badlogic.gdx.hiero.unicodefont.UnicodeFont;\r
import com.badlogic.gdx.hiero.unicodefont.effects.ColorEffect;\r
import com.badlogic.gdx.hiero.unicodefont.effects.ConfigurableEffect;\r
-import com.badlogic.gdx.hiero.unicodefont.effects.ConfigurableEffect.Value;\r
import com.badlogic.gdx.hiero.unicodefont.effects.EffectUtil;\r
import com.badlogic.gdx.hiero.unicodefont.effects.GradientEffect;\r
import com.badlogic.gdx.hiero.unicodefont.effects.OutlineEffect;\r
import com.badlogic.gdx.hiero.unicodefont.effects.OutlineWobbleEffect;\r
import com.badlogic.gdx.hiero.unicodefont.effects.OutlineZigzagEffect;\r
import com.badlogic.gdx.hiero.unicodefont.effects.ShadowEffect;\r
-import com.badlogic.gdx.utils.GdxRuntimeException;\r
+import com.badlogic.gdx.hiero.unicodefont.effects.ConfigurableEffect.Value;\r
\r
/**\r
* A tool to visualize settings for {@link UnicodeFont} and to export BMFont files for use with {@link BitmapFont}.\r
+ "abcdefghijklmnopqrstuvwxyz\n1234567890\n" //\r
+ "\"!`?'.,;:()[]{}<>|/@\\^$-%+=#_&~*\u007F";\r
\r
- LwjglApplication app;\r
+ LwjglApplicationNew app;\r
Canvas glCanvas;\r
volatile UnicodeFont newUnicodeFont;\r
UnicodeFont unicodeFont;\r
\r
public final void addNotify () {\r
super.addNotify();\r
- app = new LwjglApplication("Hiero", 200, 200, false) {\r
- protected void setupDisplay () throws LWJGLException {\r
- try {\r
- Display.setParent(glCanvas);\r
- } catch (LWJGLException ex) {\r
- throw new GdxRuntimeException("Error setting display parent.", ex);\r
- }\r
- super.setupDisplay();\r
- }\r
- };\r
- app.getGraphics().setRenderListener(new Renderer());\r
+ app = new LwjglApplicationNew(new Renderer(), "Hiero", 200, 200, false, glCanvas);\r
+ \r
addWindowListener(new WindowAdapter() {\r
public void windowClosed (WindowEvent event) {\r
app.stop();\r
}\r
}\r
\r
- class Renderer implements RenderListener {\r
+ class Renderer implements ApplicationListener {\r
private String sampleText;\r
\r
public void created () {\r
\r
glEnable(GL_BLEND);\r
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);\r
- }\r
\r
- public void resized (int width, int height) {\r
+ int width = Gdx.graphics.getWidth();\r
+ int height = Gdx.graphics.getHeight();\r
+ \r
glViewport(0, 0, width, height);\r
glScissor(0, 0, width, height);\r
\r
\r
public void dispose () {\r
}\r
+\r
+ @Override\r
+ public void create() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void destroy() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void pause() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void resume() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
}\r
\r
public static void main (String[] args) throws Exception {\r
\r
package com.badlogic.gdx.hiero.unicodefont;\r
\r
-import static org.lwjgl.opengl.GL11.*;\r
+import static org.lwjgl.opengl.GL11.GL_BLEND;\r
+import static org.lwjgl.opengl.GL11.GL_COLOR_BUFFER_BIT;\r
+import static org.lwjgl.opengl.GL11.GL_LIGHTING;\r
+import static org.lwjgl.opengl.GL11.GL_MODELVIEW;\r
+import static org.lwjgl.opengl.GL11.GL_ONE_MINUS_SRC_ALPHA;\r
+import static org.lwjgl.opengl.GL11.GL_PROJECTION;\r
+import static org.lwjgl.opengl.GL11.GL_SCISSOR_TEST;\r
+import static org.lwjgl.opengl.GL11.GL_SRC_ALPHA;\r
+import static org.lwjgl.opengl.GL11.GL_TEXTURE_2D;\r
+import static org.lwjgl.opengl.GL11.GL_TEXTURE_COORD_ARRAY;\r
+import static org.lwjgl.opengl.GL11.GL_VERTEX_ARRAY;\r
+import static org.lwjgl.opengl.GL11.glBlendFunc;\r
+import static org.lwjgl.opengl.GL11.glClearColor;\r
+import static org.lwjgl.opengl.GL11.glClearDepth;\r
+import static org.lwjgl.opengl.GL11.glDisable;\r
+import static org.lwjgl.opengl.GL11.glEnable;\r
+import static org.lwjgl.opengl.GL11.glEnableClientState;\r
+import static org.lwjgl.opengl.GL11.glLoadIdentity;\r
+import static org.lwjgl.opengl.GL11.glMatrixMode;\r
+import static org.lwjgl.opengl.GL11.glOrtho;\r
+import static org.lwjgl.opengl.GL11.glScissor;\r
+import static org.lwjgl.opengl.GL11.glViewport;\r
\r
import org.lwjgl.opengl.GL11;\r
\r
+import com.badlogic.gdx.ApplicationListener;\r
import com.badlogic.gdx.Gdx;\r
-import com.badlogic.gdx.RenderListener;\r
-import com.badlogic.gdx.backends.desktop.LwjglApplication;\r
+import com.badlogic.gdx.backends.desktop.LwjglApplicationNew;\r
import com.badlogic.gdx.hiero.unicodefont.effects.ColorEffect;\r
\r
-public class UnicodeFontTest implements RenderListener {\r
+public class UnicodeFontTest implements ApplicationListener {\r
private UnicodeFont unicodeFont;\r
\r
- public void created () {\r
+ public void create () {\r
unicodeFont = new UnicodeFont("c:/windows/fonts/arial.ttf", 48, false, false);\r
unicodeFont.getEffects().add(new ColorEffect(java.awt.Color.white));\r
- // unicodeFont.addAsciiGlyphs();\r
- // unicodeFont.loadGlyphs();\r
- }\r
\r
- public void resized (int width, int height) {\r
+ int width = Gdx.graphics.getWidth();\r
+ int height = Gdx.graphics.getHeight();\r
+ \r
glViewport(0, 0, width, height);\r
glScissor(0, 0, width, height);\r
glEnable(GL_SCISSOR_TEST);\r
}\r
\r
public static void main (String[] args) {\r
- LwjglApplication app = new LwjglApplication("UnicodeFont Test", 800, 600, false);\r
- app.getGraphics().setRenderListener(new UnicodeFontTest());\r
+ new LwjglApplicationNew(new UnicodeFontTest(), "UnicodeFont Test", 800, 600, false); \r
+ }\r
+\r
+ @Override\r
+ public void destroy() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void pause() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void resume() {\r
+ // TODO Auto-generated method stub\r
+ \r
}\r
}\r
import javax.swing.border.CompoundBorder;\r
import javax.swing.plaf.basic.BasicSplitPaneUI;\r
\r
-import org.lwjgl.LWJGLException;\r
-import org.lwjgl.opengl.Display;\r
-\r
-import com.badlogic.gdx.Files.FileType;\r
+import com.badlogic.gdx.ApplicationListener;\r
import com.badlogic.gdx.Gdx;\r
import com.badlogic.gdx.InputProcessor;\r
-import com.badlogic.gdx.RenderListener;\r
-import com.badlogic.gdx.backends.desktop.LwjglApplication;\r
+import com.badlogic.gdx.Files.FileType;\r
+import com.badlogic.gdx.backends.desktop.LwjglApplicationNew;\r
import com.badlogic.gdx.graphics.BitmapFont;\r
import com.badlogic.gdx.graphics.Color;\r
import com.badlogic.gdx.graphics.GL10;\r
import com.badlogic.gdx.graphics.SpriteBatch;\r
import com.badlogic.gdx.graphics.Texture.TextureFilter;\r
import com.badlogic.gdx.graphics.Texture.TextureWrap;\r
-import com.badlogic.gdx.math.Matrix4;\r
import com.badlogic.gdx.utils.GdxRuntimeException;\r
\r
public class ParticleEditor extends JFrame {\r
- LwjglApplication app;\r
+ LwjglApplicationNew app;\r
Canvas glCanvas;\r
JPanel rowsPanel;\r
EffectPanel effectPanel;\r
\r
public final void addNotify () {\r
super.addNotify();\r
- app = new LwjglApplication("ParticleEditor", 200, 200, false) {\r
- protected void setupDisplay () throws LWJGLException {\r
- try {\r
- Display.setParent(glCanvas);\r
- } catch (LWJGLException ex) {\r
- throw new GdxRuntimeException("Error setting display parent.", ex);\r
- }\r
- super.setupDisplay();\r
- }\r
- };\r
- app.getGraphics().setRenderListener(new Renderer());\r
+ app = new LwjglApplicationNew(new Renderer(),"ParticleEditor", 200, 200, false, glCanvas); \r
addWindowListener(new WindowAdapter() {\r
public void windowClosed (WindowEvent event) {\r
app.stop();\r
splitPane.setDividerLocation(325);\r
}\r
\r
- class Renderer implements RenderListener, InputProcessor {\r
+ class Renderer implements ApplicationListener, InputProcessor {\r
private float maxActiveTimer;\r
private int maxActive, lastMaxActive;\r
private boolean mouseDown;\r
private SpriteBatch spriteBatch;\r
private Sprite bgImage; // BOZO - Add setting background image to UI.\r
\r
- public void created () {\r
+ public void create () {\r
if (spriteBatch != null) return;\r
spriteBatch = new SpriteBatch();\r
\r
effectPanel.newEmitter("Untitled", true);\r
// if (resources.openFile("/editor-bg.png") != null) bgImage = new Image(gl, "/editor-bg.png");\r
\r
- Gdx.input.addInputListener(this);\r
- }\r
-\r
- public void resized (int width, int height) {\r
int viewWidth = Gdx.graphics.getWidth();\r
int viewHeight = Gdx.graphics.getHeight();\r
\r
\r
// gl.drawLine((int)(viewWidth * getCurrentParticles().getPercentComplete()), viewHeight - 1, viewWidth, viewHeight -\r
// 1);\r
+ Gdx.input.processEvents(this);\r
}\r
}\r
\r
\r
public void dispose () {\r
}\r
+\r
+\r
+ @Override\r
+ public void destroy() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void pause() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void resume() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
}\r
\r
static class ParticleData {\r
public class TextAreaTest extends AndroidApplication {\r
public void onCreate (Bundle bundle) {\r
super.onCreate(bundle);\r
- initialize(false);\r
- getGraphics().setRenderListener(new com.badlogic.gdx.twl.tests.TextAreaTest());\r
+ initialize(new com.badlogic.gdx.twl.tests.TextAreaTest(), false); \r
}\r
}\r
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>\r
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>\r
<classpathentry combineaccessrules="false" kind="src" path="/gdx-twl"/>\r
- <classpathentry combineaccessrules="false" kind="src" path="/gdx-backend-desktop"/>\r
+ <classpathentry combineaccessrules="false" kind="src" path="/gdx-backend-jogl"/>\r
<classpathentry kind="output" path="bin"/>\r
</classpath>\r
\r
package com.badlogic.gdx.twl.tests;\r
\r
-import com.badlogic.gdx.Files.FileType;\r
+import com.badlogic.gdx.ApplicationListener;\r
import com.badlogic.gdx.Gdx;\r
-import com.badlogic.gdx.RenderListener;\r
+import com.badlogic.gdx.Files.FileType;\r
import com.badlogic.gdx.graphics.GL10;\r
+import com.badlogic.gdx.twl.renderer.TwlInputListener;\r
import com.badlogic.gdx.twl.renderer.TwlRenderer;\r
\r
import de.matthiasmann.twl.Button;\r
import de.matthiasmann.twl.DialogLayout;\r
import de.matthiasmann.twl.FPSCounter;\r
import de.matthiasmann.twl.GUI;\r
-import de.matthiasmann.twl.ScrollPane;\r
-import de.matthiasmann.twl.TextArea;\r
-import de.matthiasmann.twl.Timer;\r
-import de.matthiasmann.twl.textarea.HTMLTextAreaModel;\r
-import de.matthiasmann.twl.textarea.Style;\r
-import de.matthiasmann.twl.textarea.StyleAttribute;\r
-import de.matthiasmann.twl.textarea.TextAreaModel.Element;\r
-import de.matthiasmann.twl.textarea.Value;\r
-\r
-public class ButtonTest implements RenderListener {\r
- GUI gui;\r
-\r
- public void created () {\r
+\r
+public class ButtonTest implements ApplicationListener {\r
+ GUI gui; \r
+ TwlInputListener guiInputListener;\r
+\r
+ public void create () {\r
if (gui != null) return;\r
\r
Button button = new Button("Click Me");\r
layout.setVerticalGroup(layout.createSequentialGroup().addWidget(button).addGap(5).addWidget(fpsCounter).addGap(5));\r
\r
gui = TwlRenderer.createGUI(layout, "data/widgets.xml", FileType.Internal);\r
+ gui.setSize(Gdx.graphics.getWidth(), Gdx.graphics.getHeight());\r
+ guiInputListener = new TwlInputListener(gui);\r
}\r
\r
public void render () {\r
- Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r
- gui.update();\r
- }\r
-\r
- public void resized (int width, int height) {\r
- gui.setSize();\r
+ Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT); \r
+ \r
+ Gdx.input.processEvents(guiInputListener);\r
+ gui.update(); \r
}\r
\r
public void dispose () {\r
gui.destroy();\r
+ } \r
+\r
+ @Override\r
+ public void destroy() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void pause() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void resume() {\r
+ // TODO Auto-generated method stub\r
+ \r
}\r
}\r
\r
package com.badlogic.gdx.twl.tests;\r
\r
-import com.badlogic.gdx.backends.desktop.JoglApplication;\r
+import com.badlogic.gdx.backends.jogl.JoglApplication;\r
\r
public class ButtonTestDesktop {\r
public static void main (String[] argv) {\r
- JoglApplication app = new JoglApplication("Button Test", 480, 320, false);\r
- app.getGraphics().setRenderListener(new ButtonTest());\r
+ new JoglApplication(new ButtonTest(), "Button Test", 480, 320, false);\r
}\r
}\r
\r
package com.badlogic.gdx.twl.tests;\r
\r
-import com.badlogic.gdx.Files.FileType;\r
+import com.badlogic.gdx.ApplicationListener;\r
import com.badlogic.gdx.Gdx;\r
-import com.badlogic.gdx.RenderListener;\r
+import com.badlogic.gdx.Files.FileType;\r
import com.badlogic.gdx.graphics.GL10;\r
+import com.badlogic.gdx.twl.renderer.TwlInputListener;\r
import com.badlogic.gdx.twl.renderer.TwlRenderer;\r
\r
import de.matthiasmann.twl.DialogLayout;\r
import de.matthiasmann.twl.textarea.HTMLTextAreaModel;\r
import de.matthiasmann.twl.textarea.Style;\r
import de.matthiasmann.twl.textarea.StyleAttribute;\r
-import de.matthiasmann.twl.textarea.TextAreaModel.Element;\r
import de.matthiasmann.twl.textarea.Value;\r
+import de.matthiasmann.twl.textarea.TextAreaModel.Element;\r
\r
-public class TextAreaTest implements RenderListener {\r
+public class TextAreaTest implements ApplicationListener {\r
GUI gui;\r
+ TwlInputListener guiInputListener;\r
\r
- public void created () {\r
+ public void create () {\r
if (gui != null) return;\r
\r
final HTMLTextAreaModel htmlText = new HTMLTextAreaModel();\r
speed = -speed;\r
}\r
});\r
+ \r
+ TwlRenderer.updateSize(gui);\r
+ guiInputListener = new TwlInputListener(gui);\r
}\r
\r
public void render () {\r
Gdx.gl.glClear(GL10.GL_COLOR_BUFFER_BIT);\r
+ Gdx.input.processEvents(guiInputListener);\r
gui.update();\r
}\r
\r
- public void resized (int width, int height) {\r
- TwlRenderer.updateSize(gui);\r
+ public void destroy () {\r
+ gui.destroy();\r
}\r
\r
- public void dispose () {\r
- gui.destroy();\r
+ @Override\r
+ public void pause() {\r
+ // TODO Auto-generated method stub\r
+ \r
+ }\r
+\r
+ @Override\r
+ public void resume() {\r
+ // TODO Auto-generated method stub\r
+ \r
}\r
}\r
\r
package com.badlogic.gdx.twl.tests;\r
\r
-import com.badlogic.gdx.backends.desktop.JoglApplication;\r
+import com.badlogic.gdx.backends.jogl.JoglApplication;\r
\r
public class TextAreaTestDesktop {\r
public static void main (String[] argv) {\r
- JoglApplication app = new JoglApplication("Twl Test", 480, 320, false);\r
- app.getGraphics().setRenderListener(new TextAreaTest());\r
+ new JoglApplication(new TextAreaTest(), "Twl Test", 480, 320, false); \r
}\r
}\r
package com.badlogic.gdx.twl.renderer;\r
\r
import com.badlogic.gdx.InputProcessor;\r
-import com.badlogic.gdx.RenderListener;\r
\r
import de.matthiasmann.twl.GUI;\r
\r
gui.applyTheme(ThemeManager.createThemeManager(themeURL, renderer));\r
} catch (IOException ex) {\r
throw new GdxRuntimeException("Error loading theme: " + themeFile, ex);\r
- }\r
- Gdx.input.addInputListener(new TwlInputListener(gui));\r
+ } \r
return gui;\r
}\r
}\r
import javax.swing.JScrollPane;\r
import javax.swing.ListSelectionModel;\r
\r
-import com.badlogic.gdx.backends.desktop.LwjglApplication;\r
+import com.badlogic.gdx.backends.desktop.LwjglApplicationNew;\r
import com.badlogic.gdx.tests.utils.GdxTest;\r
import com.badlogic.gdx.tests.utils.GdxTests;\r
\r
@Override public void actionPerformed (ActionEvent e) {\r
String testName = (String)list.getSelectedValue();\r
GdxTest test = GdxTests.newTest(testName);\r
- LwjglApplication app = new LwjglApplication(testName, 480, 320, test.needsGL20());\r
- app.getGraphics().setRenderListener(test);\r
+ new LwjglApplicationNew(test,testName, 480, 320, test.needsGL20()); \r
}\r
});\r
\r