Skip to content

Commit

Permalink
gdx-controllers
Browse files Browse the repository at this point in the history
  • Loading branch information
NathanSweet committed Jan 3, 2013
1 parent 99556bd commit 4471af2
Show file tree
Hide file tree
Showing 11 changed files with 853 additions and 8 deletions.
19 changes: 11 additions & 8 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
# per project ignores, it's cumbersome, but reduces the risk of missing something

# target directories:
backends/gdx-backend-android/target/
backends/gdx-backends-gwt/target/
extensions/gdx-audio/target/
extensions/gdx-freetype/target/
extensions/gdx-image/target/
extensions/gdx-tiled-preprocessor/target/
extensions/gdx-tools/target/
extensions/gdx-bullet/target/
/backends/gdx-backend-android/target/
/backends/gdx-backends-gwt/target/
/extensions/gdx-audio/target/
/extensions/gdx-freetype/target/
/extensions/gdx-image/target/
/extensions/gdx-tiled-preprocessor/target/
/extensions/gdx-tools/target/
/extensions/gdx-bullet/target/

/backends/gdx-backend-android/bin
/backends/gdx-backend-iosmonotouch/bin
Expand Down Expand Up @@ -165,6 +165,9 @@ extensions/gdx-bullet/target/
/extensions/model-loaders/model-loaders-android/gen
/extensions/model-loaders/model-loaders/bin

/extensions/gdx-controllers/gdx-controllers/bin
/extensions/gdx-controllers/gdx-controllers-desktop/bin

/gdx/target
/gdx/obj
/gdx/bin
Expand Down
8 changes: 8 additions & 0 deletions extensions/gdx-controllers/gdx-controllers-desktop/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/gdx"/>
<classpathentry combineaccessrules="false" exported="true" kind="src" path="/gdx-backend-lwjgl"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions extensions/gdx-controllers/gdx-controllers-desktop/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gdx-controllers-desktop</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
eclipse.preferences.version=1
formatter_profile=_libgdx
formatter_settings_version=12
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

package com.badlogic.gdx.controllers;

import com.badlogic.gdx.ApplicationAdapter;
import com.badlogic.gdx.backends.lwjgl.LwjglFrame;
import com.badlogic.gdx.utils.GdxRuntimeException;

import java.lang.reflect.Field;
import java.lang.reflect.Method;

import org.lwjgl.opengl.Display;

public class DesktopControllers {
public static void main (String[] args) throws Exception {
new LwjglFrame(new ApplicationAdapter() {
public void create () {
System.out.println(getWindowHandle());
}

long getWindowHandle () {
try {
Method getImplementation = Display.class.getDeclaredMethod("getImplementation", new Class[0]);
getImplementation.setAccessible(true);
Object display = getImplementation.invoke(null, (Object[])null);
String fieldName = System.getProperty("os.name").toLowerCase().contains("windows") ? "hwnd" : "parent_window";
Field field = display.getClass().getDeclaredField(fieldName);
field.setAccessible(true);
return (Long)field.get(display);
} catch (Exception ex) {
throw new GdxRuntimeException("Unable to get window handle.", ex);
}
}
}, "meow", 200, 200, true);
}
}
7 changes: 7 additions & 0 deletions extensions/gdx-controllers/gdx-controllers/.classpath
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry excluding="**/.svn/*" kind="src" path="src"/>
<classpathentry combineaccessrules="false" kind="src" path="/gdx"/>
<classpathentry kind="output" path="bin"/>
</classpath>
17 changes: 17 additions & 0 deletions extensions/gdx-controllers/gdx-controllers/.project
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>gdx-controllers</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
</natures>
</projectDescription>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#Fri Apr 29 13:59:56 CEST 2011
eclipse.preferences.version=1
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/CPATH/delimiter=;
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/CPATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/CPLUS_INCLUDE_PATH/delimiter=;
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/CPLUS_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/C_INCLUDE_PATH/delimiter=;
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/C_INCLUDE_PATH/operation=remove
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/append=true
environment/buildEnvironmentInclude/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/appendContributed=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/LIBRARY_PATH/delimiter=;
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/LIBRARY_PATH/operation=remove
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/append=true
environment/buildEnvironmentLibrary/cdt.managedbuild.config.gnu.mingw.so.debug.1412059085/appendContributed=true
Loading

0 comments on commit 4471af2

Please sign in to comment.