forked from libgdx/libgdx
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
99556bd
commit 4471af2
Showing
11 changed files
with
853 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
extensions/gdx-controllers/gdx-controllers-desktop/.classpath
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
17
extensions/gdx-controllers/gdx-controllers-desktop/.project
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
369 changes: 369 additions & 0 deletions
369
extensions/gdx-controllers/gdx-controllers-desktop/.settings/org.eclipse.jdt.core.prefs
Large diffs are not rendered by default.
Oops, something went wrong.
3 changes: 3 additions & 0 deletions
3
extensions/gdx-controllers/gdx-controllers-desktop/.settings/org.eclipse.jdt.ui.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
35 changes: 35 additions & 0 deletions
35
...trollers/gdx-controllers-desktop/src/com/badlogic/gdx/controllers/DesktopControllers.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
14 changes: 14 additions & 0 deletions
14
...sions/gdx-controllers/gdx-controllers/.settings/org.eclipse.cdt.managedbuilder.core.prefs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Oops, something went wrong.