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
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
|
|
|
1
|
2
|
|
3
|
4
|
5
|
6
|
7
|
8
|
9
|
|
10
|
11
|
12
|
13
|
14
|
15
(4) |
16
(2) |
|
17
(8) |
18
(10) |
19
(32) |
20
(3) |
21
(10) |
22
(5) |
23
|
|
24
(76) |
25
(77) |
26
(33) |
27
(36) |
28
(15) |
29
(14) |
30
(17) |
|
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"); |