From: Carsten W. <ca...@us...> - 2005-07-10 17:57:44
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19948/src/jake2/render Modified Files: Tag: render-refactoring JoglRenderer.java LWJGLRenderer.java JoglBase.java FastJoglRenderer.java Log Message: all renderers are using the same code path (currently experimental) Index: JoglRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglRenderer.java,v retrieving revision 1.6 retrieving revision 1.6.8.1 diff -C2 -d -r1.6 -r1.6.8.1 *** JoglRenderer.java 14 Dec 2004 00:11:03 -0000 1.6 --- JoglRenderer.java 10 Jul 2005 17:57:34 -0000 1.6.8.1 *************** *** 30,34 **** import jake2.client.refexport_t; import jake2.qcommon.xcommand_t; - import jake2.render.jogl.Misc; import jake2.sys.JOGLKBD; import jake2.sys.KBD; --- 30,33 ---- *************** *** 41,45 **** * @author cwei */ ! final class JoglRenderer extends Misc implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); --- 40,44 ---- * @author cwei */ ! final class JoglRenderer extends JoglGL implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); *************** *** 65,69 **** public boolean Init(int vid_xpos, int vid_ypos) { // pre init ! if (!R_Init(vid_xpos, vid_ypos)) return false; // calls the R_Init2() internally updateScreen(); --- 64,68 ---- public boolean Init(int vid_xpos, int vid_ypos) { // pre init ! if (!R_Init()) return false; // calls the R_Init2() internally updateScreen(); Index: FastJoglRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/FastJoglRenderer.java,v retrieving revision 1.4 retrieving revision 1.4.8.1 diff -C2 -d -r1.4 -r1.4.8.1 *** FastJoglRenderer.java 14 Dec 2004 00:11:09 -0000 1.4 --- FastJoglRenderer.java 10 Jul 2005 17:57:34 -0000 1.4.8.1 *************** *** 29,33 **** import jake2.client.*; import jake2.qcommon.xcommand_t; ! import jake2.render.fastjogl.Misc; import jake2.sys.JOGLKBD; import jake2.sys.KBD; --- 29,33 ---- import jake2.client.*; import jake2.qcommon.xcommand_t; ! import jake2.render.JoglGL; import jake2.sys.JOGLKBD; import jake2.sys.KBD; *************** *** 40,44 **** * @author cwei */ ! final class FastJoglRenderer extends Misc implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); --- 40,44 ---- * @author cwei */ ! final class FastJoglRenderer extends JoglGL implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); *************** *** 65,69 **** // pre init ! if (!R_Init(vid_xpos, vid_ypos)) return false; // calls the R_Init2() internally updateScreen(); --- 65,69 ---- // pre init ! if (!R_Init()) return false; // calls the R_Init2() internally updateScreen(); Index: LWJGLRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/LWJGLRenderer.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** LWJGLRenderer.java 20 Dec 2004 21:49:14 -0000 1.3 --- LWJGLRenderer.java 10 Jul 2005 17:57:34 -0000 1.3.6.1 *************** *** 28,31 **** --- 28,32 ---- import jake2.Defines; import jake2.client.*; + import jake2.render.lwjgl.LWJGLBase; import jake2.render.lwjgl.Misc; import jake2.sys.KBD; *************** *** 39,43 **** * @author dsanders/cwei */ ! final class LWJGLRenderer extends Misc implements refexport_t, Ref { private LWJGLKBD kbd=new LWJGLKBD(); --- 40,44 ---- * @author dsanders/cwei */ ! final class LWJGLRenderer extends LwjglGL implements refexport_t, Ref { private LWJGLKBD kbd=new LWJGLKBD(); Index: JoglBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglBase.java,v retrieving revision 1.15 retrieving revision 1.15.2.1 diff -C2 -d -r1.15 -r1.15.2.1 *** JoglBase.java 26 Jun 2005 08:51:19 -0000 1.15 --- JoglBase.java 10 Jul 2005 17:57:34 -0000 1.15.2.1 *************** *** 29,36 **** import jake2.Defines; import jake2.client.VID; - import jake2.client.viddef_t; - import jake2.game.cvar_t; import jake2.qcommon.Cbuf; import jake2.qcommon.xcommand_t; import jake2.sys.JOGLKBD; --- 29,35 ---- import jake2.Defines; import jake2.client.VID; import jake2.qcommon.Cbuf; import jake2.qcommon.xcommand_t; + import jake2.render.lwjgl.Misc; import jake2.sys.JOGLKBD; *************** *** 49,53 **** * JoglCommon */ ! public abstract class JoglBase implements GLEventListener { // IMPORTED FUNCTIONS --- 48,52 ---- * JoglCommon */ ! public abstract class JoglBase extends Misc implements GLEventListener { // IMPORTED FUNCTIONS *************** *** 57,72 **** JFrame window; ! protected GL gl; ! protected GLU glu; ! protected GLUT glut = new GLUT(); // window position on the screen int window_xpos, window_ypos; - protected viddef_t vid = new viddef_t(); // handles the post initialization with JoglRenderer ! protected boolean post_init = false; ! protected boolean contextInUse = false; ! protected abstract boolean R_Init2(); protected final xcommand_t INIT_CALLBACK = new xcommand_t() { --- 56,69 ---- JFrame window; ! GL gl; ! GLU glu; ! GLUT glut = new GLUT(); // window position on the screen int window_xpos, window_ypos; // handles the post initialization with JoglRenderer ! boolean post_init = false; ! boolean contextInUse = false; protected final xcommand_t INIT_CALLBACK = new xcommand_t() { *************** *** 74,79 **** // only used for the first run (initialization) // clear the screen ! gl.glClearColor(0, 0, 0, 0); ! gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); // --- 71,76 ---- // only used for the first run (initialization) // clear the screen ! glClearColor(0, 0, 0, 0); ! glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // *************** *** 87,100 **** } }; ! protected xcommand_t callback = INIT_CALLBACK; - protected cvar_t vid_fullscreen; - - // enum rserr_t - protected static final int rserr_ok = 0; - protected static final int rserr_invalid_fullscreen = 1; - protected static final int rserr_invalid_mode = 2; - protected static final int rserr_unknown = 3; - public DisplayMode[] getModeList() { DisplayMode[] modes = device.getDisplayModes(); --- 84,90 ---- } }; ! ! xcommand_t callback = INIT_CALLBACK; public DisplayMode[] getModeList() { DisplayMode[] modes = device.getDisplayModes(); *************** *** 308,333 **** protected void GLimp_EndFrame() { ! gl.glFlush(); canvas.swapBuffers(); } - protected void GLimp_BeginFrame(float camera_separation) { - // do nothing - } - - protected void GLimp_AppActivate(boolean activate) { - // do nothing - } ! protected void GLimp_EnableLogging(boolean enable) { ! // doesn't need jogl logging ! // do nothing ! } ! ! protected void GLimp_LogNewFrame() { ! // doesn't need jogl logging ! // do nothing ! } ! ! /* * @see jake2.client.refexport_t#updateScreen() */ --- 298,306 ---- protected void GLimp_EndFrame() { ! glFlush(); canvas.swapBuffers(); } ! /* * @see jake2.client.refexport_t#updateScreen() */ |