You can subscribe to this list here.
2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Luke H. <lh...@us...> - 2002-11-26 06:03:46
|
Update of /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson06 In directory sc8-pr-cvs1:/tmp/cvs-serv10704 Modified Files: Lesson6.java Texture.java Log Message: Minor changes Index: Lesson6.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/nehe/lesson06/Lesson6.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson06/Lesson6.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Lesson6.java 26 Nov 2002 05:45:40 -0000 1.2 +++ Lesson6.java 26 Nov 2002 06:03:44 -0000 1.3 @@ -225,11 +225,11 @@ gl.end(); /* rotate 15pps on the X Axis */ - xrot += frameTime * 15f ; + xrot += frameTime * 30f ; /* rotate 20pps on the Y Axis */ yrot += frameTime * 20f; /* rotate 10pps on the Z Axis */ - zrot += frameTime * 10f; + zrot += frameTime * 40f; return true; } Index: Texture.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/nehe/lesson06/Texture.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson06/Texture.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Texture.java 25 Nov 2002 06:24:09 -0000 1.1 +++ Texture.java 26 Nov 2002 06:03:44 -0000 1.2 @@ -29,6 +29,8 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +package lesson06; + import java.nio.*; import java.awt.image.*; import java.awt.geom.*; |
From: Luke H. <lh...@us...> - 2002-11-26 05:56:04
|
Update of /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson04 In directory sc8-pr-cvs1:/tmp/cvs-serv7149 Modified Files: Lesson4.java Log Message: Extends Lesson1 Index: Lesson4.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/nehe/lesson04/Lesson4.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson04/Lesson4.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Lesson4.java 25 Nov 2002 06:24:09 -0000 1.1 +++ Lesson4.java 26 Nov 2002 05:56:01 -0000 1.2 @@ -29,10 +29,14 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +package lesson04; + import org.lwjgl.*; import org.lwjgl.opengl.*; import org.lwjgl.input.*; +import lesson01.Lesson1; + /** * $Id$ * @@ -43,13 +47,7 @@ * @author Luke Holden * @version $Revision$ */ -public class Lesson4 { - private GL gl; - private GLU glu; - - private boolean done = false; - private boolean fullscreen = true; - +public class Lesson4 extends Lesson1 { /* Angle For The Triangle */ float rtri; // (new) /* Angle For The Quad */ @@ -60,45 +58,8 @@ } - private void resizeGLScene(int width, int height) { - /* Reset The Current Viewport */ - gl.viewport(0, 0, width, height); - /* Select The Projection Matrix */ - - gl.matrixMode(GL.PROJECTION); - /* Reset The Projection Matrix */ - gl.loadIdentity(); - - /* Calculate The Aspect Ratio Of The Window */ - glu.perspective(45.0f, ((float) Display.getWidth()) / ((float) Display.getHeight()), 0.1f, 100.0f); - - /* Select The Modelview Matrix */ - gl.matrixMode(GL.MODELVIEW); - /* Reset The Modelview Matrix */ - gl.loadIdentity(); - } - private boolean initGL() { - - /* Enables Smooth Shading */ - gl.shadeModel(GL.SMOOTH); - - /* Black Background */ - gl.clearColor(0.0f, 0.0f, 0.0f, 0.0f); - - /* Depth Buffer Setup */ - gl.clearDepth(1.0f); - /* Enables Depth Testing */ - gl.enable(GL.DEPTH_TEST); - /* The Type Of Depth Test To Do */ - gl.depthFunc(GL.LEQUAL); - - /* Really Nice Perspective Calculations */ - gl.hint(GL.PERSPECTIVE_CORRECTION_HINT, GL.NICEST); - return true; - } - - private boolean drawGLScene() { + protected boolean drawGLScene(float frameTime) { /* Clear The Screen And The Depth Buffer */ gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); @@ -140,65 +101,13 @@ gl.vertex3f(-1.0f,-1.0f, 0.0f); gl.end(); - /* Increase The Rotation Variable For The Triangle */ - rtri+=0.2f; // (new) - /* Decrease The Rotation Variable For The Quad */ - rquad-=0.15f; // (new) + + /* Rotate triangle 20 pps ( NEW ) */ + rtri += frameTime * 20f; + /* Rotate Quad 15 pps ( NEW ) */ + rquad -= frameTime * 15f; return true; - } - - public void killGLWindow() { - Keyboard.destroy(); - gl.destroy(); - Display.destroy(); - } - - public void createGLWindow(int width, int height, int bits, boolean fullscreenflag) throws Exception { - fullscreen = fullscreenflag; - try { - Display.create(new DisplayMode(width, height, bits, 60), fullscreenflag); - gl = new GL(bits, 0, bits, 8); - gl.create(); - glu = new GLU(gl); - Keyboard.create(); - Keyboard.enableBuffer(); - - resizeGLScene(Display.getWidth(), Display.getHeight()); - - initGL(); - } - catch (Exception e) { - throw new Exception("Problem initialising Lesson", e); - } - } - - public void start() throws Exception { - try { - createGLWindow(640, 480, 16, fullscreen); - - while (!done) { - loop(); - } - killGLWindow(); - } - catch (Exception e) { - throw new Exception("Problem starting loop", e); - } - } - - private void loop() { - drawGLScene(); - gl.swapBuffers(); - - /* Keys that have a toggle effect */ - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) { - done = true; - } - } } public static void main(String[] arguments) { |
From: Luke H. <lh...@us...> - 2002-11-26 05:52:01
|
Update of /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson03 In directory sc8-pr-cvs1:/tmp/cvs-serv5478 Modified Files: Lesson3.java Log Message: extends Lesson01 Index: Lesson3.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/nehe/lesson03/Lesson3.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson03/Lesson3.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Lesson3.java 25 Nov 2002 06:24:09 -0000 1.1 +++ Lesson3.java 26 Nov 2002 05:51:58 -0000 1.2 @@ -29,10 +29,14 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +package lesson03; + import org.lwjgl.*; import org.lwjgl.opengl.*; import org.lwjgl.input.*; +import lesson01.Lesson1; + /** * $Id$ * @@ -43,57 +47,13 @@ * @author Luke Holden * @version $Revision$ */ -public class Lesson3 { - private GL gl; - private GLU glu; - - private boolean done = false; - private boolean fullscreen = true; - +public class Lesson3 extends Lesson1 { /** Creates a new instance of Lesson */ public Lesson3() { } - private void resizeGLScene(int width, int height) { - /* Reset The Current Viewport */ - gl.viewport(0, 0, width, height); - /* Select The Projection Matrix */ - - gl.matrixMode(GL.PROJECTION); - /* Reset The Projection Matrix */ - gl.loadIdentity(); - - /* Calculate The Aspect Ratio Of The Window */ - glu.perspective(45.0f, ((float) Display.getWidth()) / ((float) Display.getHeight()), 0.1f, 100.0f); - - /* Select The Modelview Matrix */ - gl.matrixMode(GL.MODELVIEW); - /* Reset The Modelview Matrix */ - gl.loadIdentity(); - } - - private boolean initGL() { - - /* Enables Smooth Shading */ - gl.shadeModel(GL.SMOOTH); - - /* Black Background */ - gl.clearColor(0.0f, 0.0f, 0.0f, 0.0f); - - /* Depth Buffer Setup */ - gl.clearDepth(1.0f); - /* Enables Depth Testing */ - gl.enable(GL.DEPTH_TEST); - /* The Type Of Depth Test To Do */ - gl.depthFunc(GL.LEQUAL); - - /* Really Nice Perspective Calculations */ - gl.hint(GL.PERSPECTIVE_CORRECTION_HINT, GL.NICEST); - return true; - } - - private boolean drawGLScene() { + protected boolean drawGLScene(float frameTime) { /* Clear The Screen And The Depth Buffer */ gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); /* Reset The Current Modelview Matrix */ @@ -132,59 +92,6 @@ gl.end(); return true; - } - - public void killGLWindow() { - Keyboard.destroy(); - gl.destroy(); - Display.destroy(); - } - - public void createGLWindow(int width, int height, int bits, boolean fullscreenflag) throws Exception { - fullscreen = fullscreenflag; - try { - Display.create(new DisplayMode(width, height, bits, 60), fullscreenflag); - gl = new GL(bits, 0, bits, 8); - gl.create(); - glu = new GLU(gl); - Keyboard.create(); - Keyboard.enableBuffer(); - - resizeGLScene(Display.getWidth(), Display.getHeight()); - - initGL(); - } - catch (Exception e) { - throw new Exception("Problem initialising Lesson", e); - } - } - - public void start() throws Exception { - try { - createGLWindow(640, 480, 16, fullscreen); - - while (!done) { - loop(); - } - killGLWindow(); - } - catch (Exception e) { - throw new Exception("Problem starting loop", e); - } - } - - private void loop() { - drawGLScene(); - gl.swapBuffers(); - - /* Keys that have a toggle effect */ - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) { - done = true; - } - } } public static void main(String[] arguments) { |
From: Luke H. <lh...@us...> - 2002-11-26 05:49:29
|
Update of /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson02 In directory sc8-pr-cvs1:/tmp/cvs-serv4280 Modified Files: Lesson2.java Log Message: now extends lesson01.Lesson1 Index: Lesson2.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/nehe/lesson02/Lesson2.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson02/Lesson2.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Lesson2.java 25 Nov 2002 06:24:09 -0000 1.1 +++ Lesson2.java 26 Nov 2002 05:49:25 -0000 1.2 @@ -29,11 +29,14 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +package lesson02; import org.lwjgl.*; import org.lwjgl.opengl.*; import org.lwjgl.input.*; +import lesson01.Lesson1; + /** * $Id$ * @@ -44,57 +47,13 @@ * @author Luke Holden * @version $Revision$ */ -public class Lesson2 { - private GL gl; - private GLU glu; - - private boolean done = false; - private boolean fullscreen = true; - +public class Lesson2 extends Lesson1 { /** Creates a new instance of Lesson */ public Lesson2(){ } - private void resizeGLScene(int width, int height) { - /* Reset The Current Viewport */ - gl.viewport(0, 0, width, height); - /* Select The Projection Matrix */ - - gl.matrixMode(GL.PROJECTION); - /* Reset The Projection Matrix */ - gl.loadIdentity(); - - /* Calculate The Aspect Ratio Of The Window */ - glu.perspective(45.0f, ((float) Display.getWidth()) / ((float) Display.getHeight()), 0.1f, 100.0f); - - /* Select The Modelview Matrix */ - gl.matrixMode(GL.MODELVIEW); - /* Reset The Modelview Matrix */ - gl.loadIdentity(); - } - - private boolean initGL() { - - /* Enables Smooth Shading */ - gl.shadeModel(GL.SMOOTH); - - /* Black Background */ - gl.clearColor(0.0f, 0.0f, 0.0f, 0.0f); - - /* Depth Buffer Setup */ - gl.clearDepth(1.0f); - /* Enables Depth Testing */ - gl.enable(GL.DEPTH_TEST); - /* The Type Of Depth Test To Do */ - gl.depthFunc(GL.LEQUAL); - - /* Really Nice Perspective Calculations */ - gl.hint(GL.PERSPECTIVE_CORRECTION_HINT, GL.NICEST); - return true; - } - - private boolean drawGLScene() { + protected boolean drawGLScene(float frameTime) { /* Clear The Screen And The Depth Buffer */ gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); /* Reset The Current Modelview Matrix */ @@ -130,60 +89,7 @@ return true; } - - public void killGLWindow() { - Keyboard.destroy(); - gl.destroy(); - Display.destroy(); - } - - public void createGLWindow(int width, int height, int bits, boolean fullscreenflag) throws Exception { - fullscreen = fullscreenflag; - try { - Display.create(new DisplayMode(width, height, bits, 60), fullscreenflag); - gl = new GL(bits, 0, bits, 8); - gl.create(); - glu = new GLU(gl); - Keyboard.create(); - Keyboard.enableBuffer(); - - resizeGLScene(Display.getWidth(), Display.getHeight()); - - initGL(); - } - catch (Exception e) { - throw new Exception("Problem initialising Lesson", e); - } - } - - public void start() throws Exception { - try { - createGLWindow(640, 480, 16, fullscreen); - - while (!done) { - loop(); - } - killGLWindow(); - } - catch (Exception e) { - throw new Exception("Problem starting loop", e); - } - } - - private void loop() { - drawGLScene(); - gl.swapBuffers(); - - /* Keys that have a toggle effect */ - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) { - done = true; - } - } - } - + public static void main(String[] arguments) { int err = 0; Lesson2 lesson = new Lesson2(); |
From: Luke H. <lh...@us...> - 2002-11-26 05:45:43
|
Update of /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson06 In directory sc8-pr-cvs1:/tmp/cvs-serv2851 Modified Files: Lesson6.java Log Message: Now extends Lesson1 Index: Lesson6.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/nehe/lesson06/Lesson6.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson06/Lesson6.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Lesson6.java 25 Nov 2002 06:24:09 -0000 1.1 +++ Lesson6.java 26 Nov 2002 05:45:40 -0000 1.2 @@ -29,6 +29,8 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +package lesson06; + import java.nio.*; import java.io.*; import java.awt.image.BufferedImage; @@ -38,6 +40,8 @@ import org.lwjgl.opengl.*; import org.lwjgl.input.*; +import lesson01.Lesson1; + /** * $Id$ * @@ -48,18 +52,12 @@ * @author Luke Holden * @version $Revision$ */ -public class Lesson6 { - private GL gl; - private GLU glu; - - private boolean done = false; - private boolean fullscreen = true; - +public class Lesson6 extends Lesson1 { private float xrot; private float yrot; private float zrot; - IntBuffer textureBuf = createIntBuffer(1); + private IntBuffer textureBuf = createIntBuffer(1); /** Creates a new instance of Lesson */ public Lesson6() { @@ -67,7 +65,7 @@ } /* A javafied version of AUX_RGBImageRec *LoadBMP(char*); */ - private Texture loadImage(String filename) throws Exception { + public Texture loadImage(String filename) throws Exception { Texture texture = null; BufferedImage tmpImg = null; @@ -131,54 +129,26 @@ } } + - private void resizeGLScene(int width, int height) { - /* Reset The Current Viewport */ - gl.viewport(0, 0, width, height); - /* Select The Projection Matrix */ - - gl.matrixMode(GL.PROJECTION); - /* Reset The Projection Matrix */ - gl.loadIdentity(); - - /* Calculate The Aspect Ratio Of The Window */ - glu.perspective(45.0f, ((float) Display.getWidth()) / ((float) Display.getHeight()), 0.1f, 100.0f); - - /* Select The Modelview Matrix */ - gl.matrixMode(GL.MODELVIEW); - /* Reset The Modelview Matrix */ - gl.loadIdentity(); - } - - private void initGL() throws Exception { - /* Jump To Texture Loading Routine */ + protected void initGL() throws Exception { try { + /* load our textures into memory ( NEW ) */ loadGLTextures(); - /* Enable Texture Mapping ( NEW ) */ gl.enable(GL.TEXTURE_2D); - /* Enables Smooth Shading */ - gl.shadeModel(GL.SMOOTH); - /* Black Background */ - gl.clearColor(0.0f, 0.0f, 0.0f, 0.5f); - /* Depth Buffer Setup */ - gl.clearDepth(1.0f); - /* Enables Depth Testing */ - gl.enable(GL.DEPTH_TEST); - /* The Type Of Depth Test To Do */ - gl.depthFunc(GL.LEQUAL); - /* Really Nice Perspective Calculations */ - gl.hint(GL.PERSPECTIVE_CORRECTION_HINT, GL.NICEST); + /* Call parent to finish setting up GL */ + super.initGL(); } catch (Exception e) { throw new Exception("Problem initialising GL", e); } } - private boolean drawGLScene() { + protected boolean drawGLScene(float frameTime) { /* Clear The Screen And The Depth Buffer */ gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); - + /* Reset The Current Modelview Matrix */ gl.loadIdentity(); /* Move Into The Screen 5 Units */ @@ -253,71 +223,18 @@ /* Top Left Of The Texture and Quad */ gl.texCoord2f(0.0f, 1.0f); gl.vertex3f(-1.0f, 1.0f, -1.0f); gl.end(); - - /* X Axis Rotation */ - xrot+=0.3f; - /* Y Axis Rotation */ - yrot+=0.2f; - /* Z Axis Rotation */ - zrot+=0.4f; + + /* rotate 15pps on the X Axis */ + xrot += frameTime * 15f ; + /* rotate 20pps on the Y Axis */ + yrot += frameTime * 20f; + /* rotate 10pps on the Z Axis */ + zrot += frameTime * 10f; return true; } - public void killGLWindow() { - Keyboard.destroy(); - gl.destroy(); - Display.destroy(); - } - - public void createGLWindow(int width, int height, int bits, boolean fullscreenflag) throws Exception { - fullscreen = fullscreenflag; - try { - Display.create(new DisplayMode(width, height, bits, 60), fullscreenflag); - gl = new GL(bits, 0, bits, 8); - gl.create(); - glu = new GLU(gl); - Keyboard.create(); - Keyboard.enableBuffer(); - - resizeGLScene(Display.getWidth(), Display.getHeight()); - - initGL(); - } - catch (Exception e) { - throw new Exception("Problem initialising Lesson", e); - } - } - - public void start() throws Exception { - try { - createGLWindow(640, 480, 16, fullscreen); - - while (!done) { - loop(); - } - killGLWindow(); - } - catch (Exception e) { - throw new Exception("Problem starting loop", e); - } - } - - private void loop() { - drawGLScene(); - gl.swapBuffers(); - - /* Keys that have a toggle effect */ - Keyboard.read(); - for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { - Keyboard.next(); - if (Keyboard.key == Keyboard.KEY_ESCAPE && Keyboard.state) { - done = true; - } - } - } - - private IntBuffer createIntBuffer(int size) { + public IntBuffer createIntBuffer(int size) { ByteBuffer temp = ByteBuffer.allocateDirect(4 * size); temp.order(ByteOrder.nativeOrder()); |
From: Luke H. <lh...@us...> - 2002-11-26 05:44:52
|
Update of /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson01 In directory sc8-pr-cvs1:/tmp/cvs-serv2331 Modified Files: Lesson1.java Log Message: This is now the base class for the other lessons. Now using Sys.getTime() and Sys.setTime() to do our animation in realtime Index: Lesson1.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/examples/nehe/lesson01/Lesson1.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/examples/nehe/lesson01/Lesson1.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Lesson1.java 25 Nov 2002 06:42:45 -0000 1.1 +++ Lesson1.java 26 Nov 2002 05:44:49 -0000 1.2 @@ -29,6 +29,7 @@ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ +package lesson01; import org.lwjgl.*; import org.lwjgl.opengl.*; @@ -45,18 +46,19 @@ * @version $Revision$ */ public class Lesson1 { - private GL gl; - private GLU glu; + protected GL gl; + protected GLU glu; - private boolean done = false; - private boolean fullscreen = true; + protected boolean done = false; + protected boolean fullscreen = true; + protected long timerRes; /** Creates a new instance of Lesson */ public Lesson1() { } - private void resizeGLScene(int width, int height) { + protected void resizeGLScene(int width, int height) { /* Reset The Current Viewport */ gl.viewport(0, 0, width, height); /* Select The Projection Matrix */ @@ -74,30 +76,25 @@ gl.loadIdentity(); } - private void initGL() throws Exception { - try { - /* Enables Smooth Shading */ - gl.shadeModel(GL.SMOOTH); - - /* Black Background */ - gl.clearColor(0.0f, 0.0f, 0.0f, 0.0f); + protected void initGL() throws Exception { + /* Enables Smooth Shading */ + gl.shadeModel(GL.SMOOTH); + + /* Black Background */ + gl.clearColor(0.0f, 0.0f, 0.0f, 0.0f); + + /* Depth Buffer Setup */ + gl.clearDepth(1.0f); + /* Enables Depth Testing */ + gl.enable(GL.DEPTH_TEST); + /* The Type Of Depth Test To Do */ + gl.depthFunc(GL.LEQUAL); - /* Depth Buffer Setup */ - gl.clearDepth(1.0f); - /* Enables Depth Testing */ - gl.enable(GL.DEPTH_TEST); - /* The Type Of Depth Test To Do */ - gl.depthFunc(GL.LEQUAL); - - /* Really Nice Perspective Calculations */ - gl.hint(GL.PERSPECTIVE_CORRECTION_HINT, GL.NICEST); - } - catch (Exception e) { - throw new Exception("Problem initialising GL", e); - } + /* Really Nice Perspective Calculations */ + gl.hint(GL.PERSPECTIVE_CORRECTION_HINT, GL.NICEST); } - private boolean drawGLScene() { + protected boolean drawGLScene(float frameTime) { /* Clear The Screen And The Depth Buffer */ gl.clear(GL.COLOR_BUFFER_BIT | GL.DEPTH_BUFFER_BIT); /* Reset The Current Modelview Matrix */ @@ -105,13 +102,13 @@ return true; } - public void killGLWindow() { + protected void killGLWindow() { Keyboard.destroy(); gl.destroy(); Display.destroy(); } - public void createGLWindow(int width, int height, int bits, boolean fullscreenflag) throws Exception { + protected void createGLWindow(int width, int height, int bits, boolean fullscreenflag) throws Exception { fullscreen = fullscreenflag; try { Display.create(new DisplayMode(width, height, bits, 60), fullscreenflag); @@ -130,13 +127,32 @@ } } - public void start() throws Exception { + protected void start() throws Exception { + long frameTime = 0; + + timerRes = Sys.getTimerResolution(); + if (timerRes == 0) { + throw new Exception("There are no timers availible!"); + } + try { createGLWindow(640, 480, 16, fullscreen); - - while (!done) { - loop(); - } + + do { + /* The frameTime is how much time it takes to draw a single frame. + * We use this so we can animate things in real time. + * + * Say you want to move an object 100 pixels every second and it + * takes 0.10 seconds to draw a frame. Pixels per second + * multiplied by the frame time equals the amount of pixels to move + * per frame. or 100 * 0.10 = 10; */ + frameTime = Sys.getTime(); + /* Reset the counter, so we can find out how long it takes to draw a + * frame */ + Sys.setTime(0); + } + while (!loop((float)frameTime / (float)timerRes)); + killGLWindow(); } catch (Exception e) { @@ -144,10 +160,19 @@ } } - private void loop() { - drawGLScene(); + protected boolean loop(float frameTime) { + /* if drawGLScene(...) fails, stop the loop */ + if (!drawGLScene(frameTime)) { + return true; + } + gl.swapBuffers(); + input(frameTime); + return done; + } + + protected void input(float frameTime) { /* Keys that have a toggle effect */ Keyboard.read(); for (int i = 0; i < Keyboard.getNumKeyboardEvents(); i++) { |
From: Luke H. <lh...@us...> - 2002-11-26 04:58:32
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv21107 Modified Files: org_lwjgl_Sys.cpp Log Message: Removed the native time readout from queryTime(). I think elias_naur was trying to annoy me to death with time updates every 0.001 seconds =) Index: org_lwjgl_Sys.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Sys.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_Sys.cpp 22 Nov 2002 11:35:03 -0000 1.2 +++ org_lwjgl_Sys.cpp 26 Nov 2002 04:58:29 -0000 1.3 @@ -89,9 +89,7 @@ #endif } long result = tv.tv_sec * 1000000l + tv.tv_usec; -#ifdef _DEBUG - printf("Current time (native): %ld\n", result); -#endif + return result; } |
From: Luke H. <lh...@us...> - 2002-11-26 03:30:44
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv20942 Modified Files: org_lwjgl_Display.cpp Log Message: Added a fix for when GLX_ALPHA_SIZE cant be set (I think this happens when display depth is below 24.) There might be a better way to handle this... but this lets lwjgl work for me. =) Index: org_lwjgl_Display.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_Display.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_Display.cpp 20 Nov 2002 13:54:58 -0000 1.3 +++ org_lwjgl_Display.cpp 26 Nov 2002 03:30:41 -0000 1.4 @@ -102,8 +102,26 @@ Colormap cmap; int attribmask; int bpe = bpp/4; - int attriblist[] = {GLX_RGBA, GLX_DOUBLEBUFFER, GLX_DEPTH_SIZE, 24, GLX_RED_SIZE, bpe, GLX_GREEN_SIZE, bpe, GLX_BLUE_SIZE, bpe, GLX_ALPHA_SIZE, bpe, None}; - int num_modes, i; + int attriblist[] = { GLX_RGBA, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, 24, + GLX_RED_SIZE, bpe, + GLX_GREEN_SIZE, bpe, + GLX_BLUE_SIZE, bpe, + GLX_ALPHA_SIZE, bpe, + None }; + int attriblistna[] = { GLX_RGBA, + GLX_DOUBLEBUFFER, + GLX_DEPTH_SIZE, 24, + GLX_RED_SIZE, bpe, + GLX_GREEN_SIZE, bpe, + GLX_BLUE_SIZE, bpe, + None }; + + int num_modes, i; + + + current_fullscreen = fullscreen; current_focused = 0; @@ -125,7 +143,13 @@ root_win = RootWindow(disp, screen); vis_info = glXChooseVisual(disp, screen, attriblist); - if (vis_info == NULL) { + + /* might be a better way to handle not being able to set GLX_ALPHA_SIZE... */ + if (vis_info == NULL) { + vis_info = glXChooseVisual(disp, screen, attriblistna); + } + + if (vis_info == NULL) { XCloseDisplay(disp); #ifdef _DEBUG printf("Could not choose glx visual\n"); |
From: Elias N. <eli...@us...> - 2002-11-25 22:10:14
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv2021 Modified Files: org_lwjgl_input_Keyboard.cpp Log Message: Made Keyboard.poll behave like win32 version Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- org_lwjgl_input_Keyboard.cpp 25 Nov 2002 14:57:13 -0000 1.5 +++ org_lwjgl_input_Keyboard.cpp 25 Nov 2002 22:10:07 -0000 1.6 @@ -194,7 +194,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_input_Keyboard_nPoll (JNIEnv * env, jclass clazz, jint buf) { - checkKeyEvents(NULL); + //checkKeyEvents(NULL); memcpy((unsigned char*)buf, key_buf, KEYBOARD_SIZE*sizeof(unsigned char)); } |
From: Brian M. <ma...@us...> - 2002-11-25 21:50:47
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv24596 Modified Files: extal.h Log Message: fix: <al.h> -> <AL/al.h> Index: extal.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/extal.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- extal.h 30 Aug 2002 21:26:30 -0000 1.1 +++ extal.h 25 Nov 2002 21:50:41 -0000 1.2 @@ -38,8 +38,8 @@ #define OPENAL #include <windows.h> -#include <al.h> -#include <alc.h> +#include <AL/al.h> +#include <AL/alc.h> #include <eax.h> EAXSet eaxSet; // EAXSet function, retrieved if EAX Extension is supported |
From: Elias N. <eli...@us...> - 2002-11-25 20:35:06
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv18085/native/linux Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Dump extension info with debug library Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_opengl_BaseGL.cpp 25 Nov 2002 17:04:56 -0000 1.3 +++ org_lwjgl_opengl_BaseGL.cpp 25 Nov 2002 20:35:01 -0000 1.4 @@ -85,6 +85,10 @@ #endif return JNI_FALSE; } +#ifdef _DEBUG + const GLubyte * extensions = glGetString(GL_EXTENSIONS); + printf("Supported extensions: %s\n", extensions); +#endif return JNI_TRUE; } |
From: Elias N. <eli...@us...> - 2002-11-25 17:04:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv21735/native/linux Modified Files: org_lwjgl_opengl_BaseGL.cpp Log Message: Added releaseContext to BaseGL.java (and native for linux) Index: org_lwjgl_opengl_BaseGL.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_BaseGL.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_opengl_BaseGL.cpp 21 Nov 2002 11:00:40 -0000 1.2 +++ org_lwjgl_opengl_BaseGL.cpp 25 Nov 2002 17:04:56 -0000 1.3 @@ -51,6 +51,10 @@ glXMakeCurrent(disp, win, context); } +void releaseContext(void) { + glXMakeCurrent(disp, None, NULL); +} + /* * Class: org_lwjgl_opengl_BaseGL * Method: nCreate @@ -92,8 +96,7 @@ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nDestroy (JNIEnv * env, jobject obj) { - glXMakeCurrent(disp, None, NULL); - + releaseContext(); // Delete the rendering context if (context != NULL) glXDestroyContext(disp, context); @@ -120,3 +123,13 @@ makeCurrent(); } +/* + * * Class: org_lwjgl_opengl_BaseGL + * * Method: nFreeContext + * * Signature: ()V + * */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nReleaseContext + (JNIEnv *, jobject) +{ + releaseContext(); +} |
From: Elias N. <eli...@us...> - 2002-11-25 17:04:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv21735/native/common Modified Files: org_lwjgl_opengl_BaseGL.h Log Message: Added releaseContext to BaseGL.java (and native for linux) Index: org_lwjgl_opengl_BaseGL.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_BaseGL.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_BaseGL.h,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -u -d -r1.1.1.1 -r1.2 --- org_lwjgl_opengl_BaseGL.h 11 Aug 2002 11:49:35 -0000 1.1.1.1 +++ org_lwjgl_opengl_BaseGL.h 25 Nov 2002 17:04:56 -0000 1.2 @@ -9,7 +9,7 @@ #endif /* Inaccessible static: _00024assertionsDisabled */ /* Inaccessible static: currentContext */ -/* Inaccessible static: class_000240 */ +/* Inaccessible static: class_00024org_00024lwjgl_00024opengl_00024BaseGL */ /* * Class: org_lwjgl_opengl_BaseGL * Method: nCreate @@ -32,6 +32,14 @@ * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_swapBuffers + (JNIEnv *, jobject); + +/* + * Class: org_lwjgl_opengl_BaseGL + * Method: nReleaseContext + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_org_lwjgl_opengl_BaseGL_nReleaseContext (JNIEnv *, jobject); /* |
From: Elias N. <eli...@us...> - 2002-11-25 17:04:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1:/tmp/cvs-serv21735/java/org/lwjgl/opengl Modified Files: BaseGL.java Log Message: Added releaseContext to BaseGL.java (and native for linux) Index: BaseGL.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/BaseGL.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- BaseGL.java 23 Aug 2002 16:14:10 -0000 1.5 +++ BaseGL.java 25 Nov 2002 17:04:56 -0000 1.6 @@ -166,6 +166,16 @@ } /** + * Free the context from the current thread. + */ + public final void releaseContext() { + assert created : "GL has not been created yet."; + renderThread = null; + currentContext = null; + nReleaseContext(); + } + + /** * Make this the current context for the current thread. */ public final void makeCurrent() { @@ -180,6 +190,11 @@ */ public native void swapBuffers(); + /** + * Native method to free the context + */ + private native void nReleaseContext(); + /** * Native method to make this the current thread */ |
From: Elias N. <eli...@us...> - 2002-11-25 15:32:16
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input In directory sc8-pr-cvs1:/tmp/cvs-serv305/org/lwjgl/input Modified Files: Keyboard.java Log Message: Added keycode mapping for enter and tab in Keyboard.java Index: Keyboard.java CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/input/Keyboard.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- Keyboard.java 24 Nov 2002 19:35:00 -0000 1.13 +++ Keyboard.java 25 Nov 2002 15:32:13 -0000 1.14 @@ -191,7 +191,7 @@ '-', '=', 0, - 0, + '\t', 'q', 'w', 'e', @@ -204,7 +204,7 @@ 'p', '[', ']', - 0, + '\n', 0, 'a', 's', @@ -251,7 +251,7 @@ '_', '+', 0, - 0, + '\t', 'Q', 'W', 'E', @@ -264,7 +264,7 @@ 'P', '{', '}', - 0, + '\n', 0, 'A', 'S', |
From: Elias N. <eli...@us...> - 2002-11-25 14:57:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv12574 Modified Files: Makefile org_lwjgl_input_Keyboard.cpp Log Message: Remapped some keys Index: Makefile CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/Makefile =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/Makefile,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- Makefile 25 Nov 2002 13:18:24 -0000 1.12 +++ Makefile 25 Nov 2002 14:57:13 -0000 1.13 @@ -48,7 +48,7 @@ LIBCPPOBJS=$(LIBCPPSRC:.cpp=.o) LIBCOBJS=$(LIBCSRC:.c=.o) LIBOBJS=$(LIBCOBJS) $(LIBCPPOBJS) -#DEBUG_FLAGS=-D_DEBUG +DEBUG_FLAGS=-D_DEBUG LINKOPTS=-L/usr/X11R6/lib -lX11 -lXext -lXxf86vm -lGL -lGLU -lopenal BUILDOPTS=-O3 -Wall Index: org_lwjgl_input_Keyboard.cpp CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/linux/org_lwjgl_input_Keyboard.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- org_lwjgl_input_Keyboard.cpp 21 Nov 2002 15:05:50 -0000 1.4 +++ org_lwjgl_input_Keyboard.cpp 25 Nov 2002 14:57:13 -0000 1.5 @@ -51,6 +51,7 @@ jfieldID fid_readBuffer; jfieldID fid_readBufferAddress; unsigned char key_buf[KEYBOARD_SIZE]; +unsigned char key_map[KEYBOARD_SIZE]; bool keyboard_grabbed; @@ -122,6 +123,26 @@ #endif return JNI_FALSE; } + for (int i = 0; i < KEYBOARD_SIZE; i++) + key_map[i] = i; + key_map[0x6b] = 0xdb; // Left doze key + key_map[0x6c] = 0xdc; // Right doze key + key_map[0x6d] = 0xdd; // Apps key + key_map[0x5a] = 0xc8; // Up arrow + key_map[0x5c] = 0xcb; // Left arrow + key_map[0x5e] = 0xcd; // Right arrow + key_map[0x60] = 0xd0; // Down arrow + key_map[0x59] = 0xc7; // Home + key_map[0x62] = 0xd2; // Insert + key_map[0x63] = 0xd3; // Delete + key_map[0x5f] = 0xcf; // End + key_map[0x5b] = 0xc9; // Page up + key_map[0x61] = 0xd1; // Page down + key_map[0x67] = 0xb7; // SysRQ + key_map[0x66] = 0xc5; // Pause + key_map[0x64] = 0x9c; // Numpad enter + key_map[0x68] = 0xb5; // Numpad divide + memset(key_buf, 0, KEYBOARD_SIZE*sizeof(unsigned char)); return JNI_TRUE; } @@ -147,6 +168,7 @@ while (XCheckMaskEvent(disp, KeyPressMask | KeyReleaseMask, &event)) { count++; unsigned char keycode = (unsigned char)((event.xkey.keycode - 8) & 0xff); + keycode = key_map[keycode]; if (event.type == KeyPress) { state = 1; } else if (event.type == KeyRelease) { |
From: Elias N. <eli...@us...> - 2002-11-25 13:52:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv29923/win32 Removed Files: org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALUT.cpp org_lwjgl_openal_BaseAL.cpp org_lwjgl_openal_CoreAL.cpp org_lwjgl_openal_eax_BaseEAX.cpp org_lwjgl_openal_eax_CoreEAX.cpp org_lwjgl_openal_eax_EAXBufferProperties.cpp org_lwjgl_openal_eax_EAXListenerProperties.cpp Log Message: Moved OpenAL to common --- org_lwjgl_openal_ALC.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALC.cpp --- org_lwjgl_openal_ALUT.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_ALUT.cpp --- org_lwjgl_openal_BaseAL.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_BaseAL.cpp --- org_lwjgl_openal_CoreAL.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_CoreAL.cpp --- org_lwjgl_openal_eax_BaseEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_BaseEAX.cpp --- org_lwjgl_openal_eax_CoreEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_CoreEAX.cpp --- org_lwjgl_openal_eax_EAXBufferProperties.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_EAXBufferProperties.cpp --- org_lwjgl_openal_eax_EAXListenerProperties.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_openal_eax_EAXListenerProperties.cpp |
From: Elias N. <eli...@us...> - 2002-11-25 13:52:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv29923/common Added Files: org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALUT.cpp org_lwjgl_openal_BaseAL.cpp org_lwjgl_openal_CoreAL.cpp org_lwjgl_openal_eax_BaseEAX.cpp org_lwjgl_openal_eax_CoreEAX.cpp org_lwjgl_openal_eax_EAXBufferProperties.cpp org_lwjgl_openal_eax_EAXListenerProperties.cpp Log Message: Moved OpenAL to common --- NEW FILE: org_lwjgl_openal_ALC.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALC.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_openal_ALC.cpp,v 1.1 2002/11/25 13:52:23 elias_naur Exp $ * * This is the actual JNI implementation of the OpenAL context/device library. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_ALC.h" #include "checkALerror.h" /* OpenAL includes */ #include <AL/alc.h> /* * Class: org_lwjgl_openal_ALC * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_nCreate (JNIEnv *env, jobject obj) { return true; } /* * Class: org_lwjgl_openal_ALC * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_nDestroy (JNIEnv *env, jobject obj) { } /** * This function returns strings related to the context. * * C Specification: * ALubyte * alcGetString(ALCdevice *device, ALenum token); */ JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_ALC_getString (JNIEnv *env, jobject obj, jobject device, jint token) { jclass class_device = env->GetObjectClass(device); jfieldID field_device = env->GetFieldID(class_device, "device", "I"); jint deviceaddress = env->GetIntField(device, field_device); const char* alcString = (const char*) alcGetString((ALCdevice*) deviceaddress, (ALenum) token); if(alcString == NULL) { return NULL; } jstring string = env->NewStringUTF(alcString); CHECK_ALC_ERROR return string; } /** * This function returns integers related to the context. * * C Specification: * ALvoid alcGetIntegerv(ALCdevice *device, ALenum token, ALsizei size, ALint *dest); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_getIntegerv (JNIEnv *env, jobject obj, jobject device, jint token, jint size, jint dest) { jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); jint deviceaddress = env->GetIntField(device, device_field); alcGetIntegerv((ALCdevice*) deviceaddress, (ALenum) token, (ALsizei) size, (ALint*) dest); CHECK_ALC_ERROR } /** * This function opens a device by name. * * C Specification: * ALCdevice *alcOpenDevice( const ALubyte *tokstr ); */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_openDevice (JNIEnv *env, jobject obj, jstring tokstr) { ALubyte* tokenstring; if(tokstr != NULL) { tokenstring = (ALubyte*) (env->GetStringUTFChars(tokstr, 0)); } else { tokenstring = NULL; } /* get device */ ALCdevice* device = alcOpenDevice(tokenstring); /* if error - cleanup and get out */ if(device == NULL) { if(tokenstring != NULL) { env->ReleaseStringUTFChars((jstring)tokenstring, 0); } return NULL; } /* get ready to create ALCdevice instance */ jobject alcDevice_object = NULL; jclass alcDevice_class = NULL; jmethodID alcDevice_method = NULL; /* find class and constructor */ alcDevice_class = env->FindClass("org/lwjgl/openal/ALCdevice"); alcDevice_method = env->GetMethodID(alcDevice_class, "<init>", "(I)V"); /* create instance */ alcDevice_object = env->NewObject(alcDevice_class, alcDevice_method, (int) device); /* clean up */ env->ReleaseStringUTFChars((jstring)tokenstring, 0); return alcDevice_object; } /** * This function closes a device by name. * * C Specification: * void alcCloseDevice( ALCdevice *dev ); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_closeDevice (JNIEnv *env, jobject obj, jobject device) { jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); jint deviceaddress = env->GetIntField(device, device_field); alcCloseDevice((ALCdevice*) deviceaddress); CHECK_ALC_ERROR } /** * This function creates a context using a specified device. * * C Specification: * ALCcontext* alcCreateContext( ALCdevice *dev, ALint* attrlist ); */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_createContext (JNIEnv *env, jobject obj, jobject device, jint attrlist) { /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); jint deviceaddress = env->GetIntField(device, device_field); ALCcontext* context = alcCreateContext((ALCdevice*) deviceaddress, (ALint*) attrlist); /* if error - get out */ if(context == NULL) { return NULL; } /* get ready to create ALCcontext instance */ jobject alcContext_object = NULL; jclass alcContext_class = NULL; jmethodID alcContext_method = NULL; /* find class and constructor */ alcContext_class = env->FindClass("org/lwjgl/openal/ALCcontext"); alcContext_method = env->GetMethodID(alcContext_class, "<init>", "(I)V"); /* create instance */ alcContext_object = env->NewObject(alcContext_class, alcContext_method, (int) context); CHECK_ALC_ERROR return alcContext_object; } /** * This function makes a specified context the current context. * * C Specification: * ALCboolean alcMakeContextCurrent(ALCcontext *context); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_makeContextCurrent (JNIEnv *env, jobject obj, jobject context) { if(context == NULL) { return alcMakeContextCurrent(NULL); } /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); jint contextaddress = env->GetIntField(context, context_field); return alcMakeContextCurrent((ALCcontext*) contextaddress); } /** * This function tells a context to begin processing. * * C Specification: * void alcProcessContext(ALCcontext *context); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_processContext (JNIEnv *env, jobject obj, jobject context) { /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); jint contextaddress = env->GetIntField(context, context_field); alcProcessContext((ALCcontext*) contextaddress); } /** * This function retrieves the current context. * * C Specification: * ALCcontext* alcGetCurrentContext( ALvoid ); */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_getCurrentContext (JNIEnv *env, jobject obj) { ALCcontext* context = alcGetCurrentContext(); if(context == NULL) { return NULL; } /* get ready to create ALCcontext instance */ jobject alcContext_object = NULL; jclass alcContext_class = NULL; jmethodID alcContext_method = NULL; /* find class and constructor */ alcContext_class = env->FindClass("org/lwjgl/openal/ALCcontext"); alcContext_method = env->GetMethodID(alcContext_class, "<init>", "(I)V"); /* create instance */ alcContext_object = env->NewObject(alcContext_class, alcContext_method, (int) context); return alcContext_object; } /** * This function retrieves the specified contexts device * * C Specification: * ALCdevice* alcGetContextsDevice(ALCcontext *context); */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALC_getContextsDevice (JNIEnv *env, jobject obj, jobject context) { /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); jint contextaddress = env->GetIntField(context, context_field); ALCdevice* device = alcGetContextsDevice((ALCcontext*) contextaddress); if(device == NULL) { return NULL; } /* get ready to create ALCdevice instance */ jobject alcDevice_object = NULL; jclass alcDevice_class = NULL; jmethodID alcDevice_method = NULL; /* find class and constructor */ alcDevice_class = env->FindClass("org/lwjgl/openal/ALCdevice"); alcDevice_method = env->GetMethodID(alcDevice_class, "<init>", "(I)V"); /* create instance */ alcDevice_object = env->NewObject(alcDevice_class, alcDevice_method, (int) device); return alcDevice_object; } /** * This function suspends processing on a specified context. * * C Specification: * void alcSuspendContext(ALCcontext *context); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_suspendContext (JNIEnv *env, jobject obj, jobject context) { /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); jint contextaddress = env->GetIntField(context, context_field); alcSuspendContext((ALCcontext*) contextaddress); } /** * This function destroys a context. * * C Specification: * void alcDestroyContext(ALCcontext *context); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALC_destroyContext (JNIEnv *env, jobject obj, jobject context) { /* get context address */ jclass context_class = env->GetObjectClass(context); jfieldID context_field = env->GetFieldID(context_class, "context", "I"); jint contextaddress = env->GetIntField(context, context_field); alcDestroyContext((ALCcontext*) contextaddress); } /** * This function retrieves the specified devices context error state. * * C Specification: * ALCenum alcGetError(ALCdevice *device); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_getError (JNIEnv *env, jobject obj, jobject device) { /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); jint deviceaddress = env->GetIntField(device, device_field); jint result = alcGetError((ALCdevice*) deviceaddress); CHECK_ALC_ERROR return result; } /** * This function queries if a specified context extension is available. * * C Specification: * ALboolean alcIsExtensionPresent(ALCdevice *device, ALubyte *extName); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALC_isExtensionPresent (JNIEnv *env, jobject obj, jobject device, jstring extName) { /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); jint deviceaddress = env->GetIntField(device, device_field); /* get extension */ ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(extName, 0)); jboolean result = (jboolean) alcIsExtensionPresent((ALCdevice*) deviceaddress, functionname); env->ReleaseStringUTFChars((jstring)functionname, 0); CHECK_ALC_ERROR return result; } /** * This function retrieves the enum value for a specified enumeration name. * * C Specification: * ALenum alcGetEnumValue(ALCdevice *device, ALubyte *enumName); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_ALC_getEnumValue (JNIEnv *env, jobject obj, jobject device, jstring enumName) { /* get device address */ jclass device_class = env->GetObjectClass(device); jfieldID device_field = env->GetFieldID(device_class, "device", "I"); jint deviceaddress = env->GetIntField(device, device_field); /* get extension */ ALubyte* enumerationname = (ALubyte*) (env->GetStringUTFChars(enumName, 0)); jint result = (jint) alcGetEnumValue((ALCdevice*) deviceaddress, enumerationname); env->ReleaseStringUTFChars((jstring)enumerationname, 0); CHECK_ALC_ERROR return result; } --- NEW FILE: org_lwjgl_openal_ALUT.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_ALUT.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_openal_ALUT.cpp,v 1.1 2002/11/25 13:52:23 elias_naur Exp $ * * This is the actual JNI implementation of the OpenAL utility library. * It handles whatever is needed for proper OpenAL support via using Java. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_ALUT.h" #include "checkALerror.h" /* OpenAL includes */ #include <AL/alut.h> #include <stdlib.h> /* * Class: org_lwjgl_openal_ALUT * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_ALUT_nCreate (JNIEnv *env, jobject obj) { return true; } /* * Class: org_lwjgl_openal_ALUT * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_nDestroy (JNIEnv *env, jobject obj) { } /** * This function initializes OpenAL. * * C Specification: * void alutInit(int *argc, char *argv[]); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_init (JNIEnv *env, jobject obj, jobjectArray jargv) { /* obtain the size the array */ jsize argc = env->GetArrayLength(jargv); /* Declare a char array for argv */ const char* argv[128]; int i; for (i=0;i<argc;i++) { /* obtain the current object from the object array */ jstring string = (jstring) env->GetObjectArrayElement(jargv, i); /* Convert the object just obtained into a String */ const char *str = env->GetStringUTFChars(string, 0); /* Build the argv array */ argv[i] = str; /* Free up memory to prevent memory leaks */ env->ReleaseStringUTFChars(string, str); } /* Increment argc to adjust the difference between Java and C arguments */ argc++; /* call the actual implementation */ alutInit((ALint*) &argc,(char**) argv); CHECK_AL_ERROR } /* * This function loads a WAV file into memory from a file. * * C Specification: * ALboolean alutLoadWAVFile(const char *fname, ALsizei *format, ALsizei *size, ALsizei *bits, * ALsizei *freq, ALboolean *loop ); */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALUT_loadWAVFile (JNIEnv *env, jobject obj, jstring file) { /* * NOTE: Since Java doesn't support modification of supplied * variables (pass by value). We will return a class that * holds what is needed to unload the file again. * The data field contains the offset at whcih the data * segment begins (ie. a pointer). This will *not* work * on 64 bit platforms, since we use an jint for this. */ /* actual file info object */ jobject alutLoadWAVFile_object = NULL; /* class type to find */ jclass alutLoadWAVFile_class = NULL; /* method id - will be set to constructor of alutLoadWAVData */ jmethodID methodID = NULL; /* sound data vars */ jint format, size, freq; jboolean loop; void* data; ALbyte* filename = (ALbyte*) (env->GetStringUTFChars(file, 0)); /* load wave file */ alutLoadWAVFile(filename, (ALenum*) &format, (void**) &data, (ALsizei*) &size, (ALsizei*) &freq, (ALboolean*) &loop); /* get class */ alutLoadWAVFile_class = env->FindClass("org/lwjgl/openal/ALUTLoadWAVData"); /* get constructor */ methodID = env->GetMethodID(alutLoadWAVFile_class, "<init>", "(IIIIZ)V"); /* create object */ alutLoadWAVFile_object = env->NewObject(alutLoadWAVFile_class, methodID, format, (int) data, size, freq, loop); /* release chars */ env->ReleaseStringUTFChars((jstring)filename, 0); CHECK_AL_ERROR return alutLoadWAVFile_object; } /** * This function loads a WAV file into memory from another memory location. * * C Specification: * ALvoid alutLoadWAVMemory(ALbyte *memory,ALenum *format,ALvoid **data,ALsizei * *size,ALsizei *freq,ALboolean *loop) */ JNIEXPORT jobject JNICALL Java_org_lwjgl_openal_ALUT_loadWAVMemory (JNIEnv *env, jobject obj, jint buffer) { /* * NOTE: Since Java doesn't support modification of supplied * variables (pass by value). We will return a class that * holds what is needed to unload the file again. * The data field contains the offset at whcih the data * segment begins (ie. a pointer). This will *not* work * on 64 bit platforms, since we use an jint for this. */ /* actual file info object */ jobject alutLoadWAVFile_object = NULL; /* class type to find */ jclass alutLoadWAVFile_class = NULL; /* method id - will be set to constructor of alutLoadWAVData */ jmethodID methodID = NULL; /* sound data vars */ jint format, size, freq; jboolean loop; void* data; /* load wave from mem */ alutLoadWAVMemory((ALbyte*) buffer, (ALenum*) &format, (void**) &data, (ALsizei*) &size, (ALsizei*) &freq, (ALboolean*) &loop); /* get class */ alutLoadWAVFile_class = env->FindClass("org/lwjgl/openal/ALUTLoadWAVData"); /* get constructor */ methodID = env->GetMethodID(alutLoadWAVFile_class, "<init>", "(IIIIZ)V"); /* create object */ alutLoadWAVFile_object = env->NewObject(alutLoadWAVFile_class, methodID, format, (int) data, size, freq, loop); CHECK_AL_ERROR return alutLoadWAVFile_object; } /** * This function unloads a WAV file from memory and is normally used after copying the data into a buffer * after an alutLoad* function. * * C Specification: * ALvoid alutUnloadWAV(ALenum format, ALvoid *data, ALsizei size, ALsizei freq) */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_unloadWAV (JNIEnv *env, jobject obj, jint format, jint data, jint size, jint freq) { alutUnloadWAV(format, (void**) data, size, freq); CHECK_AL_ERROR } /** * This function exits OpenAL. * * C Specification: * void alutExit(ALvoid); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_ALUT_exit (JNIEnv *env, jobject obj) { alutExit(); } --- NEW FILE: org_lwjgl_openal_BaseAL.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_BaseAL.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_BaseAL.h" /* * Class: org_lwjgl_openal_BaseAL * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_BaseAL_nCreate (JNIEnv *env, jobject obj) { return true; } /* * Class: org_lwjgl_openal_BaseAL * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_BaseAL_nDestroy(JNIEnv *env, jobject obj) { } --- NEW FILE: org_lwjgl_openal_CoreAL.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_CoreAL.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_openal_CoreAL.cpp,v 1.1 2002/11/25 13:52:23 elias_naur Exp $ * * This is the actual JNI implementation of the OpenAL core. It handles * whatever is needed for proper OpenAL support via using Java. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_CoreAL.h" #include "checkALerror.h" /* OpenAL includes */ #include <AL/al.h> /** * This function enables a feature of the OpenAL driver. * * C Specification: * ALvoid alEnable(ALenum capability); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_enable (JNIEnv *env, jobject obj, jint capability) { alEnable((ALenum) capability); CHECK_AL_ERROR } /** * This function disables a feature of the OpenAL driver. * * C Specification: * ALvoid alDisable(ALenum capability); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_disable (JNIEnv *env, jobject obj, jint capability) { alDisable((ALenum) capability); CHECK_AL_ERROR } /** * This function returns a boolean indicating if a specific feature is enabled in the OpenAL driver. * * C Specification: * Alboolean alIsEnabled(ALenum capability); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_isEnabled (JNIEnv *env, jobject obj, jint capability) { jboolean result = (jboolean) alIsEnabled((ALenum) capability); CHECK_AL_ERROR return result; } /** * This function Enables a feature of the OpenAL driver. * * C Specification * ALvoid alHint(ALenum target, ALenum mode); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_hint (JNIEnv *env, jobject obj, jint target, jint mode) { //alHint((ALint)target, (ALint)mode); //cannot link with above statement return; } /** * This function returns a boolean OpenAL state. * * C Specification: * Alboolean alGetBoolean(ALenum pname); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_getBoolean (JNIEnv *env, jobject obj, jint pname) { jboolean result = (jboolean) alGetBoolean((ALenum) pname); CHECK_AL_ERROR return result; } /** * This function returns an integer OpenAL state. * * C Specification: * Alint alGetInteger(ALenum pname); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_getInteger (JNIEnv *env, jobject obj, jint pname) { jint result = (jint) alGetInteger((ALenum) pname); CHECK_AL_ERROR return result; } /** * This function returns a floating point OpenAL state. * * C Specification: * ALfloat alGetFloat(ALenum pname); */ JNIEXPORT jfloat JNICALL Java_org_lwjgl_openal_CoreAL_getFloat (JNIEnv *env, jobject obj, jint pname) { jfloat result = (jfloat) alGetFloat((ALenum) pname); CHECK_AL_ERROR return result; } /** * This function returns a double precision floating point OpenAL state. * * C Specification: * Aldouble alGetDouble(ALenum pname); */ JNIEXPORT jdouble JNICALL Java_org_lwjgl_openal_CoreAL_getDouble (JNIEnv *env, jobject obj, jint pname) { jdouble result = (jdouble) alGetDouble((ALenum) pname); CHECK_AL_ERROR return result; } /** * This function retrieves a boolean OpenAL state. * * C Specification: * ALvoid alGetBooleanv(ALenum pname,ALboolean *data); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getBooleanv (JNIEnv *env, jobject obj, jint pname, jint data) { alGetBooleanv((ALenum) pname, (ALboolean*) data); CHECK_AL_ERROR } /** * This function retrieves an integer OpenAL state. * * C Specification: * ALvoid alGetIntegerv(ALenum pname,ALint *data); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getIntegerv (JNIEnv *env, jobject obj, jint pname, jint data) { alGetIntegerv((ALenum) pname, (ALint*) data); CHECK_AL_ERROR } /** * This function retrieves a floating point OpenAL state. * * C Specification: * ALvoid alGetFloatv(ALenum pname,ALfloat *data); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getFloatv (JNIEnv *env, jobject obj, jint pname, jint data) { alGetFloatv((ALenum) pname, (ALfloat*) data); CHECK_AL_ERROR } /** * This function retrieves a double precision floating point OpenAL state. * * C Specification: * ALvoid alGetDoublev(ALenum pname,ALdouble *data); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getDoublev (JNIEnv *env, jobject obj, jint pname, jint data) { alGetDoublev((ALenum) pname, (ALdouble*) data); CHECK_AL_ERROR } /** * This function retrieves an OpenAL string property. * * C Specification: * ALubyte * alGetString(ALenum pname); */ JNIEXPORT jstring JNICALL Java_org_lwjgl_openal_CoreAL_getString (JNIEnv *env, jobject obj, jint param) { jstring string = (jstring) env->NewStringUTF((const char*) alGetString((ALenum)param)); CHECK_AL_ERROR return string; } /** * This function returns the current error state and then clears the error state. * * C Specification: * ALenum alGetError(ALvoid); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_getError (JNIEnv *env, jobject obj) { jint result = (jint) alGetError(); CHECK_AL_ERROR return result; } /** * This function tests if a specific extension is available for the OpenAL driver. * * C Specification: * ALboolean alIsExtensionPresent(ALubyte *extName); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_isExtensionPresent (JNIEnv *env, jobject obj, jstring fname) { ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(fname, 0)); jboolean result = (jboolean) alIsExtensionPresent(functionname); env->ReleaseStringUTFChars((jstring)functionname, 0); CHECK_AL_ERROR return result; } /** * This function returns the enumeration value of an OpenAL enum described by a string. * * C Specification: * ALenum alGetEnumValue(ALubyte *enumName); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_CoreAL_getEnumValue (JNIEnv *env, jobject obj, jstring ename) { ALubyte* functionname = (ALubyte*) (env->GetStringUTFChars(ename, 0)); jint result = (jint) alGetEnumValue(functionname); env->ReleaseStringUTFChars((jstring)functionname, 0); CHECK_AL_ERROR return result; } /** * This function sets an integer property of the listener. * * C Specification: * ALvoid alListeneri(ALenum pname,ALint value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listeneri (JNIEnv *env, jobject obj, jint pname, jint value) { alListeneri((ALenum) pname, (ALint) value); CHECK_AL_ERROR } /** * This function sets a floating point property for the listener. * * C Specification: * ALvoid alListenerf(ALenum pname,ALfloat value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listenerf (JNIEnv *env, jobject obj, jint pname, jfloat value) { alListenerf((ALenum) pname, (ALfloat) value); CHECK_AL_ERROR } /** * This function sets a floating point property for the listener. * * C Specification: * ALvoid alListener3f(ALenum pname,ALfloat v1,ALfloat v2,ALfloat v3); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listener3f (JNIEnv *env, jobject obj, jint pname, jfloat v1, jfloat v2, jfloat v3) { alListener3f((ALenum) pname, (ALfloat) v1, (ALfloat) v2, (ALfloat) v3); CHECK_AL_ERROR } /** * This function sets a floating point-vector property of the listener. * * C Specification: * ALvoid alListenerfv(ALenum pname,ALfloat *values); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_listenerfv (JNIEnv *env, jobject obj, jint pname, jint values) { alListenerfv((ALenum) pname, (ALfloat*) values); CHECK_AL_ERROR } /** * This function retrieves an integer property of the listener. * * C Specification: * ALvoid alGetListeneri(ALenum pname,ALint *value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListeneri (JNIEnv *env, jobject obj, jint pname, jint value) { alGetListeneri((ALenum) pname, (ALint*) value); CHECK_AL_ERROR } /** * This function retrieves a floating point property of the listener. * * C Specification: * ALvoid alGetListenerf(ALenum pname,ALfloat *value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListenerf (JNIEnv *env, jobject obj, jint pname, jint value) { alGetListenerf((ALenum) pname, (ALfloat*) value); CHECK_AL_ERROR } /** * This function retrieves a set of three floating point values from a property of the listener. * * C Specification: * ALvoid alGetListener3f(ALenum pname,ALfloat *v1,ALfloat *v2,ALfloat *v3); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListener3f (JNIEnv *env, jobject obj, jint pname, jint v1, jint v2, jint v3) { alGetListener3f((ALenum) pname, (ALfloat*) v1, (ALfloat*) v2, (ALfloat*) v3); CHECK_AL_ERROR } /** * This function retrieves a floating point-vector property of the listener. * * C Specification: * ALvoid alGetListenerfv(ALenum pname,ALfloat *values); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getListenerfv (JNIEnv *env, jobject obj, jint pname, jint values) { alGetListenerfv((ALenum) pname, (ALfloat*) values); CHECK_AL_ERROR } /** * This function generates one or more sources. * * C Specification: * ALvoid alGenSources(ALsizei n,ALuint *sources); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genSources (JNIEnv *env, jobject obj, jint n, jint sources) { alGenSources(n, (ALuint*) sources); CHECK_AL_ERROR } /** * This function deletes one or more sources. * * C Specification: * ALvoid alDeleteSources(ALsizei n,ALuint *sources); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteSources (JNIEnv *env, jobject obj, jint n, jint sources) { alDeleteSources(n, (ALuint*) sources); CHECK_AL_ERROR } /** * This function tests if a source name is valid. * * C Specification: * Alboolean alIsSource(ALuint source); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_isSource (JNIEnv *env, jobject obj, jint source) { jboolean result = (jboolean) alIsSource((ALuint) source); CHECK_AL_ERROR return result; } /** * This function sets an integer property of a source. * * C Specification: * ALvoid alSourcei(ALuint source,ALenum pname,ALint value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcei (JNIEnv *env, jobject obj, jint source, jint pname, jint value) { alSourcei((ALuint) source, (ALenum) pname, (ALint) value); CHECK_AL_ERROR } /** * This function sets a floating point property of a source. * * C Specification: * ALvoid alSourcef(ALuint source,ALenum pname,ALfloat value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcef (JNIEnv *env, jobject obj, jint source, jint pname, jfloat value) { alSourcef((ALuint) source, (ALenum) pname, (ALfloat) value); CHECK_AL_ERROR } /** * This function sets a source property requiring three floating point values. * C Specification: * ALvoid alSource3f(ALuint source,ALenum pname,ALfloat v1,ALfloat v2,ALfloat v3); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_source3f (JNIEnv *env, jobject obj, jint source, jint pname, jfloat v1, jfloat v2, jfloat v3) { alSource3f((ALuint) source, (ALenum) pname, (ALfloat) v1, (ALfloat) v2, (ALfloat) v3); CHECK_AL_ERROR } /** * This function sets a floating point-vector property of a source. * * C Specification: * ALvoid alSourcefv(ALuint source,ALenum pname,ALfloat *values); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcefv (JNIEnv *env, jobject obj, jint source, jint pname, jint values) { alSourcefv((ALuint) source, (ALenum) pname, (ALfloat*) values); CHECK_AL_ERROR } /** * This function retrieves an integer property of a source. * C Specification: * ALvoid alGetSourcei(ALuint source,ALenum pname,ALint *value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSourcei (JNIEnv *env, jobject obj, jint source, jint pname, jint value) { alGetSourcei((ALuint) source, (ALenum) pname, (ALint*) value); CHECK_AL_ERROR } /** * This function retrieves a floating point property of a source. * * C Specification: * ALvoid alGetSourcef(ALuint source,ALenum pname,ALfloat *value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSourcef (JNIEnv *env, jobject obj, jint source, jint pname, jint value) { alGetSourcef((ALuint) source, (ALenum) pname, (ALfloat*) value); CHECK_AL_ERROR } /** * This function retrieves a floating point-vector property of a source. * * C Specification: * ALvoid alGetSourcefv(ALuint source,ALenum pname,ALfloat *values); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getSourcefv (JNIEnv *env, jobject obj, jint source, jint pname, jint values) { alGetSourcefv((ALuint) source, (ALenum) pname, (ALfloat*) values); CHECK_AL_ERROR } /** * This function plays a set of sources. * * C Specification: * ALvoid alSourcePlayv(ALsizei n,ALuint *sources); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePlayv (JNIEnv *env, jobject obj, jint n, jint sources) { alSourcePlayv(n, (ALuint*) sources); CHECK_AL_ERROR } /** * This function pauses a set of sources. * * C Specification: * ALvoid alSourcePausev(ALsizei n,ALuint *sources); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePausev (JNIEnv *env, jobject obj, jint n, jint sources) { alSourcePausev(n, (ALuint*) sources); CHECK_AL_ERROR } /** * This function stops a set of sources. * * C Specification: * ALvoid alSourceStopv(ALsizei n,ALuint *sources); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceStopv (JNIEnv *env, jobject obj, jint n, jint sources) { alSourceStopv(n, (ALuint*) sources); CHECK_AL_ERROR } /** * This function stops a set of sources and sets all their states to AL_INITIAL. * * C Specification: * ALvoid alSourceRewindv(ALsizei n,ALuint *sources); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceRewindv (JNIEnv *env, jobject obj, jint n, jint sources) { alSourceRewindv(n, (ALuint*) sources); CHECK_AL_ERROR } /** * This function plays a source. * * C Specification: * ALvoid alSourcePlay(ALuint source); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePlay (JNIEnv *env, jobject obj, jint source) { alSourcePlay((ALuint) source); CHECK_AL_ERROR } /* * This function pauses a source. * * C Specification: * ALvoid alSourcePause(ALuint source); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourcePause (JNIEnv *env, jobject obj, jint source) { alSourcePause((ALuint) source); CHECK_AL_ERROR } /** * This function stops a source. * * C Specification: * ALvoid alSourceStop(ALuint source); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceStop (JNIEnv *env, jobject obj, jint source) { alSourceStop((ALuint) source); CHECK_AL_ERROR } /** * This function stops the source and sets its state to AL_INITIAL. * * C Specification: * ALvoid alSourceRewind(ALuint source); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceRewind (JNIEnv *env, jobject obj, jint source) { alSourceRewind((ALuint) source); CHECK_AL_ERROR } /** * This function generates one or more buffers. * * C Specification: * ALvoid alGenBuffers(ALsizei n,ALuint *buffers); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_genBuffers (JNIEnv *env, jobject obj, jint n, jint buffers) { alGenBuffers(n, (ALuint*) buffers); CHECK_AL_ERROR } /** * This function deletes one or more buffers. * * C Specification: * ALvoid alDeleteBuffers(ALsizei n,ALuint *buffers); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_deleteBuffers (JNIEnv *env, jobject obj, jint n, jint buffers) { alDeleteBuffers(n, (ALuint*) buffers); CHECK_AL_ERROR } /** * This function tests if a buffer name is valid. * * C Specification: * Alboolean alIsBuffer(ALuint buffer); */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_CoreAL_isBuffer (JNIEnv *env, jobject obj, jint buffer) { jboolean result = (jboolean) alIsBuffer((ALuint) buffer); CHECK_AL_ERROR return result; } /** * This function fills a buffer with audio data. * * C Specification: * ALvoid alBufferData(ALuint buffer,ALenum format,ALvoid *data,ALsizei size,ALsizei freq); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_bufferData (JNIEnv *env, jobject obj, jint buffer, jint format, jint data, jint size, jint freq) { alBufferData(buffer, format, (void**) data, size, freq); CHECK_AL_ERROR } /** * This function retrieves an integer property of a buffer. * * C Specification: * ALvoid alGetBufferi(ALuint buffer,ALenum pname,ALint *value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getBufferi (JNIEnv *env, jobject obj, jint buffer, jint pname, jint value) { alGetBufferi((ALuint) buffer, (ALenum) pname, (ALint*) value); CHECK_AL_ERROR } /** * This function retrieves a floating point property of a buffer. * * C Specification: * ALvoid alGetBufferf(ALuint buffer,ALenum pname,ALfloat *value); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_getBufferf (JNIEnv *env, jobject obj, jint buffer, jint pname, jint value) { alGetBufferf((ALuint) buffer, (ALenum) pname, (ALfloat*) value); CHECK_AL_ERROR } /** * This function queues a set of buffers on a source. * * C Specification: * ALvoid alSourceQueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceQueueBuffers (JNIEnv *env, jobject obj, jint source, jint n, jint buffers) { alSourceQueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) buffers); CHECK_AL_ERROR } /** * This function unqueues a set of buffers attached to a source. * * C Specification: * ALvoid alSourceUnqueueBuffers( ALuint source, ALsizei n, ALuint* buffers ); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_sourceUnqueueBuffers (JNIEnv *env, jobject obj, jint source, jint n, jint buffers) { alSourceUnqueueBuffers((ALuint) source, (ALsizei) n, (ALuint*) buffers); CHECK_AL_ERROR } /** * This function selects the OpenAL distance model. * * C Specification: * ALvoid alDistanceModel( ALenum value ); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_distanceModel (JNIEnv *env, jobject obj, jint value) { alDistanceModel((ALenum) value); CHECK_AL_ERROR } /** * This function selects the OpenAL Doppler factor value. * * C Specification: * ALvoid alDopplerFactor( ALfloat value ); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_dopplerFactor (JNIEnv *env, jobject obj, jfloat value) { alDopplerFactor((ALfloat) value); CHECK_AL_ERROR } /** * This function selects the OpenAL Doppler velocity value. * * C Specification: * ALvoid alDopplerVelocity( ALfloat value ); */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_CoreAL_dopplerVelocity (JNIEnv *env, jobject obj, jfloat value) { alDopplerVelocity((ALfloat) value); CHECK_AL_ERROR } --- NEW FILE: org_lwjgl_openal_eax_BaseEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_BaseEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_BaseEAX.h" /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nCreate * Signature: ()Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nCreate (JNIEnv *env, jobject obj) { #ifdef _WIN32 return true; #else return false; #endif } /* * Class: org_lwjgl_openal_eax_BaseEAX * Method: nDestroy * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_BaseEAX_nDestroy (JNIEnv *env, jobject obj) { } --- NEW FILE: org_lwjgl_openal_eax_CoreEAX.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_CoreEAX.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_openal_eax_CoreEAX.cpp,v 1.1 2002/11/25 13:52:23 elias_naur Exp $ * * This is the actual JNI implementation of the OpenAL EAX library. * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ #include "org_lwjgl_openal_eax_CoreEAX.h" #include "checkALerror.h" #include "extal.h" /** * Throws an OAL exception with the specified message */ void ThrowException(JNIEnv *env, const char* message) { jclass cls = env->FindClass("org/lwjgl/openal/OpenALException"); env->ThrowNew(cls, message); } /* * Determines available EAX extensions */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_determineAvailableExtensions (JNIEnv *env, jobject obj) { #ifdef _WIN32 bool EAXSupported = false; //check that we have a current context if(alcGetCurrentContext() == NULL) { ThrowException(env, "Unable to determine EAX Extensions: No current context"); } //check for extension, and assign if available if(alIsExtensionPresent((ALubyte*) "EAX")) { eaxSet = (EAXSet)alGetProcAddress((ALubyte*) "EAXSet"); eaxGet = (EAXGet)alGetProcAddress((ALubyte*) "EAXGet"); EAXSupported = (eaxSet != NULL && eaxGet != NULL); } //throw exception if no EAX support if(EAXSupported != true) { ThrowException(env, "Unable to determine EAX Extensions"); } #else ThrowException(env, "EAX extensions not supported"); #endif } JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_CoreEAX_setGUID (JNIEnv *env, jobject obj) { #ifdef _WIN32 //get class/fields jclass eax_class = env->FindClass("org/lwjgl/openal/eax/CoreEAX"); jfieldID eaxBuffer_field = env->GetStaticFieldID(eax_class, "BUFFER_GUID", "I"); jfieldID eaxListener_field = env->GetStaticFieldID(eax_class, "LISTENER_GUID", "I"); //set fields env->SetStaticIntField(eax_class, eaxBuffer_field, (jint) &DSPROPSETID_EAX20_BufferProperties); env->SetStaticIntField(eax_class, eaxListener_field, (jint) &DSPROPSETID_EAX20_ListenerProperties); #else ThrowException(env, "EAX extensions not supported"); #endif } /* * This function retrieves an EAX value. * * C Specification: * ALenum EAXGet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxGet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxGet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else ThrowException(env, "EAX extensions not supported"); #endif } /* * This function sets an EAX value. * * C Specification: * ALenum EAXSet(const struct _GUID *propertySetID,ALuint property,ALuint source,ALvoid * *value,ALuint size); */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_CoreEAX_eaxSet (JNIEnv *env, jobject obj, jint propertySetID, jint property, jint source, jint value, jint size) { #ifdef _WIN32 jint result = (jint) eaxSet((const struct _GUID*)propertySetID, (ALuint) property, (ALuint) source, (ALvoid*) value, (ALuint) size); CHECK_AL_ERROR return result; #else ThrowException(env, "EAX extensions not supported"); #endif } --- NEW FILE: org_lwjgl_openal_eax_EAXBufferProperties.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXBufferProperties.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_EAXBufferProperties.h" #include <stddef.h> #ifdef _WIN32 #include <eax.h> #endif /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: sizeOfEaxBufferProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_sizeOfEaxBufferProperties(JNIEnv *env, jobject obj) { #ifdef _WIN32 return sizeof(EAXBUFFERPROPERTIES); #endif } /* * Class: org_lwjgl_openal_eax_EAXBufferProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXBufferProperties_assignOffsets(JNIEnv *env, jobject obj) { #ifdef _WIN32 jclass listener_class; jfieldID field; //get class/fields listener_class = env->FindClass("org/lwjgl/openal/eax/EAXBufferProperties"); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "direct_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lDirect)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "directHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lDirectHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "room_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lRoom)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lRoomHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomRolloffFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flRoomRolloffFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "obstruction_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lObstruction)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "obstructionLFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flObstructionLFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusion_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lOcclusion)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusionLFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flOcclusionLFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "occlusionRoomRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flOcclusionRoomRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "outsideVolumeHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, lOutsideVolumeHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "airAbsorptionFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, flAirAbsorptionFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "flags_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXBUFFERPROPERTIES, dwFlags)); #endif } --- NEW FILE: org_lwjgl_openal_eax_EAXListenerProperties.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_openal_eax_EAXListenerProperties.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "org_lwjgl_openal_eax_EAXListenerProperties.h" #include <stddef.h> #ifdef _WIN32 #include <eax.h> #endif /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: sizeOfEaxListenerProperties * Signature: ()I */ JNIEXPORT jint JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_sizeOfEaxListenerProperties(JNIEnv *env, jobject obj) { #ifdef _WIN32 return sizeof(EAXLISTENERPROPERTIES); #endif } /* * Class: org_lwjgl_openal_eax_EAXListenerProperties * Method: assignOffsets * Signature: ()V */ JNIEXPORT void JNICALL Java_org_lwjgl_openal_eax_EAXListenerProperties_assignOffsets (JNIEnv *env, jobject obj) { #ifdef _WIN32 jclass listener_class; jfieldID field; //get class/fields listener_class = env->FindClass("org/lwjgl/openal/eax/EAXListenerProperties"); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "room_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lRoom)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomHF_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lRoomHF)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "roomRolloffFactor_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flRoomRolloffFactor)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "decayTime_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flDecayTime)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "decayHFRatio_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flDecayHFRatio)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reflections_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lReflections)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reflectionsDelay_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flReflectionsDelay)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reverb_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, lReverb)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "reverbDelay_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flReverbDelay)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environment_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, dwEnvironment)); //set environmentDiffusion_offset field = env->GetStaticFieldID(listener_class, "environmentSize_offset", "I"); env->SetStaticIntField(listener_class, field, offsetof(EAXLISTENERPROPERTIES, flEnvironmentSize)); //set environm... [truncated message content] |
From: Elias N. <eli...@us...> - 2002-11-25 13:52:26
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv29923/linux Removed Files: org_lwjgl_openal_ALC.cpp org_lwjgl_openal_ALUT.cpp org_lwjgl_openal_BaseAL.cpp org_lwjgl_openal_CoreAL.cpp org_lwjgl_openal_eax_BaseEAX.cpp org_lwjgl_openal_eax_CoreEAX.cpp org_lwjgl_openal_eax_EAXBufferProperties.cpp org_lwjgl_openal_eax_EAXListenerProperties.cpp Log Message: Moved OpenAL to common --- org_lwjgl_openal_ALC.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_ALC.cpp --- org_lwjgl_openal_ALUT.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_ALUT.cpp --- org_lwjgl_openal_BaseAL.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_BaseAL.cpp --- org_lwjgl_openal_CoreAL.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_CoreAL.cpp --- org_lwjgl_openal_eax_BaseEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_BaseEAX.cpp --- org_lwjgl_openal_eax_CoreEAX.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_CoreEAX.cpp --- org_lwjgl_openal_eax_EAXBufferProperties.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_EAXBufferProperties.cpp --- org_lwjgl_openal_eax_EAXListenerProperties.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_openal_eax_EAXListenerProperties.cpp |
From: Elias N. <eli...@us...> - 2002-11-25 13:39:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv22124/win32 Removed Files: extal.c Log Message: Moved AL utility files to common --- extal.c DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/extal.c |
From: Elias N. <eli...@us...> - 2002-11-25 13:39:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv22124/linux Removed Files: checkALerror.h extal.c Log Message: Moved AL utility files to common --- checkALerror.h DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/checkALerror.h --- extal.c DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/extal.c |
From: Elias N. <eli...@us...> - 2002-11-25 13:39:48
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv22124/common Modified Files: checkALerror.h Added Files: extal.c Log Message: Moved AL utility files to common --- NEW FILE: extal.c --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/extal.c /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "extal.h" /** * $Id: extal.c,v 1.1 2002/11/25 13:39:45 elias_naur Exp $ * * This file contains the AL extension assigning mechanism * * @author Brian Matzon <br...@ma...> * @version $Revision: 1.1 $ */ Index: checkALerror.h CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/checkALerror.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/checkALerror.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- checkALerror.h 27 Aug 2002 20:44:19 -0000 1.2 +++ checkALerror.h 25 Nov 2002 13:39:44 -0000 1.3 @@ -13,7 +13,7 @@ #ifdef _DEBUG #include <jni.h> -#include <al.h> +#include <AL/al.h> #define CHECK_AL_ERROR \ { \ @@ -42,4 +42,4 @@ #endif /* _DEBUG */ -#endif /* _CHECKGLERROR_H_INCLUDED_ */ \ No newline at end of file +#endif /* _CHECKGLERROR_H_INCLUDED_ */ |
From: Elias N. <eli...@us...> - 2002-11-25 13:36:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1:/tmp/cvs-serv19966/win32 Removed Files: org_lwjgl_opengl_GLU.cpp Log Message: Moved GLU.cpp to common --- org_lwjgl_opengl_GLU.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_GLU.cpp |
From: Elias N. <eli...@us...> - 2002-11-25 13:36:39
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/linux In directory sc8-pr-cvs1:/tmp/cvs-serv19966/linux Removed Files: org_lwjgl_opengl_GLU.cpp Log Message: Moved GLU.cpp to common --- org_lwjgl_opengl_GLU.cpp DELETED --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/linux/org_lwjgl_opengl_GLU.cpp |
From: Elias N. <eli...@us...> - 2002-11-25 13:36:38
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1:/tmp/cvs-serv19966/common Added Files: org_lwjgl_opengl_GLU.cpp Log Message: Moved GLU.cpp to common --- NEW FILE: org_lwjgl_opengl_GLU.cpp --- CVS Browser: http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/java-game-lib/LWJGL/src/native/common/org_lwjgl_opengl_GLU.cpp /* * Copyright (c) 2002 Light Weight Java Game Library Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'Light Weight Java Game Library' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /** * $Id: org_lwjgl_opengl_GLU.cpp,v 1.1 2002/11/25 13:36:35 elias_naur Exp $ * * GLU library. * * @author cix_foo <ci...@us...> * @version $Revision: 1.1 $ */ #ifdef _WIN32 #include <windows.h> #endif #include "org_lwjgl_opengl_GLU.h" #include "extgl.h" #include "checkGLerror.h" #include "GL/glu.h" /* * Class: org_lwjgl_opengl_GLU * Method: getString */ JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_getString(JNIEnv * env, jobject obj, jint p0) { const char * msg = (const char *) gluGetString((GLint) p0); jstring ret = env->NewStringUTF(msg); return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: errorString */ JNIEXPORT jstring JNICALL Java_org_lwjgl_opengl_GLU_errorString(JNIEnv * env, jobject obj, jint p0) { const GLubyte * msg = gluErrorString((GLint) p0); jstring ret = env->NewStringUTF((const char *) msg); return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: ortho2D */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_ortho2D(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3) { gluOrtho2D((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: perspective */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_perspective(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3) { gluPerspective((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: pickMatrix */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_pickMatrix(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3, jint p4) { gluPickMatrix((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3, (GLint *) p4); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: lookAt */ JNIEXPORT void JNICALL Java_org_lwjgl_opengl_GLU_lookAt(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jdouble p3, jdouble p4, jdouble p5, jdouble p6, jdouble p7, jdouble p8) { gluLookAt((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (GLdouble) p3, (GLdouble) p4, (GLdouble) p5, (GLdouble) p6, (GLdouble) p7, (GLdouble) p8); CHECK_GL_ERROR } /* * Class: org_lwjgl_opengl_GLU * Method: project */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_project(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jint p3, jint p4, jint p5, jint p6, jint p7, jint p8) { jint ret = (jint) gluProject((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (const GLdouble *) p3, (const GLdouble *) p4, (const GLint *) p5, (GLdouble *) p6, (GLdouble *) p7, (GLdouble *) p8); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: unProject */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_unProject(JNIEnv * env, jobject obj, jdouble p0, jdouble p1, jdouble p2, jint p3, jint p4, jint p5, jint p6, jint p7, jint p8) { jint ret = (jint) gluUnProject((GLdouble) p0, (GLdouble) p1, (GLdouble) p2, (const GLdouble *) p3, (const GLdouble *) p4, (const GLint *) p5, (GLdouble *) p6, (GLdouble *) p7, (GLdouble *) p8); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: scaleImage */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_scaleImage(JNIEnv * env, jobject obj, jint p0, jint p1, jint p2, jint p3, jint p4, jint p5, jint p6, jint p7, jint p8) { jint ret = (jint) gluScaleImage((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (const void *) p4, (GLint) p5, (GLint) p6, (GLint) p7, (void *) p8); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: build1DMipmaps */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_build1DMipmaps(JNIEnv * env, jobject obj, jint p0, jint p1, jint p2, jint p3, jint p4, jint p5) { jint ret = (jint) gluBuild1DMipmaps((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (GLint) p4, (const void *) p5); CHECK_GL_ERROR return ret; } /* * Class: org_lwjgl_opengl_GLU * Method: build2DMipmaps */ JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_GLU_build2DMipmaps(JNIEnv * env, jobject obj, jint p0, jint p1, jint p2, jint p3, jint p4, jint p5, jint p6) { jint ret = (jint) gluBuild2DMipmaps((GLint) p0, (GLint) p1, (GLint) p2, (GLint) p3, (GLint) p4, (GLint) p5, (const void *) p6); CHECK_GL_ERROR return ret; } |