Difference between revisions of "Main Page"
(Setting Bigger Heap (Memory) Size for Applets Via HTML) |
(→Code Snippets) |
||
Line 46: | Line 46: | ||
− | + | Setting non-standard Applet heap size in html: | |
Just add <param name="java_arguments" value="-Xmx256m"> where 256m can be the size in MB of your heap. Ex.: | Just add <param name="java_arguments" value="-Xmx256m"> where 256m can be the size in MB of your heap. Ex.: | ||
Line 52: | Line 52: | ||
<param name="java_arguments" value="-Xmx256m"> | <param name="java_arguments" value="-Xmx256m"> | ||
</APPLET> | </APPLET> | ||
+ | |||
+ | Initializing the lwjgl joystick: | ||
+ | Controllers controllers = new Controllers(); | ||
+ | try { | ||
+ | controllers.create(); | ||
+ | if (controllers.getControllerCount() > 0) { | ||
+ | joystick = controllers.getController(0); | ||
+ | System.out.println("Joystick has "+joystick.getButtonCount() +" buttons. Its name is "+joystick.getName()); | ||
+ | } | ||
+ | else joystick = null; | ||
+ | } | ||
+ | catch (org.lwjgl.LWJGLException e) {System.err.println("Couldn't initialize Controllers: "+e.getMessage());} | ||
+ | |||
+ | Using the lwjgl joystick: | ||
+ | Inside the main applet loop: | ||
+ | if (joystick != null) { | ||
+ | joystick.poll(); | ||
+ | rotateZ += joystick.getXAxisValue()/2f; | ||
+ | if (joystick.isButtonPressed(0)) | ||
+ | ;//DO SOMETHING | ||
+ | } |
Revision as of 08:43, 24 April 2009
The jPCT wiki
jPCT is a free, small, fast and easy to learn 3D engine for Java. It offers support for software and hardware rendering. This Wiki should help people with tutorials, instructions and samples. If you think that you have something to contribute, just create an account and go for it...
jPCT ressources
Installation
How to start
Advanced topics
Setting non-standard Applet heap size in html:
Just add <param name="java_arguments" value="-Xmx256m"> where 256m can be the size in MB of your heap. Ex.:
<APPLET archive="MyApplet.jar" code="MyApplet" width="640" height="320"> <param name="java_arguments" value="-Xmx256m"> </APPLET>
Initializing the lwjgl joystick: Controllers controllers = new Controllers(); try {
controllers.create(); if (controllers.getControllerCount() > 0) {
joystick = controllers.getController(0); System.out.println("Joystick has "+joystick.getButtonCount() +" buttons. Its name is "+joystick.getName());
} else joystick = null;
} catch (org.lwjgl.LWJGLException e) {System.err.println("Couldn't initialize Controllers: "+e.getMessage());}
Using the lwjgl joystick: Inside the main applet loop: if (joystick != null) { joystick.poll(); rotateZ += joystick.getXAxisValue()/2f; if (joystick.isButtonPressed(0)) ;//DO SOMETHING }