You can subscribe to this list here.
2004 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(52) |
Aug
(34) |
Sep
(99) |
Oct
(110) |
Nov
(21) |
Dec
(69) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2005 |
Jan
(117) |
Feb
(90) |
Mar
(1) |
Apr
(22) |
May
(96) |
Jun
(25) |
Jul
(22) |
Aug
|
Sep
|
Oct
(18) |
Nov
(43) |
Dec
(71) |
2006 |
Jan
(20) |
Feb
(10) |
Mar
|
Apr
(4) |
May
(2) |
Jun
|
Jul
|
Aug
(3) |
Sep
|
Oct
(60) |
Nov
(63) |
Dec
(35) |
2007 |
Jan
(18) |
Feb
(40) |
Mar
(14) |
Apr
(18) |
May
(33) |
Jun
(2) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(1) |
Dec
|
2008 |
Jan
|
Feb
(1) |
Mar
(25) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2009 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(5) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(15) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(3) |
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Carsten W. <ca...@us...> - 2005-11-14 23:56:47
|
Update of /cvsroot/jake2/jake2/src/jake2/render/basic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1845/src/jake2/render/basic Log Message: Directory /cvsroot/jake2/jake2/src/jake2/render/basic added to the repository --> Using per-directory sticky tag `render-refactoring' |
From: Carsten W. <ca...@us...> - 2005-11-14 23:49:49
|
Update of /cvsroot/jake2/jake2/src/jake2/render/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32484/src/jake2/render/opengl Added Files: Tag: render-refactoring Jsr231GL.java LwjglGL.java LwjglDriver.java Jsr231Driver.java JoglGL.java JoglDriver.java QGL.java QGLConst.java GLDriver.java Log Message: OpenGL driver implementations for jogl, lwjgl and jsr231 --- NEW FILE: QGL.java --- package jake2.render.opengl; import java.nio.*; public interface QGL extends QGLConst { /* * a sub set of OpenGL for Jake2 */ void glAlphaFunc(int func, float ref); void glBegin(int mode); void glBindTexture(int target, int texture); void glBlendFunc(int sfactor, int dfactor); void glClear(int mask); void glClearColor(float red, float green, float blue, float alpha); void glColor3f(float red, float green, float blue); void glColor3ub(byte red, byte green, byte blue); void glColor4f(float red, float green, float blue, float alpha); void glColor4ub(byte red, byte green, byte blue, byte alpha); void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer); void glColorPointer(int size, int stride, FloatBuffer pointer); void glCullFace(int mode); void glDeleteTextures(IntBuffer textures); void glDepthFunc(int func); void glDepthMask(boolean flag); void glDepthRange(double zNear, double zFar); void glDisable(int cap); void glDisableClientState(int cap); void glDrawArrays(int mode, int first, int count); void glDrawBuffer(int mode); void glDrawElements(int mode, IntBuffer indices); void glEnable(int cap); void glEnableClientState(int cap); void glEnd(); void glFinish(); void glFlush(); void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar); int glGetError(); void glGetFloat(int pname, FloatBuffer params); String glGetString(int name); void glInterleavedArrays(int format, int stride, FloatBuffer pointer); void glLoadIdentity(); void glLoadMatrix(FloatBuffer m); void glMatrixMode(int mode); void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar); void glPixelStorei(int pname, int param); void glPointSize(float size); void glPolygonMode(int face, int mode); void glPopMatrix(); void glPushMatrix(); void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels); void glRotatef(float angle, float x, float y, float z); void glScalef(float x, float y, float z); void glScissor(int x, int y, int width, int height); void glShadeModel(int mode); void glTexCoord2f(float s, float t); void glTexCoordPointer(int size, int stride, FloatBuffer pointer); void glTexEnvi(int target, int pname, int param); void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels); void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels); void glTexParameterf(int target, int pname, float param); void glTexParameteri(int target, int pname, int param); void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels); void glTranslatef(float x, float y, float z); void glVertex2f(float x, float y); void glVertex3f(float x, float y, float z); void glVertexPointer(int size, int stride, FloatBuffer pointer); void glViewport(int x, int y, int width, int height); void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data); void glActiveTextureARB(int texture); void glClientActiveTextureARB(int texture); void glPointParameterEXT(int pname, FloatBuffer pfParams); void glPointParameterfEXT(int pname, float param); void glLockArraysEXT(int first, int count); void glArrayElement(int index); void glUnlockArraysEXT(); void glMultiTexCoord2f(int target, float s, float t); } --- NEW FILE: LwjglDriver.java --- /* * LWJGLBase.java * Copyright (C) 2004 * * $Id: LwjglDriver.java,v 1.1.2.1 2005/11/14 23:49:40 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.render.opengl; import jake2.Defines; import jake2.client.VID; import jake2.qcommon.xcommand_t; import jake2.render.Base; import java.awt.Dimension; import java.util.LinkedList; import org.lwjgl.LWJGLException; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.DisplayMode; /** * LWJGLBase * * @author dsanders/cwei */ public class LwjglDriver extends LwjglGL implements GLDriver { protected LwjglDriver() { // see LwjglRenderer } private DisplayMode oldDisplayMode; // window position on the screen int window_xpos, window_ypos; private java.awt.DisplayMode toAwtDisplayMode(DisplayMode m) { return new java.awt.DisplayMode(m.getWidth(), m.getHeight(), m .getBitsPerPixel(), m.getFrequency()); } public java.awt.DisplayMode[] getModeList() { DisplayMode[] modes = Display.getAvailableDisplayModes(); LinkedList l = new LinkedList(); l.add(toAwtDisplayMode(oldDisplayMode)); for (int i = 0; i < modes.length; i++) { DisplayMode m = modes[i]; if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; if (m.getHeight() < 240 || m.getWidth() < 320) continue; int j = 0; java.awt.DisplayMode ml = null; for (j = 0; j < l.size(); j++) { ml = (java.awt.DisplayMode) l.get(j); if (ml.getWidth() > m.getWidth()) break; if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; } if (j == l.size()) { l.addLast(toAwtDisplayMode(m)); } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { l.add(j, toAwtDisplayMode(m)); } else if (m.getFrequency() > ml.getRefreshRate()) { l.remove(j); l.add(j, toAwtDisplayMode(m)); } } java.awt.DisplayMode[] ma = new java.awt.DisplayMode[l.size()]; l.toArray(ma); return ma; } public DisplayMode[] getLWJGLModeList() { DisplayMode[] modes = Display.getAvailableDisplayModes(); LinkedList l = new LinkedList(); l.add(oldDisplayMode); for (int i = 0; i < modes.length; i++) { DisplayMode m = modes[i]; if (m.getBitsPerPixel() != oldDisplayMode.getBitsPerPixel()) continue; if (m.getFrequency() > oldDisplayMode.getFrequency()) continue; if (m.getHeight() < 240 || m.getWidth() < 320) continue; int j = 0; DisplayMode ml = null; for (j = 0; j < l.size(); j++) { ml = (DisplayMode) l.get(j); if (ml.getWidth() > m.getWidth()) break; if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; } if (j == l.size()) { l.addLast(m); } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { l.add(j, m); } else if (m.getFrequency() > ml.getFrequency()) { l.remove(j); l.add(j, m); } } DisplayMode[] ma = new DisplayMode[l.size()]; l.toArray(ma); return ma; } private DisplayMode findDisplayMode(Dimension dim) { DisplayMode mode = null; DisplayMode m = null; DisplayMode[] modes = getLWJGLModeList(); int w = dim.width; int h = dim.height; for (int i = 0; i < modes.length; i++) { m = modes[i]; if (m.getWidth() == w && m.getHeight() == h) { mode = m; break; } } if (mode == null) mode = oldDisplayMode; return mode; } String getModeString(DisplayMode m) { StringBuffer sb = new StringBuffer(); sb.append(m.getWidth()); sb.append('x'); sb.append(m.getHeight()); sb.append('x'); sb.append(m.getBitsPerPixel()); sb.append('@'); sb.append(m.getFrequency()); sb.append("Hz"); return sb.toString(); } /** * @param dim * @param mode * @param fullscreen * @return enum rserr_t */ public int setMode(Dimension dim, int mode, boolean fullscreen) { Dimension newDim = new Dimension(); VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); /* * fullscreen handling */ if (oldDisplayMode == null) { oldDisplayMode = Display.getDisplayMode(); } if (!VID.GetModeInfo(newDim, mode)) { VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); return Base.rserr_invalid_mode; } VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); // destroy the existing window shutdown(); Display.setTitle("Jake2 (lwjgl)"); Display.setLocation(0, 0); DisplayMode displayMode = findDisplayMode(newDim); newDim.width = displayMode.getWidth(); newDim.height = displayMode.getHeight(); if (fullscreen) { try { Display.setDisplayMode(displayMode); } catch (LWJGLException e) { return Base.rserr_invalid_mode; } Display.setLocation(0, 0); try { Display.setFullscreen(fullscreen); } catch (LWJGLException e) { return Base.rserr_invalid_fullscreen; } VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); } else { try { Display.setDisplayMode(displayMode); } catch (LWJGLException e) { return Base.rserr_invalid_mode; } try { Display.setFullscreen(false); } catch (LWJGLException e) { return Base.rserr_invalid_fullscreen; } Display.setLocation(window_xpos, window_ypos); } Base.setVid(newDim.width, newDim.height); // vid.width = newDim.width; // vid.height = newDim.height; try { Display.create(); } catch (LWJGLException e) { return Base.rserr_unknown; } // let the sound and input subsystems know about the new window VID.NewWindow(newDim.width, newDim.height); return Base.rserr_ok; } public void shutdown() { if (oldDisplayMode != null && Display.isFullscreen()) { try { Display.setDisplayMode(oldDisplayMode); } catch (Exception e) { e.printStackTrace(); } } while (Display.isCreated()) { Display.destroy(); } } /** * @return true */ public boolean init(int xpos, int ypos) { // do nothing window_xpos = xpos; window_ypos = ypos; return true; } public void beginFrame(float camera_separation) { // do nothing } public void endFrame() { glFlush(); // swap buffers Display.update(); } public void appActivate(boolean activate) { // do nothing } public void enableLogging(boolean enable) { // do nothing } public void logNewFrame() { // do nothing } /** * this is a hack for jogl renderers. * * @param callback */ public final void updateScreen(xcommand_t callback) { callback.execute(); } } --- NEW FILE: LwjglGL.java --- package jake2.render.opengl; import java.nio.*; import org.lwjgl.util.GL; public class LwjglGL implements QGL { LwjglGL() { // singleton } public final void glAlphaFunc(int func, float ref) { GL.glAlphaFunc(func, ref); } public final void glBegin(int mode) { GL.glBegin(mode); } public final void glBindTexture(int target, int texture) { GL.glBindTexture(target, texture); } public final void glBlendFunc(int sfactor, int dfactor) { GL.glBlendFunc(sfactor, dfactor); } public final void glClear(int mask) { GL.glClear(mask); } public final void glClearColor(float red, float green, float blue, float alpha) { GL.glClearColor(red, green, blue, alpha); } public final void glColor3f(float red, float green, float blue) { GL.glColor3f(red, green, blue); } public final void glColor3ub(byte red, byte green, byte blue) { GL.glColor3ub(red, green, blue); } public final void glColor4f(float red, float green, float blue, float alpha) { GL.glColor4f(red, green, blue, alpha); } public final void glColor4ub(byte red, byte green, byte blue, byte alpha) { GL.glColor4ub(red, green, blue, alpha); } public final void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) { GL.glColorPointer(size, unsigned, stride, pointer); } public final void glColorPointer(int size, int stride, FloatBuffer pointer) { GL.glColorPointer(size, stride, pointer); } public final void glCullFace(int mode) { GL.glCullFace(mode); } public final void glDeleteTextures(IntBuffer textures) { GL.glDeleteTextures(textures); } public final void glDepthFunc(int func) { GL.glDepthFunc(func); } public final void glDepthMask(boolean flag) { GL.glDepthMask(flag); } public final void glDepthRange(double zNear, double zFar) { GL.glDepthRange(zNear, zFar); } public final void glDisable(int cap) { GL.glDisable(cap); } public final void glDisableClientState(int cap) { GL.glDisableClientState(cap); } public final void glDrawArrays(int mode, int first, int count) { GL.glDrawArrays(mode, first, count); } public final void glDrawBuffer(int mode) { GL.glDrawBuffer(mode); } public final void glDrawElements(int mode, IntBuffer indices) { GL.glDrawElements(mode, indices); } public final void glEnable(int cap) { GL.glEnable(cap); } public final void glEnableClientState(int cap) { GL.glEnableClientState(cap); } public final void glEnd() { GL.glEnd(); } public final void glFinish() { GL.glFinish(); } public final void glFlush() { GL.glFlush(); } public final void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { GL.glFrustum(left, right, bottom, top, zNear, zFar); } public final int glGetError() { return GL.glGetError(); } public final void glGetFloat(int pname, FloatBuffer params) { GL.glGetFloat(pname, params); } public final String glGetString(int name) { return GL.glGetString(name); } public final void glInterleavedArrays(int format, int stride, FloatBuffer pointer) { GL.glInterleavedArrays(format, stride, pointer); } public final void glLoadIdentity() { GL.glLoadIdentity(); } public final void glLoadMatrix(FloatBuffer m) { GL.glLoadMatrix(m); } public final void glMatrixMode(int mode) { GL.glMatrixMode(mode); } public final void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar) { GL.glOrtho(left, right, bottom, top, zNear, zFar); } public final void glPixelStorei(int pname, int param) { GL.glPixelStorei(pname, param); } public final void glPointSize(float size) { GL.glPointSize(size); } public final void glPolygonMode(int face, int mode) { GL.glPolygonMode(face, mode); } public final void glPopMatrix() { GL.glPopMatrix(); } public final void glPushMatrix() { GL.glPushMatrix(); } public final void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) { GL.glReadPixels(x, y, width, height, format, type, pixels); } public final void glRotatef(float angle, float x, float y, float z) { GL.glRotatef(angle, x, y, z); } public final void glScalef(float x, float y, float z) { GL.glScalef(x, y, z); } public final void glScissor(int x, int y, int width, int height) { GL.glScissor(x, y, width, height); } public final void glShadeModel(int mode) { GL.glShadeModel(mode); } public final void glTexCoord2f(float s, float t) { GL.glTexCoord2f(s, t); } public final void glTexCoordPointer(int size, int stride, FloatBuffer pointer) { GL.glTexCoordPointer(size, stride, pointer); } public final void glTexEnvi(int target, int pname, int param) { GL.glTexEnvi(target, pname, param); } public final void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) { GL.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } public final void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) { GL.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } public final void glTexParameterf(int target, int pname, float param) { GL.glTexParameterf(target, pname, param); } public final void glTexParameteri(int target, int pname, int param) { GL.glTexParameteri(target, pname, param); } public final void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) { GL.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); } public final void glTranslatef(float x, float y, float z) { GL.glTranslatef(x, y, z); } public final void glVertex2f(float x, float y) { GL.glVertex2f(x, y); } public final void glVertex3f(float x, float y, float z) { GL.glVertex3f(x, y, z); } public final void glVertexPointer(int size, int stride, FloatBuffer pointer) { GL.glVertexPointer(size, stride, pointer); } public final void glViewport(int x, int y, int width, int height) { GL.glViewport(x, y, width, height); } public final void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { GL.glColorTable(target, internalFormat, width, format, type, data); } public final void glActiveTextureARB(int texture) { GL.glActiveTextureARB(texture); } public final void glClientActiveTextureARB(int texture) { GL.glClientActiveTextureARB(texture); } public final void glPointParameterEXT(int pname, FloatBuffer pfParams) { GL.glPointParameterEXT(pname, pfParams); } public final void glPointParameterfEXT(int pname, float param) { GL.glPointParameterfEXT(pname, param); } public final void glLockArraysEXT(int first, int count) { GL.glLockArraysEXT(first, count); } public final void glArrayElement(int index) { GL.glArrayElement(index); } public final void glUnlockArraysEXT() { GL.glUnlockArraysEXT(); } public final void glMultiTexCoord2f(int target, float s, float t) { GL.glMultiTexCoord2f(target, s, t); } } --- NEW FILE: JoglGL.java --- package jake2.render.opengl; import java.nio.*; import net.java.games.jogl.GL; public class JoglGL implements QGL { private GL jogl; JoglGL() { // singleton } void setGL(GL context) { this.jogl = context; } public void glAlphaFunc(int func, float ref) { jogl.glAlphaFunc(func, ref); } public void glBegin(int mode) { jogl.glBegin(mode); } public void glBindTexture(int target, int texture) { jogl.glBindTexture(target, texture); } public void glBlendFunc(int sfactor, int dfactor) { jogl.glBlendFunc(sfactor, dfactor); } public void glClear(int mask) { jogl.glClear(mask); } public void glClearColor(float red, float green, float blue, float alpha) { jogl.glClearColor(red, green, blue, alpha); } public void glColor3f(float red, float green, float blue) { jogl.glColor3f(red, green, blue); } public void glColor3ub(byte red, byte green, byte blue) { jogl.glColor3ub(red, green, blue); } public void glColor4f(float red, float green, float blue, float alpha) { jogl.glColor4f(red, green, blue, alpha); } public void glColor4ub(byte red, byte green, byte blue, byte alpha) { jogl.glColor4ub(red, green, blue, alpha); } public void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) { jogl.glColorPointer(size, GL_UNSIGNED_BYTE, stride, pointer); } public void glColorPointer(int size, int stride, FloatBuffer pointer) { jogl.glColorPointer(size, GL_FLOAT, stride, pointer); } public void glCullFace(int mode) { jogl.glCullFace(mode); } public void glDeleteTextures(IntBuffer textures) { jogl.glDeleteTextures(textures.limit(), textures); } public void glDepthFunc(int func) { jogl.glDepthFunc(func); } public void glDepthMask(boolean flag) { jogl.glDepthMask(flag); } public void glDepthRange(double zNear, double zFar) { jogl.glDepthRange(zNear, zFar); } public void glDisable(int cap) { jogl.glDisable(cap); } public void glDisableClientState(int cap) { jogl.glDisableClientState(cap); } public void glDrawArrays(int mode, int first, int count) { jogl.glDrawArrays(mode, first, count); } public void glDrawBuffer(int mode) { jogl.glDrawBuffer(mode); } public void glDrawElements(int mode, IntBuffer indices) { jogl.glDrawElements(mode, indices.limit(), GL_UNSIGNED_INT, indices); } public void glEnable(int cap) { jogl.glEnable(cap); } public void glEnableClientState(int cap) { jogl.glEnableClientState(cap); } public void glEnd() { jogl.glEnd(); } public void glFinish() { jogl.glFinish(); } public void glFlush() { jogl.glFlush(); } public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { jogl.glFrustum(left, right, bottom, top, zNear, zFar); } public int glGetError() { return jogl.glGetError(); } public void glGetFloat(int pname, FloatBuffer params) { jogl.glGetFloatv(pname, params); } public String glGetString(int name) { return jogl.glGetString(name); } public void glInterleavedArrays(int format, int stride, FloatBuffer pointer) { jogl.glInterleavedArrays(format, stride, pointer); } public void glLoadIdentity() { jogl.glLoadIdentity(); } public void glLoadMatrix(FloatBuffer m) { jogl.glLoadMatrixf(m); } public void glMatrixMode(int mode) { jogl.glMatrixMode(mode); } public void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar) { jogl.glOrtho(left, right, bottom, top, zNear, zFar); } public void glPixelStorei(int pname, int param) { jogl.glPixelStorei(pname, param); } public void glPointSize(float size) { jogl.glPointSize(size); } public void glPolygonMode(int face, int mode) { jogl.glPolygonMode(face, mode); } public void glPopMatrix() { jogl.glPopMatrix(); } public void glPushMatrix() { jogl.glPushMatrix(); } public void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) { jogl.glReadPixels(x, y, width, height, format, type, pixels); } public void glRotatef(float angle, float x, float y, float z) { jogl.glRotatef(angle, x, y, z); } public void glScalef(float x, float y, float z) { jogl.glScalef(x, y, z); } public void glScissor(int x, int y, int width, int height) { jogl.glScissor(x, y, width, height); } public void glShadeModel(int mode) { jogl.glShadeModel(mode); } public void glTexCoord2f(float s, float t) { jogl.glTexCoord2f(s, t); } public void glTexCoordPointer(int size, int stride, FloatBuffer pointer) { jogl.glTexCoordPointer(size, GL_FLOAT, stride, pointer); } public void glTexEnvi(int target, int pname, int param) { jogl.glTexEnvi(target, pname, param); } public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) { jogl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) { jogl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } public void glTexParameterf(int target, int pname, float param) { jogl.glTexParameterf(target, pname, param); } public void glTexParameteri(int target, int pname, int param) { jogl.glTexParameteri(target, pname, param); } public void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) { jogl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); } public void glTranslatef(float x, float y, float z) { jogl.glTranslatef(x, y, z); } public void glVertex2f(float x, float y) { jogl.glVertex2f(x, y); } public void glVertex3f(float x, float y, float z) { jogl.glVertex3f(x, y, z); } public void glVertexPointer(int size, int stride, FloatBuffer pointer) { jogl.glVertexPointer(size, GL_FLOAT, stride, pointer); } public void glViewport(int x, int y, int width, int height) { jogl.glViewport(x, y, width, height); } public void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { jogl.glColorTable(target, internalFormat, width, format, type, data); } public void glActiveTextureARB(int texture) { jogl.glActiveTextureARB(texture); } public void glClientActiveTextureARB(int texture) { jogl.glClientActiveTextureARB(texture); } public void glPointParameterEXT(int pname, FloatBuffer pfParams) { jogl.glPointParameterfvEXT(pname, pfParams); } public void glPointParameterfEXT(int pname, float param) { jogl.glPointParameterfEXT(pname, param); } public void glLockArraysEXT(int first, int count) { jogl.glLockArraysEXT(first, count); } public void glArrayElement(int index) { jogl.glArrayElement(index); } public void glUnlockArraysEXT() { jogl.glUnlockArraysEXT(); } public void glMultiTexCoord2f(int target, float s, float t) { jogl.glMultiTexCoord2f(target, s, t); } } --- NEW FILE: Jsr231GL.java --- package jake2.render.opengl; import java.nio.*; import javax.media.opengl.GL; public class Jsr231GL implements QGL { private GL gl; Jsr231GL() { // singleton } void setGL(GL gl) { this.gl = gl; } public void glAlphaFunc(int func, float ref) { gl.glAlphaFunc(func, ref); } public void glBegin(int mode) { gl.glBegin(mode); } public void glBindTexture(int target, int texture) { gl.glBindTexture(target, texture); } public void glBlendFunc(int sfactor, int dfactor) { gl.glBlendFunc(sfactor, dfactor); } public void glClear(int mask) { gl.glClear(mask); } public void glClearColor(float red, float green, float blue, float alpha) { gl.glClearColor(red, green, blue, alpha); } public void glColor3f(float red, float green, float blue) { gl.glColor3f(red, green, blue); } public void glColor3ub(byte red, byte green, byte blue) { gl.glColor3ub(red, green, blue); } public void glColor4f(float red, float green, float blue, float alpha) { gl.glColor4f(red, green, blue, alpha); } public void glColor4ub(byte red, byte green, byte blue, byte alpha) { gl.glColor4ub(red, green, blue, alpha); } public void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) { gl.glColorPointer(size, GL_UNSIGNED_BYTE, stride, pointer); } public void glColorPointer(int size, int stride, FloatBuffer pointer) { gl.glColorPointer(size, GL_FLOAT, stride, pointer); } public void glCullFace(int mode) { gl.glCullFace(mode); } public void glDeleteTextures(IntBuffer textures) { gl.glDeleteTextures(textures.limit(), textures); } public void glDepthFunc(int func) { gl.glDepthFunc(func); } public void glDepthMask(boolean flag) { gl.glDepthMask(flag); } public void glDepthRange(double zNear, double zFar) { gl.glDepthRange(zNear, zFar); } public void glDisable(int cap) { gl.glDisable(cap); } public void glDisableClientState(int cap) { gl.glDisableClientState(cap); } public void glDrawArrays(int mode, int first, int count) { gl.glDrawArrays(mode, first, count); } public void glDrawBuffer(int mode) { gl.glDrawBuffer(mode); } public void glDrawElements(int mode, IntBuffer indices) { gl.glDrawElements(mode, indices.limit(), GL_UNSIGNED_INT, indices); } public void glEnable(int cap) { gl.glEnable(cap); } public void glEnableClientState(int cap) { gl.glEnableClientState(cap); } public void glEnd() { gl.glEnd(); } public void glFinish() { gl.glFinish(); } public void glFlush() { gl.glFlush(); } public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { gl.glFrustum(left, right, bottom, top, zNear, zFar); } public int glGetError() { return gl.glGetError(); } public void glGetFloat(int pname, FloatBuffer params) { gl.glGetFloatv(pname, params); } public String glGetString(int name) { return gl.glGetString(name); } public void glInterleavedArrays(int format, int stride, FloatBuffer pointer) { gl.glInterleavedArrays(format, stride, pointer); } public void glLoadIdentity() { gl.glLoadIdentity(); } public void glLoadMatrix(FloatBuffer m) { gl.glLoadMatrixf(m); } public void glMatrixMode(int mode) { gl.glMatrixMode(mode); } public void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar) { gl.glOrtho(left, right, bottom, top, zNear, zFar); } public void glPixelStorei(int pname, int param) { gl.glPixelStorei(pname, param); } public void glPointSize(float size) { gl.glPointSize(size); } public void glPolygonMode(int face, int mode) { gl.glPolygonMode(face, mode); } public void glPopMatrix() { gl.glPopMatrix(); } public void glPushMatrix() { gl.glPushMatrix(); } public void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) { gl.glReadPixels(x, y, width, height, format, type, pixels); } public void glRotatef(float angle, float x, float y, float z) { gl.glRotatef(angle, x, y, z); } public void glScalef(float x, float y, float z) { gl.glScalef(x, y, z); } public void glScissor(int x, int y, int width, int height) { gl.glScissor(x, y, width, height); } public void glShadeModel(int mode) { gl.glShadeModel(mode); } public void glTexCoord2f(float s, float t) { gl.glTexCoord2f(s, t); } public void glTexCoordPointer(int size, int stride, FloatBuffer pointer) { gl.glTexCoordPointer(size, GL_FLOAT, stride, pointer); } public void glTexEnvi(int target, int pname, int param) { gl.glTexEnvi(target, pname, param); } public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) { gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) { gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } public void glTexParameterf(int target, int pname, float param) { gl.glTexParameterf(target, pname, param); } public void glTexParameteri(int target, int pname, int param) { gl.glTexParameteri(target, pname, param); } public void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) { gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); } public void glTranslatef(float x, float y, float z) { gl.glTranslatef(x, y, z); } public void glVertex2f(float x, float y) { gl.glVertex2f(x, y); } public void glVertex3f(float x, float y, float z) { gl.glVertex3f(x, y, z); } public void glVertexPointer(int size, int stride, FloatBuffer pointer) { gl.glVertexPointer(size, GL_FLOAT, stride, pointer); } public void glViewport(int x, int y, int width, int height) { gl.glViewport(x, y, width, height); } public void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { gl.glColorTable(target, internalFormat, width, format, type, data); } public void glActiveTextureARB(int texture) { gl.glActiveTexture(texture); } public void glClientActiveTextureARB(int texture) { gl.glClientActiveTexture(texture); } public void glPointParameterEXT(int pname, FloatBuffer pfParams) { gl.glPointParameterfvEXT(pname, pfParams); } public void glPointParameterfEXT(int pname, float param) { gl.glPointParameterfEXT(pname, param); } public void glLockArraysEXT(int first, int count) { gl.glLockArraysEXT(first, count); } public void glArrayElement(int index) { gl.glArrayElement(index); } public void glUnlockArraysEXT() { gl.glUnlockArraysEXT(); } public void glMultiTexCoord2f(int target, float s, float t) { gl.glMultiTexCoord2f(target, s, t); } } --- NEW FILE: QGLConst.java --- package jake2.render.opengl; public interface QGLConst { /* * alpha functions */ public static final int GL_NEVER = 0x0200; public static final int GL_LESS = 0x0201; public static final int GL_EQUAL = 0x0202; public static final int GL_LEQUAL = 0x0203; public static final int GL_GREATER = 0x0204; public static final int GL_NOTEQUAL = 0x0205; public static final int GL_GEQUAL = 0x0206; public static final int GL_ALWAYS = 0x0207; /* * attribute masks */ public static final int GL_DEPTH_BUFFER_BIT = 0x00000100; public static final int GL_STENCIL_BUFFER_BIT = 0x00000400; public static final int GL_COLOR_BUFFER_BIT = 0x00004000; /* * begin modes */ public static final int GL_POINTS = 0x0000; public static final int GL_LINES = 0x0001; public static final int GL_LINE_LOOP = 0x0002; public static final int GL_LINE_STRIP = 0x0003; public static final int GL_TRIANGLES = 0x0004; public static final int GL_TRIANGLE_STRIP = 0x0005; public static final int GL_TRIANGLE_FAN = 0x0006; public static final int GL_QUADS = 0x0007; public static final int GL_QUAD_STRIP = 0x0008; public static final int GL_POLYGON = 0x0009; /* * blending factors */ public static final int GL_ZERO = 0; public static final int GL_ONE = 1; public static final int GL_SRC_COLOR = 0x0300; public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301; public static final int GL_SRC_ALPHA = 0x0302; public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303; public static final int GL_DST_ALPHA = 0x0304; public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305; /* * boolean */ public static final int GL_TRUE = 1; public static final int GL_FALSE = 0; /* * data types */ public static final int GL_BYTE = 0x1400; public static final int GL_UNSIGNED_BYTE = 0x1401; public static final int GL_SHORT = 0x1402; public static final int GL_UNSIGNED_SHORT = 0x1403; public static final int GL_INT = 0x1404; public static final int GL_UNSIGNED_INT = 0x1405; public static final int GL_FLOAT = 0x1406; /* * draw buffer modes */ public static final int GL_FRONT = 0x0404; public static final int GL_BACK = 0x0405; public static final int GL_FRONT_AND_BACK = 0x0408; /* * errors */ public static final int GL_NO_ERROR = 0; public static final int GL_POINT_SMOOTH = 0x0B10; public static final int GL_CULL_FACE = 0x0B44; public static final int GL_DEPTH_TEST = 0x0B71; public static final int GL_MODELVIEW_MATRIX = 0x0BA6; public static final int GL_ALPHA_TEST = 0x0BC0; public static final int GL_BLEND = 0x0BE2; public static final int GL_SCISSOR_TEST = 0x0C11; public static final int GL_PACK_ALIGNMENT = 0x0D05; public static final int GL_TEXTURE_2D = 0x0DE1; /* * hint modes */ public static final int GL_DONT_CARE = 0x1100; public static final int GL_FASTEST = 0x1101; public static final int GL_NICEST = 0x1102; /* * matrix modes */ public static final int GL_MODELVIEW = 0x1700; public static final int GL_PROJECTION = 0x1701; /* * pixel formats */ public static final int GL_COLOR_INDEX = 0x1900; public static final int GL_RED = 0x1903; public static final int GL_GREEN = 0x1904; public static final int GL_BLUE = 0x1905; public static final int GL_ALPHA = 0x1906; public static final int GL_RGB = 0x1907; public static final int GL_RGBA = 0x1908; public static final int GL_LUMINANCE = 0x1909; public static final int GL_LUMINANCE_ALPHA = 0x190A; /* * polygon modes */ public static final int GL_POINT = 0x1B00; public static final int GL_LINE = 0x1B01; public static final int GL_FILL = 0x1B02; /* * shading models */ public static final int GL_FLAT = 0x1D00; public static final int GL_SMOOTH = 0x1D01; public static final int GL_REPLACE = 0x1E01; /* * string names */ public static final int GL_VENDOR = 0x1F00; public static final int GL_RENDERER = 0x1F01; public static final int GL_VERSION = 0x1F02; public static final int GL_EXTENSIONS = 0x1F03; /* * TextureEnvMode */ public static final int GL_MODULATE = 0x2100; /* * TextureEnvParameter */ public static final int GL_TEXTURE_ENV_MODE = 0x2200; public static final int GL_TEXTURE_ENV_COLOR = 0x2201; /* * TextureEnvTarget */ public static final int GL_TEXTURE_ENV = 0x2300; public static final int GL_NEAREST = 0x2600; public static final int GL_LINEAR = 0x2601; public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700; public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701; public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702; public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703; /* * TextureParameterName */ public static final int GL_TEXTURE_MAG_FILTER = 0x2800; public static final int GL_TEXTURE_MIN_FILTER = 0x2801; public static final int GL_TEXTURE_WRAP_S = 0x2802; public static final int GL_TEXTURE_WRAP_T = 0x2803; /* * TextureWrapMode */ public static final int GL_CLAMP = 0x2900; public static final int GL_REPEAT = 0x2901; /* * texture */ public static final int GL_LUMINANCE8 = 0x8040; public static final int GL_INTENSITY8 = 0x804B; public static final int GL_R3_G3_B2 = 0x2A10; public static final int GL_RGB4 = 0x804F; public static final int GL_RGB5 = 0x8050; public static final int GL_RGB8 = 0x8051; public static final int GL_RGBA2 = 0x8055; public static final int GL_RGBA4 = 0x8056; public static final int GL_RGB5_A1 = 0x8057; public static final int GL_RGBA8 = 0x8058; /* * vertex arrays */ public static final int GL_VERTEX_ARRAY = 0x8074; public static final int GL_COLOR_ARRAY = 0x8076; public static final int GL_TEXTURE_COORD_ARRAY = 0x8078; public static final int GL_T2F_V3F = 0x2A27; /* * OpenGL 1.2, 1.3 constants */ public static final int GL_SHARED_TEXTURE_PALETTE_EXT = 0x81FB; public static final int GL_TEXTURE0 = 0x84C0; public static final int GL_TEXTURE1 = 0x84C1; public static final int GL_TEXTURE0_ARB = 0x84C0; public static final int GL_TEXTURE1_ARB = 0x84C1; public static final int GL_BGR = 0x80E0; public static final int GL_BGRA = 0x80E1; /* * point parameters */ public static final int GL_POINT_SIZE_MIN_EXT = 0x8126; public static final int GL_POINT_SIZE_MAX_EXT = 0x8127; public static final int GL_POINT_FADE_THRESHOLD_SIZE_EXT = 0x8128; public static final int GL_DISTANCE_ATTENUATION_EXT = 0x8129; } --- NEW FILE: Jsr231Driver.java --- /* * JoglCommon.java * Copyright (C) 2004 * * $Id: Jsr231Driver.java,v 1.1.2.1 2005/11/14 23:49:40 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.render.opengl; import jake2.Defines; import jake2.client.VID; import jake2.qcommon.Cbuf; import jake2.qcommon.xcommand_t; import jake2.render.Base; import jake2.sys.JOGLKBD; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.LinkedList; import javax.media.opengl.*; import javax.swing.ImageIcon; import javax.swing.JFrame; /** * JoglCommon */ public class Jsr231Driver extends Jsr231GL implements GLDriver { protected Jsr231Driver() { // singleton } private GraphicsDevice device; private DisplayMode oldDisplayMode; private Display display; JFrame window; // window position on the screen int window_xpos, window_ypos; public DisplayMode[] getModeList() { DisplayMode[] modes = device.getDisplayModes(); LinkedList l = new LinkedList(); l.add(oldDisplayMode); for (int i = 0; i < modes.length; i++) { DisplayMode m = modes[i]; if (m.getBitDepth() != oldDisplayMode.getBitDepth()) continue; if (m.getRefreshRate() > oldDisplayMode.getRefreshRate()) continue; if (m.getHeight() < 240 || m.getWidth() < 320) continue; int j = 0; DisplayMode ml = null; for (j = 0; j < l.size(); j++) { ml = (DisplayMode)l.get(j); if (ml.getWidth() > m.getWidth()) break; if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; } if (j == l.size()) { l.addLast(m); } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { l.add(j, m); } else if (m.getRefreshRate() > ml.getRefreshRate()){ l.remove(j); l.add(j, m); } } DisplayMode[] ma = new DisplayMode[l.size()]; l.toArray(ma); return ma; } DisplayMode findDisplayMode(Dimension dim) { DisplayMode mode = null; DisplayMode m = null; DisplayMode[] modes = getModeList(); int w = dim.width; int h = dim.height; for (int i = 0; i < modes.length; i++) { m = modes[i]; if (m.getWidth() == w && m.getHeight() == h) { mode = m; break; } } if (mode == null) mode = oldDisplayMode; return mode; } String getModeString(DisplayMode m) { StringBuffer sb = new StringBuffer(); sb.append(m.getWidth()); sb.append('x'); sb.append(m.getHeight()); sb.append('x'); sb.append(m.getBitDepth()); sb.append('@'); sb.append(m.getRefreshRate()); sb.append("Hz"); return sb.toString(); } /** * @param dim * @param mode * @param fullscreen * @return enum Base.rserr_t */ public int setMode(Dimension dim, int mode, boolean fullscreen) { Dimension newDim = new Dimension(); VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); /* * fullscreen handling */ GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); device = env.getDefaultScreenDevice(); if (oldDisplayMode == null) { oldDisplayMode = device.getDisplayMode(); } if (!VID.GetModeInfo(newDim, mode)) { VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); return Base.rserr_invalid_mode; } VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); // destroy the existing window shutdown(); window = new JFrame("Jake2 (jsr231)"); ImageIcon icon = new ImageIcon(getClass().getResource("/icon-small.png")); window.setIconImage(icon.getImage()); Display canvas = new Display(); // we want keypressed events for TAB key canvas.setFocusTraversalKeysEnabled(false); window.getContentPane().add(canvas); canvas.setSize(newDim.width, newDim.height); // register event listener window.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { Cbuf.ExecuteText(Defines.EXEC_APPEND, "quit"); } }); // D I F F E R E N T J A K E 2 E V E N T P R O C E S S I N G window.addComponentListener(JOGLKBD.listener); canvas.addKeyListener(JOGLKBD.listener); canvas.addMouseListener(JOGLKBD.listener); canvas.addMouseMotionListener(JOGLKBD.listener); canvas.addMouseWheelListener(JOGLKBD.listener); if (fullscreen) { DisplayMode displayMode = findDisplayMode(newDim); newDim.width = displayMode.getWidth(); newDim.height = displayMode.getHeight(); window.setUndecorated(true); window.setResizable(false); device.setFullScreenWindow(window); if (device.isFullScreenSupported()) device.setDisplayMode(displayMode); window.setLocation(0, 0); window.setSize(displayMode.getWidth(), displayMode.getHeight()); canvas.setSize(displayMode.getWidth(), displayMode.getHeight()); VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); } else { window.setLocation(window_xpos, window_ypos); window.pack(); window.setResizable(false); window.setVisible(true); } while (!canvas.isDisplayable()) { try { Thread.sleep(50); } catch (InterruptedException e) {} } canvas.requestFocus(); this.display = canvas; Base.setVid(newDim.width, newDim.height); // let the sound and input subsystems know about the new window VID.NewWindow(newDim.width, newDim.height); setGL(display.getGL()); return Base.rserr_ok; } public void shutdown() { if (oldDisplayMode != null && device.getFullScreenWindow() != null) { try { if (device.isFullScreenSupported()) device.setDisplayMode(oldDisplayMode); device.setFullScreenWindow(null); } catch (Exception e) { e.printStackTrace(); } } if (window != null) { display.destroy(); window.dispose(); } } /** * @return true */ public boolean init(int xpos, int ypos) { // set window position window_xpos = xpos; window_ypos = ypos; return true; } public void beginFrame(float camera_separation) { display.activate(); } public void endFrame() { glFlush(); display.update(); } public void appActivate(boolean activate) { // do nothing } public void enableLogging(boolean enable) { // do nothing } public void logNewFrame() { // do nothing } /* * @see jake2.client.refexport_t#updateScreen() */ public void updateScreen(xcommand_t callback) { callback.execute(); } protected void activate() { display.activate(); } // -------------------------------------------------------------------------- private class Display extends Canvas { private GLDrawable drawable; private GLContext context; public Display() { drawable = GLDrawableFactory.getFactory().getGLDrawable(this, new GLCapabilities(), null); context = drawable.createContext(null); } GL getGL() { activate(); return context.getGL(); } public void addNotify() { super.addNotify(); drawable.setRealized(true); } public void removeNotify() { drawable.setRealized(false); super.removeNotify(); } void activate() { if (GLContext.getCurrent() != context) context.makeCurrent(); } private void release() { if (GLContext.getCurrent() == context) context.release(); } void update() { release(); drawable.swapBuffers(); } void destroy() { release(); context.destroy(); drawable.setRealized(false); } } } --- NEW FILE: JoglDriver.java --- /* * JoglCommon.java * Copyright (C) 2004 * * $Id: JoglDriver.java,v 1.1.2.1 2005/11/14 23:49:40 cawe Exp $ */ /* Copyright (C) 1997-2001 Id Software, Inc. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ package jake2.render.opengl; import jake2.Defines; import jake2.client.VID; import jake2.qcommon.Cbuf; import jake2.qcommon.xcommand_t; import jake2.render.Base; import jake2.sys.JOGLKBD; import java.awt.*; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.util.LinkedList; import javax.swing.ImageIcon; import javax.swing.JFrame; import net.java.games.jogl.*; /** * JoglCommon */ public class JoglDriver extends JoglGL implements GLDriver, GLEventListener { protected JoglDriver() { // see JoglRenderer } private GraphicsDevice device; private DisplayMode oldDisplayMode; private GLCanvas canvas; JFrame window; // window position on the screen int window_xpos, window_ypos; // handles the post initialization with JoglRenderer protected boolean post_init = false; protected boolean contextInUse = false; protected final xcommand_t INIT_CALLBACK = new xcommand_t() { public void execute() { // only used for the first run (initialization) // clear the screen glClearColor(0, 0, 0, 0); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // // check the post init process // if (!post_init) { VID.Printf(Defines.PRINT_ALL, "Missing multi-texturing for FastJOGL renderer\n"); } endFrame(); } }; xcommand_t callback = INIT_CALLBACK; public DisplayMode[] getModeList() { DisplayMode[] modes = device.getDisplayModes(); LinkedList l = new LinkedList(); l.add(oldDisplayMode); for (int i = 0; i < modes.length; i++) { DisplayMode m = modes[i]; if (m.getBitDepth() != oldDisplayMode.getBitDepth()) continue; if (m.getRefreshRate() > oldDisplayMode.getRefreshRate()) continue; if (m.getHeight() < 240 || m.getWidth() < 320) continue; int j = 0; DisplayMode ml = null; for (j = 0; j < l.size(); j++) { ml = (DisplayMode)l.get(j); if (ml.getWidth() > m.getWidth()) break; if (ml.getWidth() == m.getWidth() && ml.getHeight() >= m.getHeight()) break; } if (j == l.size()) { l.addLast(m); } else if (ml.getWidth() > m.getWidth() || ml.getHeight() > m.getHeight()) { l.add(j, m); } else if (m.getRefreshRate() > ml.getRefreshRate()){ l.remove(j); l.add(j, m); } } DisplayMode[] ma = new DisplayMode[l.size()]; l.toArray(ma); return ma; } DisplayMode findDisplayMode(Dimension dim) { DisplayMode mode = null; DisplayMode m = null; DisplayMode[] modes = getModeList(); int w = dim.width; int h = dim.height; for (int i = 0; i < modes.length; i++) { m = modes[i]; if (m.getWidth() == w && m.getHeight() == h) { mode = m; break; } } if (mode == null) mode = oldDisplayMode; return mode; } String getModeString(DisplayMode m) { StringBuffer sb = new StringBuffer(); sb.append(m.getWidth()); sb.append('x'); sb.append(m.getHeight()); sb.append('x'); sb.append(m.getBitDepth()); sb.append('@'); sb.append(m.getRefreshRate()); sb.append("Hz"); return sb.toString(); } /** * @param dim * @param mode * @param fullscreen * @return enum Base.rserr_t */ public int setMode(Dimension dim, int mode, boolean fullscreen) { Dimension newDim = new Dimension(); VID.Printf(Defines.PRINT_ALL, "Initializing OpenGL display\n"); VID.Printf(Defines.PRINT_ALL, "...setting mode " + mode + ":"); /* * fullscreen handling */ GraphicsEnvironment env = GraphicsEnvironment.getLocalGraphicsEnvironment(); device = env.getDefaultScreenDevice(); if (oldDisplayMode == null) { oldDisplayMode = device.getDisplayMode(); } if (!VID.GetModeInfo(newDim, mode)) { VID.Printf(Defines.PRINT_ALL, " invalid mode\n"); return Base.rserr_invalid_mode; } VID.Printf(Defines.PRINT_ALL, " " + newDim.width + " " + newDim.height + '\n'); // destroy the existing window shutdown(); window = new JFrame("Jake2 (jogl)"); ImageIcon icon = new ImageIcon(getClass().getResource("/icon-small.png")); window.setIconImage(icon.getImage()); GLCanvas canvas = GLDrawableFactory.getFactory().createGLCanvas(new GLCapabilities()); // we want keypressed events for TAB key canvas.setFocusTraversalKeysEnabled(false); // TODO Use debug pipeline //canvas.setGL(new DebugGL(canvas.getGL())); canvas.setNoAutoRedrawMode(true); canvas.setAutoSwapBufferMode(false); canvas.addGLEventListener(this); window.getContentPane().add(canvas); canvas.setSize(newDim.width, newDim.height); // register event listener window.addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { Cbuf.ExecuteText(Defines.EXEC_APPEND, "quit"); } }); // D I F F E R E N T J A K E 2 E V E N T P R O C E S S I N G window.addComponentListener(JOGLKBD.listener); canvas.addKeyListener(JOGLKBD.listener); canvas.addMouseListener(JOGLKBD.listener); canvas.addMouseMotionListener(JOGLKBD.listener); canvas.addMouseWheelListener(JOGLKBD.listener); if (fullscreen) { DisplayMode displayMode = findDisplayMode(newDim); newDim.width = displayMode.getWidth(); newDim.height = displayMode.getHeight(); window.setUndecorated(true); window.setResizable(false); device.setFullScreenWindow(window); if (device.isFullScreenSupported()) device.setDisplayMode(displayMode); window.setLocation(0, 0); window.setSize(displayMode.getWidth(), displayMode.getHeight()); canvas.setSize(displayMode.getWidth(), displayMode.getHeight()); VID.Printf(Defines.PRINT_ALL, "...setting fullscreen " + getModeString(displayMode) + '\n'); } else { window.setLocation(window_xpos, window_ypos); window.pack(); window.setResizable(false); window.setVisible(true); } while (!canvas.isDisplayable()) { try { Thread.sleep(50); } catch (InterruptedException e) {} } canvas.requestFocus(); this.canvas = canvas; Base.setVid(newDim.width, newDim.height); // let the sound and input subsystems know about the new window VID.NewWindow(newDim.width, newDim.height); return Base.rserr_ok; } public void shutdown() { if (oldDisplayMode != null && device.getFullScreenWindow() != null) { try { if (device.isFullScre... [truncated message content] |
From: Carsten W. <ca...@us...> - 2005-11-14 23:48:43
|
Update of /cvsroot/jake2/jake2/src/jake2/render/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32284/src/jake2/render/opengl Log Message: Directory /cvsroot/jake2/jake2/src/jake2/render/opengl added to the repository --> Using per-directory sticky tag `render-refactoring' |
From: Carsten W. <ca...@us...> - 2005-11-13 13:36:10
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14163/src/jake2/qcommon Modified Files: Com.java FS.java Log Message: up merge from branch render-refactoring code cleanup. use Defines instead of Globals (Defines contains all constants) Index: FS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/FS.java,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** FS.java 26 May 2005 16:56:32 -0000 1.14 --- FS.java 13 Nov 2005 13:36:00 -0000 1.15 *************** *** 26,29 **** --- 26,30 ---- package jake2.qcommon; + import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; *************** *** 204,208 **** File file = new File(pak.filename); if (!file.canRead()) { ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); } --- 205,209 ---- File file = new File(pak.filename); if (!file.canRead()) { ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); } *************** *** 279,283 **** file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { --- 280,284 ---- file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { *************** *** 332,342 **** read = f.read(buffer, offset, block); } catch (IOException e) { ! Com.Error(Globals.ERR_FATAL, e.toString()); } if (read == 0) { ! Com.Error(Globals.ERR_FATAL, "FS_Read: 0 bytes read"); } else if (read == -1) { ! Com.Error(Globals.ERR_FATAL, "FS_Read: -1 bytes read"); } // --- 333,343 ---- read = f.read(buffer, offset, block); } catch (IOException e) { ! Com.Error(Defines.ERR_FATAL, e.toString()); } if (read == 0) { ! Com.Error(Defines.ERR_FATAL, "FS_Read: 0 bytes read"); } else if (read == -1) { ! Com.Error(Defines.ERR_FATAL, "FS_Read: -1 bytes read"); } // *************** *** 378,382 **** file.close(); } catch (IOException e) { ! Com.Error(Globals.ERR_FATAL, e.toString()); } return buf; --- 379,383 ---- file.close(); } catch (IOException e) { ! Com.Error(Defines.ERR_FATAL, e.toString()); } return buf; *************** *** 443,447 **** file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { --- 444,448 ---- file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { *************** *** 548,557 **** if (header.ident != IDPAKHEADER) ! Com.Error(Globals.ERR_FATAL, packfile + " is not a packfile"); numpackfiles = header.dirlen / packfile_t.SIZE; if (numpackfiles > MAX_FILES_IN_PACK) ! Com.Error(Globals.ERR_FATAL, packfile + " has " + numpackfiles + " files"); --- 549,558 ---- if (header.ident != IDPAKHEADER) ! Com.Error(Defines.ERR_FATAL, packfile + " is not a packfile"); numpackfiles = header.dirlen / packfile_t.SIZE; if (numpackfiles > MAX_FILES_IN_PACK) ! Com.Error(Defines.ERR_FATAL, packfile + " has " + numpackfiles + " files"); *************** *** 670,675 **** } ! int canthave = Globals.SFF_SUBDIR | Globals.SFF_HIDDEN ! | Globals.SFF_SYSTEM; if (Sys.FindAll(name, 0, canthave) != null) { --- 671,676 ---- } ! int canthave = Defines.SFF_SUBDIR | Defines.SFF_HIDDEN ! | Defines.SFF_SYSTEM; if (Sys.FindAll(name, 0, canthave) != null) { Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** Com.java 11 Jun 2005 17:21:21 -0000 1.12 --- Com.java 13 Nov 2005 13:36:00 -0000 1.13 *************** *** 274,278 **** public void execute() throws longjmpException { ! Error(Globals.ERR_FATAL, Cmd.Argv(1)); } }; --- 274,278 ---- public void execute() throws longjmpException { ! Error(Defines.ERR_FATAL, Cmd.Argv(1)); } }; *************** *** 326,332 **** { ! if (args.length > Globals.MAX_NUM_ARGVS) { ! Com.Error(Globals.ERR_FATAL, "argc > MAX_NUM_ARGVS"); } --- 326,332 ---- { ! if (args.length > Defines.MAX_NUM_ARGVS) { ! Com.Error(Defines.ERR_FATAL, "argc > MAX_NUM_ARGVS"); } *************** *** 334,338 **** for (int i= 0; i < Com.com_argc; i++) { ! if (args[i].length() >= Globals.MAX_TOKEN_CHARS) Com.com_argv[i]= ""; else --- 334,338 ---- for (int i= 0; i < Com.com_argc; i++) { ! if (args[i].length() >= Defines.MAX_TOKEN_CHARS) Com.com_argv[i]= ""; else |
From: Carsten W. <ca...@us...> - 2005-11-13 13:36:10
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14163/src/jake2/game Modified Files: Cmd.java Log Message: up merge from branch render-refactoring code cleanup. use Defines instead of Globals (Defines contains all constants) Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** Cmd.java 13 Mar 2005 20:52:05 -0000 1.13 --- Cmd.java 13 Nov 2005 13:36:00 -0000 1.14 *************** *** 96,100 **** String s = Cmd.Argv(1); ! if (s.length() > Globals.MAX_ALIAS_NAME) { Com.Printf("Alias name is too long\n"); return; --- 96,100 ---- String s = Cmd.Argv(1); ! if (s.length() > Defines.MAX_ALIAS_NAME) { Com.Printf("Alias name is too long\n"); return; *************** *** 1108,1112 **** cl.flood_locktill = GameBase.level.time + GameBase.flood_waitdelay.value; ! SV_GAME.PF_cprintf(ent, Globals.PRINT_CHAT, "Flood protection: You can't talk for " + (int) GameBase.flood_waitdelay.value --- 1108,1112 ---- cl.flood_locktill = GameBase.level.time + GameBase.flood_waitdelay.value; ! SV_GAME.PF_cprintf(ent, Defines.PRINT_CHAT, "Flood protection: You can't talk for " + (int) GameBase.flood_waitdelay.value |
From: Carsten W. <ca...@us...> - 2005-11-13 13:36:10
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14163/src/jake2/client Modified Files: VID.java Log Message: up merge from branch render-refactoring code cleanup. use Defines instead of Globals (Defines contains all constants) Index: VID.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/VID.java,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** VID.java 26 May 2005 16:56:33 -0000 1.16 --- VID.java 13 Nov 2005 13:36:00 -0000 1.17 *************** *** 285,289 **** * drop the console if we fail to load a refresh */ ! if ( Globals.cls.key_dest != Globals.key_console ) { try { --- 285,289 ---- * drop the console if we fail to load a refresh */ ! if ( Globals.cls.key_dest != Defines.key_console ) { try { |
From: Carsten W. <ca...@us...> - 2005-11-13 13:10:09
|
Update of /cvsroot/jake2/jake2/lib/jsr231/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5570/lib/jsr231/windows Modified Files: Tag: render-refactoring jogl_cg.dll jogl.dll Added Files: Tag: render-refactoring jogl_awt.dll Log Message: new jogl libs (jsr231 build 12.11.2005) with current API changes --- NEW FILE: jogl_awt.dll --- (This appears to be a binary file; contents omitted.) Index: jogl_cg.dll =================================================================== RCS file: /cvsroot/jake2/jake2/lib/jsr231/windows/Attic/jogl_cg.dll,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Binary files /tmp/cvsiwvm97 and /tmp/cvsrWAizT differ Index: jogl.dll =================================================================== RCS file: /cvsroot/jake2/jake2/lib/jsr231/windows/Attic/jogl.dll,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Binary files /tmp/cvsEv6HZb and /tmp/cvs68ShvX differ |
From: Carsten W. <ca...@us...> - 2005-11-13 13:10:09
|
Update of /cvsroot/jake2/jake2/lib/jsr231/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5570/lib/jsr231/linux Modified Files: Tag: render-refactoring libjogl.so libjogl_cg.so Added Files: Tag: render-refactoring libjogl_awt.so Log Message: new jogl libs (jsr231 build 12.11.2005) with current API changes Index: libjogl.so =================================================================== RCS file: /cvsroot/jake2/jake2/lib/jsr231/linux/Attic/libjogl.so,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Binary files /tmp/cvsM8Aghl and /tmp/cvsEZwrg7 differ Index: libjogl_cg.so =================================================================== RCS file: /cvsroot/jake2/jake2/lib/jsr231/linux/Attic/libjogl_cg.so,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Binary files /tmp/cvsv1sT3r and /tmp/cvsnN37fe differ --- NEW FILE: libjogl_awt.so --- (This appears to be a binary file; contents omitted.) |
From: Carsten W. <ca...@us...> - 2005-11-13 13:10:08
|
Update of /cvsroot/jake2/jake2/lib/jsr231 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5570/lib/jsr231 Modified Files: Tag: render-refactoring jogl.jar Log Message: new jogl libs (jsr231 build 12.11.2005) with current API changes Index: jogl.jar =================================================================== RCS file: /cvsroot/jake2/jake2/lib/jsr231/Attic/jogl.jar,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 Binary files /tmp/cvsWFU17t and /tmp/cvsPO12zg differ |
From: Carsten W. <ca...@us...> - 2005-11-13 12:58:04
|
Update of /cvsroot/jake2/jake2/src/jake2/game In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4443/src/jake2/game Modified Files: Tag: render-refactoring Cmd.java Log Message: code cleanup. use Defines instead of Globals (Defines contains all constants) Index: Cmd.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/game/Cmd.java,v retrieving revision 1.13 retrieving revision 1.13.6.1 diff -C2 -d -r1.13 -r1.13.6.1 *** Cmd.java 13 Mar 2005 20:52:05 -0000 1.13 --- Cmd.java 13 Nov 2005 12:57:56 -0000 1.13.6.1 *************** *** 96,100 **** String s = Cmd.Argv(1); ! if (s.length() > Globals.MAX_ALIAS_NAME) { Com.Printf("Alias name is too long\n"); return; --- 96,100 ---- String s = Cmd.Argv(1); ! if (s.length() > Defines.MAX_ALIAS_NAME) { Com.Printf("Alias name is too long\n"); return; *************** *** 1108,1112 **** cl.flood_locktill = GameBase.level.time + GameBase.flood_waitdelay.value; ! SV_GAME.PF_cprintf(ent, Globals.PRINT_CHAT, "Flood protection: You can't talk for " + (int) GameBase.flood_waitdelay.value --- 1108,1112 ---- cl.flood_locktill = GameBase.level.time + GameBase.flood_waitdelay.value; ! SV_GAME.PF_cprintf(ent, Defines.PRINT_CHAT, "Flood protection: You can't talk for " + (int) GameBase.flood_waitdelay.value |
From: Carsten W. <ca...@us...> - 2005-11-13 12:58:04
|
Update of /cvsroot/jake2/jake2/src/jake2/client In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4443/src/jake2/client Modified Files: Tag: render-refactoring VID.java Log Message: code cleanup. use Defines instead of Globals (Defines contains all constants) Index: VID.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/client/VID.java,v retrieving revision 1.16 retrieving revision 1.16.4.1 diff -C2 -d -r1.16 -r1.16.4.1 *** VID.java 26 May 2005 16:56:33 -0000 1.16 --- VID.java 13 Nov 2005 12:57:56 -0000 1.16.4.1 *************** *** 285,289 **** * drop the console if we fail to load a refresh */ ! if ( Globals.cls.key_dest != Globals.key_console ) { try { --- 285,289 ---- * drop the console if we fail to load a refresh */ ! if ( Globals.cls.key_dest != Defines.key_console ) { try { |
From: Carsten W. <ca...@us...> - 2005-11-13 12:58:04
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4443/src/jake2/qcommon Modified Files: Tag: render-refactoring FS.java Com.java Log Message: code cleanup. use Defines instead of Globals (Defines contains all constants) Index: FS.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/FS.java,v retrieving revision 1.14 retrieving revision 1.14.4.1 diff -C2 -d -r1.14 -r1.14.4.1 *** FS.java 26 May 2005 16:56:32 -0000 1.14 --- FS.java 13 Nov 2005 12:57:56 -0000 1.14.4.1 *************** *** 26,29 **** --- 26,30 ---- package jake2.qcommon; + import jake2.Defines; import jake2.Globals; import jake2.game.Cmd; *************** *** 204,208 **** File file = new File(pak.filename); if (!file.canRead()) { ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); } --- 205,209 ---- File file = new File(pak.filename); if (!file.canRead()) { ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); } *************** *** 279,283 **** file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { --- 280,284 ---- file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { *************** *** 332,342 **** read = f.read(buffer, offset, block); } catch (IOException e) { ! Com.Error(Globals.ERR_FATAL, e.toString()); } if (read == 0) { ! Com.Error(Globals.ERR_FATAL, "FS_Read: 0 bytes read"); } else if (read == -1) { ! Com.Error(Globals.ERR_FATAL, "FS_Read: -1 bytes read"); } // --- 333,343 ---- read = f.read(buffer, offset, block); } catch (IOException e) { ! Com.Error(Defines.ERR_FATAL, e.toString()); } if (read == 0) { ! Com.Error(Defines.ERR_FATAL, "FS_Read: 0 bytes read"); } else if (read == -1) { ! Com.Error(Defines.ERR_FATAL, "FS_Read: -1 bytes read"); } // *************** *** 378,382 **** file.close(); } catch (IOException e) { ! Com.Error(Globals.ERR_FATAL, e.toString()); } return buf; --- 379,383 ---- file.close(); } catch (IOException e) { ! Com.Error(Defines.ERR_FATAL, e.toString()); } return buf; *************** *** 443,447 **** file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Globals.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { --- 444,448 ---- file = new File(pak.filename); if (!file.canRead()) ! Com.Error(Defines.ERR_FATAL, "Couldn't reopen " + pak.filename); if (pak.handle == null || !pak.handle.getFD().valid()) { *************** *** 548,557 **** if (header.ident != IDPAKHEADER) ! Com.Error(Globals.ERR_FATAL, packfile + " is not a packfile"); numpackfiles = header.dirlen / packfile_t.SIZE; if (numpackfiles > MAX_FILES_IN_PACK) ! Com.Error(Globals.ERR_FATAL, packfile + " has " + numpackfiles + " files"); --- 549,558 ---- if (header.ident != IDPAKHEADER) ! Com.Error(Defines.ERR_FATAL, packfile + " is not a packfile"); numpackfiles = header.dirlen / packfile_t.SIZE; if (numpackfiles > MAX_FILES_IN_PACK) ! Com.Error(Defines.ERR_FATAL, packfile + " has " + numpackfiles + " files"); *************** *** 670,675 **** } ! int canthave = Globals.SFF_SUBDIR | Globals.SFF_HIDDEN ! | Globals.SFF_SYSTEM; if (Sys.FindAll(name, 0, canthave) != null) { --- 671,676 ---- } ! int canthave = Defines.SFF_SUBDIR | Defines.SFF_HIDDEN ! | Defines.SFF_SYSTEM; if (Sys.FindAll(name, 0, canthave) != null) { Index: Com.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/Com.java,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -C2 -d -r1.12 -r1.12.4.1 *** Com.java 11 Jun 2005 17:21:21 -0000 1.12 --- Com.java 13 Nov 2005 12:57:56 -0000 1.12.4.1 *************** *** 274,278 **** public void execute() throws longjmpException { ! Error(Globals.ERR_FATAL, Cmd.Argv(1)); } }; --- 274,278 ---- public void execute() throws longjmpException { ! Error(Defines.ERR_FATAL, Cmd.Argv(1)); } }; *************** *** 326,332 **** { ! if (args.length > Globals.MAX_NUM_ARGVS) { ! Com.Error(Globals.ERR_FATAL, "argc > MAX_NUM_ARGVS"); } --- 326,332 ---- { ! if (args.length > Defines.MAX_NUM_ARGVS) { ! Com.Error(Defines.ERR_FATAL, "argc > MAX_NUM_ARGVS"); } *************** *** 334,338 **** for (int i= 0; i < Com.com_argc; i++) { ! if (args[i].length() >= Globals.MAX_TOKEN_CHARS) Com.com_argv[i]= ""; else --- 334,338 ---- for (int i= 0; i < Com.com_argc; i++) { ! if (args[i].length() >= Defines.MAX_TOKEN_CHARS) Com.com_argv[i]= ""; else |
From: Carsten W. <ca...@us...> - 2005-10-31 16:37:34
|
Update of /cvsroot/jake2/jake2/lib/jsr231 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263/lib/jsr231 Added Files: Tag: render-refactoring jogl.jar Log Message: experimental jsr231 (javax.media.opengl API) --- NEW FILE: jogl.jar --- (This appears to be a binary file; contents omitted.) |
From: Carsten W. <ca...@us...> - 2005-10-31 16:37:33
|
Update of /cvsroot/jake2/jake2/lib/jsr231/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263/lib/jsr231/windows Added Files: Tag: render-refactoring jogl_cg.dll jogl.dll Log Message: experimental jsr231 (javax.media.opengl API) --- NEW FILE: jogl_cg.dll --- (This appears to be a binary file; contents omitted.) --- NEW FILE: jogl.dll --- (This appears to be a binary file; contents omitted.) |
From: Carsten W. <ca...@us...> - 2005-10-31 16:37:33
|
Update of /cvsroot/jake2/jake2/lib/jsr231/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27263/lib/jsr231/linux Added Files: Tag: render-refactoring libjogl.so libjogl_cg.so Log Message: experimental jsr231 (javax.media.opengl API) --- NEW FILE: libjogl.so --- (This appears to be a binary file; contents omitted.) --- NEW FILE: libjogl_cg.so --- (This appears to be a binary file; contents omitted.) |
From: Carsten W. <ca...@us...> - 2005-10-31 16:32:51
|
Update of /cvsroot/jake2/jake2/lib/jsr231/windows In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27074/lib/jsr231/windows Log Message: Directory /cvsroot/jake2/jake2/lib/jsr231/windows added to the repository |
From: Carsten W. <ca...@us...> - 2005-10-31 16:32:50
|
Update of /cvsroot/jake2/jake2/lib/jsr231/linux In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27074/lib/jsr231/linux Log Message: Directory /cvsroot/jake2/jake2/lib/jsr231/linux added to the repository |
From: Carsten W. <ca...@us...> - 2005-10-31 16:32:50
|
Update of /cvsroot/jake2/jake2/lib/jsr231 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27074/lib/jsr231 Log Message: Directory /cvsroot/jake2/jake2/lib/jsr231 added to the repository --> Using per-directory sticky tag `render-refactoring' |
From: Carsten W. <ca...@us...> - 2005-10-26 12:38:08
|
Update of /cvsroot/jake2/jake2/src/jake2/qcommon In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9454/src/jake2/qcommon Modified Files: netadr_t.java Log Message: solves a bug, reported by Ken Russell from sun. (Problems with jdk1.6 and special network configs) The localhost address was null by calling InetAddress.getByName("localhost").getAddress() see java api doc: InetAddress.getByName(null) is the correct (but strange) method to get the localhost InetAddress. Index: netadr_t.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/qcommon/netadr_t.java,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** netadr_t.java 20 Oct 2004 20:37:32 -0000 1.5 --- netadr_t.java 26 Oct 2005 12:37:58 -0000 1.6 *************** *** 41,45 **** this.port = 0; // any try { ! this.ip = InetAddress.getByName("localhost").getAddress(); } catch (UnknownHostException e) { } --- 41,46 ---- this.port = 0; // any try { ! // localhost / 127.0.0.1 ! this.ip = InetAddress.getByName(null).getAddress(); } catch (UnknownHostException e) { } *************** *** 51,55 **** return InetAddress.getByName("255.255.255.255"); case Defines.NA_LOOPBACK: ! return InetAddress.getByName("localhost"); case Defines.NA_IP: return InetAddress.getByAddress(ip); --- 52,57 ---- return InetAddress.getByName("255.255.255.255"); case Defines.NA_LOOPBACK: ! // localhost / 127.0.0.1 ! return InetAddress.getByName(null); case Defines.NA_IP: return InetAddress.getByAddress(ip); |
From: Carsten W. <ca...@us...> - 2005-10-24 22:50:29
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6422/src/jake2/render Modified Files: Tag: render-refactoring JoglBase.java Log Message: use the JoglGL instance and jogl code path Index: JoglBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglBase.java,v retrieving revision 1.15.2.2 retrieving revision 1.15.2.3 diff -C2 -d -r1.15.2.2 -r1.15.2.3 *** JoglBase.java 24 Oct 2005 22:46:04 -0000 1.15.2.2 --- JoglBase.java 24 Oct 2005 22:50:22 -0000 1.15.2.3 *************** *** 47,51 **** * JoglCommon */ ! public abstract class JoglBase extends jake2.render.fastjogl.Misc implements GLEventListener { // IMPORTED FUNCTIONS --- 47,51 ---- * JoglCommon */ ! public abstract class JoglBase extends jake2.render.jogl.Misc implements GLEventListener { // IMPORTED FUNCTIONS |
From: Carsten W. <ca...@us...> - 2005-10-24 22:48:22
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6000/src/jake2/render/jogl Modified Files: Tag: render-refactoring Base.java Log Message: use the JoglGL instance Index: Base.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Base.java,v retrieving revision 1.2.12.1 retrieving revision 1.2.12.2 diff -C2 -d -r1.2.12.1 -r1.2.12.2 *** Base.java 16 Jul 2005 18:25:37 -0000 1.2.12.1 --- Base.java 24 Oct 2005 22:48:15 -0000 1.2.12.2 *************** *** 241,245 **** protected cvar_t vid_fullscreen; ! protected QGL gl = LwjglGL.getInstance();//DummyGL.getInstance(); // enum rserr_t --- 241,245 ---- protected cvar_t vid_fullscreen; ! protected QGL gl = JoglGL.getInstance();//DummyGL.getInstance(); // enum rserr_t |
From: Carsten W. <ca...@us...> - 2005-10-24 22:47:35
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5816/src/jake2/render/lwjgl Modified Files: Tag: render-refactoring LWJGLBase.java Log Message: only for tests (fastjogl code path with lwjgl impl) Index: LWJGLBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/LWJGLBase.java,v retrieving revision 1.2.6.2 retrieving revision 1.2.6.3 diff -C2 -d -r1.2.6.2 -r1.2.6.3 *** LWJGLBase.java 16 Jul 2005 18:22:37 -0000 1.2.6.2 --- LWJGLBase.java 24 Oct 2005 22:47:28 -0000 1.2.6.3 *************** *** 43,47 **** * @author dsanders/cwei */ ! public abstract class LWJGLBase extends jake2.render.lwjgl.Misc { // IMPORTED FUNCTIONS protected DisplayMode oldDisplayMode; --- 43,47 ---- * @author dsanders/cwei */ ! public abstract class LWJGLBase extends jake2.render.fastjogl.Misc { // IMPORTED FUNCTIONS protected DisplayMode oldDisplayMode; |
From: Carsten W. <ca...@us...> - 2005-10-24 22:46:14
|
Update of /cvsroot/jake2/jake2/src/jake2/render In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5484/src/jake2/render Modified Files: Tag: render-refactoring JoglRenderer.java JoglBase.java FastJoglRenderer.java JoglGL.java Log Message: now JoglGL works with JoglBase Index: JoglRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglRenderer.java,v retrieving revision 1.6.8.1 retrieving revision 1.6.8.2 diff -C2 -d -r1.6.8.1 -r1.6.8.2 *** JoglRenderer.java 10 Jul 2005 17:57:34 -0000 1.6.8.1 --- JoglRenderer.java 24 Oct 2005 22:46:04 -0000 1.6.8.2 *************** *** 40,44 **** * @author cwei */ ! final class JoglRenderer extends JoglGL implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); --- 40,44 ---- * @author cwei */ ! final class JoglRenderer extends JoglBase implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); Index: FastJoglRenderer.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/FastJoglRenderer.java,v retrieving revision 1.4.8.1 retrieving revision 1.4.8.2 diff -C2 -d -r1.4.8.1 -r1.4.8.2 *** FastJoglRenderer.java 10 Jul 2005 17:57:34 -0000 1.4.8.1 --- FastJoglRenderer.java 24 Oct 2005 22:46:04 -0000 1.4.8.2 *************** *** 40,44 **** * @author cwei */ ! final class FastJoglRenderer extends JoglGL implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); --- 40,44 ---- * @author cwei */ ! final class FastJoglRenderer extends JoglBase implements refexport_t, Ref { private JOGLKBD kbd=new JOGLKBD(); Index: JoglBase.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/JoglBase.java,v retrieving revision 1.15.2.1 retrieving revision 1.15.2.2 diff -C2 -d -r1.15.2.1 -r1.15.2.2 *** JoglBase.java 10 Jul 2005 17:57:34 -0000 1.15.2.1 --- JoglBase.java 24 Oct 2005 22:46:04 -0000 1.15.2.2 *************** *** 31,35 **** import jake2.qcommon.Cbuf; import jake2.qcommon.xcommand_t; - import jake2.render.lwjgl.Misc; import jake2.sys.JOGLKBD; --- 31,34 ---- *************** *** 48,52 **** * JoglCommon */ ! public abstract class JoglBase extends Misc implements GLEventListener { // IMPORTED FUNCTIONS --- 47,51 ---- * JoglCommon */ ! public abstract class JoglBase extends jake2.render.fastjogl.Misc implements GLEventListener { // IMPORTED FUNCTIONS *************** *** 56,60 **** JFrame window; - GL gl; GLU glu; GLUT glut = new GLUT(); --- 55,58 ---- *************** *** 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); // --- 69,74 ---- // only used for the first run (initialization) // clear the screen ! gl.glClearColor(0, 0, 0, 0); ! gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); // *************** *** 298,302 **** protected void GLimp_EndFrame() { ! glFlush(); canvas.swapBuffers(); } --- 296,300 ---- protected void GLimp_EndFrame() { ! gl.glFlush(); canvas.swapBuffers(); } *************** *** 322,326 **** */ public void init(GLDrawable drawable) { ! this.gl = drawable.getGL(); this.glu = drawable.getGLU(); --- 320,324 ---- */ public void init(GLDrawable drawable) { ! ((JoglGL)gl).setGL(drawable.getGL()); this.glu = drawable.getGLU(); *************** *** 333,338 **** */ public void display(GLDrawable drawable) { ! this.gl = drawable.getGL(); ! this.glu = drawable.getGLU(); contextInUse = true; --- 331,336 ---- */ public void display(GLDrawable drawable) { ! ((JoglGL)gl).setGL(drawable.getGL()); ! this.glu = drawable.getGLU(); contextInUse = true; Index: JoglGL.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/Attic/JoglGL.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** JoglGL.java 10 Jul 2005 17:51:01 -0000 1.1.2.1 --- JoglGL.java 24 Oct 2005 22:46:04 -0000 1.1.2.2 *************** *** 3,278 **** import java.nio.*; ! public class JoglGL extends JoglBase { ! protected void glAlphaFunc(int func, float ref) { ! gl.glAlphaFunc(func, ref); } ! protected void glBegin(int mode) { ! gl.glBegin(mode); } ! protected void glBindTexture(int target, int texture) { ! gl.glBindTexture(target, texture); } ! protected void glBlendFunc(int sfactor, int dfactor) { ! gl.glBlendFunc(sfactor, dfactor); } ! protected void glClear(int mask) { ! gl.glClear(mask); } ! protected void glClearColor(float red, float green, float blue, float alpha) { ! gl.glClearColor(red, green, blue, alpha); } ! protected void glColor3f(float red, float green, float blue) { ! gl.glColor3f(red, green, blue); } ! protected void glColor3ub(byte red, byte green, byte blue) { ! gl.glColor3ub(red, green, blue); } ! protected void glColor4f(float red, float green, float blue, float alpha) { ! gl.glColor4f(red, green, blue, alpha); } ! protected void glColor4ub(byte red, byte green, byte blue, byte alpha) { ! gl.glColor4ub(red, green, blue, alpha); } ! protected void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) { ! gl.glColorPointer(size, GL_UNSIGNED_BYTE, stride, pointer); } ! protected void glColorPointer(int size, int stride, FloatBuffer pointer) { ! gl.glColorPointer(size, GL_FLOAT, stride, pointer); } ! protected void glCullFace(int mode) { ! gl.glCullFace(mode); } ! protected void glDeleteTextures(IntBuffer textures) { ! gl.glDeleteTextures(textures.limit(), textures); } ! protected void glDepthFunc(int func) { ! gl.glDepthFunc(func); } ! protected void glDepthMask(boolean flag) { ! gl.glDepthMask(flag); } ! protected void glDepthRange(double zNear, double zFar) { ! gl.glDepthRange(zNear, zFar); } ! protected void glDisable(int cap) { ! gl.glDisable(cap); } ! protected void glDisableClientState(int cap) { ! gl.glDisableClientState(cap); } ! protected void glDrawArrays(int mode, int first, int count) { ! gl.glDrawArrays(mode, first, count); } ! protected void glDrawBuffer(int mode) { ! gl.glDrawBuffer(mode); } ! protected void glDrawElements(int mode, IntBuffer indices) { ! gl.glDrawElements(mode, indices.limit(), GL_UNSIGNED_INT, indices); } ! protected void glEnable(int cap) { ! gl.glEnable(cap); } ! protected void glEnableClientState(int cap) { ! gl.glEnableClientState(cap); } ! protected void glEnd() { ! gl.glEnd(); } ! protected void glFinish() { ! gl.glFinish(); } ! protected void glFlush() { ! gl.glFlush(); } ! protected void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { ! gl.glFrustum(left, right, bottom, top, zNear, zFar); } ! protected int glGetError() { ! return gl.glGetError(); } ! protected void glGetFloat(int pname, FloatBuffer params) { ! gl.glGetFloatv(pname, params); } ! protected String glGetString(int name) { ! return gl.glGetString(name); } ! protected void glInterleavedArrays(int format, int stride, FloatBuffer pointer) { ! gl.glInterleavedArrays(format, stride, pointer); } ! protected void glLoadIdentity() { ! gl.glLoadIdentity(); } ! protected void glLoadMatrix(FloatBuffer m) { ! gl.glLoadMatrixf(m); } ! protected void glMatrixMode(int mode) { ! gl.glMatrixMode(mode); } ! protected void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar) { ! gl.glOrtho(left, right, bottom, top, zNear, zFar); } ! protected void glPixelStorei(int pname, int param) { ! gl.glPixelStorei(pname, param); } ! protected void glPointSize(float size) { ! gl.glPointSize(size); } ! protected void glPolygonMode(int face, int mode) { ! gl.glPolygonMode(face, mode); } ! protected void glPopMatrix() { ! gl.glPopMatrix(); } ! protected void glPushMatrix() { ! gl.glPushMatrix(); } ! protected void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) { ! gl.glReadPixels(x, y, width, height, format, type, pixels); } ! protected void glRotatef(float angle, float x, float y, float z) { ! gl.glRotatef(angle, x, y, z); } ! protected void glScalef(float x, float y, float z) { ! gl.glScalef(x, y, z); } ! protected void glScissor(int x, int y, int width, int height) { ! gl.glScissor(x, y, width, height); } ! protected void glShadeModel(int mode) { ! gl.glShadeModel(mode); } ! protected void glTexCoord2f(float s, float t) { ! gl.glTexCoord2f(s, t); } ! protected void glTexCoordPointer(int size, int stride, FloatBuffer pointer) { ! gl.glTexCoordPointer(size, GL_FLOAT, stride, pointer); } ! protected void glTexEnvi(int target, int pname, int param) { ! gl.glTexEnvi(target, pname, param); } ! protected void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) { ! gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } ! protected void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) { ! gl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } ! protected void glTexParameterf(int target, int pname, float param) { ! gl.glTexParameterf(target, pname, param); } ! protected void glTexParameteri(int target, int pname, int param) { ! gl.glTexParameteri(target, pname, param); } ! protected void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) { ! gl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); } ! protected void glTranslatef(float x, float y, float z) { ! gl.glTranslatef(x, y, z); } ! protected void glVertex2f(float x, float y) { ! gl.glVertex2f(x, y); } ! protected void glVertex3f(float x, float y, float z) { ! gl.glVertex3f(x, y, z); } ! protected void glVertexPointer(int size, int stride, FloatBuffer pointer) { ! gl.glVertexPointer(size, GL_FLOAT, stride, pointer); } ! protected void glViewport(int x, int y, int width, int height) { ! gl.glViewport(x, y, width, height); } ! protected void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { ! gl.glColorTable(target, internalFormat, width, format, type, data); } ! protected void glActiveTextureARB(int texture) { ! gl.glActiveTextureARB(texture); } ! protected void glClientActiveTextureARB(int texture) { ! gl.glClientActiveTextureARB(texture); } ! protected void glPointParameterEXT(int pname, FloatBuffer pfParams) { ! gl.glPointParameterfvEXT(pname, pfParams); } ! protected void glPointParameterfEXT(int pname, float param) { ! gl.glPointParameterfEXT(pname, param); } } --- 3,311 ---- import java.nio.*; ! import net.java.games.jogl.GL; ! ! public class JoglGL implements QGL { ! private static QGL self = new JoglGL(); ! private GL jogl; ! ! private JoglGL() { ! // singleton ! } ! ! void setGL(GL context) { ! this.jogl = context; ! } ! ! public static QGL getInstance() { ! return self; ! } ! ! public void glAlphaFunc(int func, float ref) { ! jogl.glAlphaFunc(func, ref); } ! public void glBegin(int mode) { ! jogl.glBegin(mode); } ! public void glBindTexture(int target, int texture) { ! jogl.glBindTexture(target, texture); } ! public void glBlendFunc(int sfactor, int dfactor) { ! jogl.glBlendFunc(sfactor, dfactor); } ! public void glClear(int mask) { ! jogl.glClear(mask); } ! public void glClearColor(float red, float green, float blue, float alpha) { ! jogl.glClearColor(red, green, blue, alpha); } ! public void glColor3f(float red, float green, float blue) { ! jogl.glColor3f(red, green, blue); } ! public void glColor3ub(byte red, byte green, byte blue) { ! jogl.glColor3ub(red, green, blue); } ! public void glColor4f(float red, float green, float blue, float alpha) { ! jogl.glColor4f(red, green, blue, alpha); } ! public void glColor4ub(byte red, byte green, byte blue, byte alpha) { ! jogl.glColor4ub(red, green, blue, alpha); } ! public void glColorPointer(int size, boolean unsigned, int stride, ByteBuffer pointer) { ! jogl.glColorPointer(size, GL_UNSIGNED_BYTE, stride, pointer); } ! public void glColorPointer(int size, int stride, FloatBuffer pointer) { ! jogl.glColorPointer(size, GL_FLOAT, stride, pointer); } ! public void glCullFace(int mode) { ! jogl.glCullFace(mode); } ! public void glDeleteTextures(IntBuffer textures) { ! jogl.glDeleteTextures(textures.limit(), textures); } ! public void glDepthFunc(int func) { ! jogl.glDepthFunc(func); } ! public void glDepthMask(boolean flag) { ! jogl.glDepthMask(flag); } ! public void glDepthRange(double zNear, double zFar) { ! jogl.glDepthRange(zNear, zFar); } ! public void glDisable(int cap) { ! jogl.glDisable(cap); } ! public void glDisableClientState(int cap) { ! jogl.glDisableClientState(cap); } ! public void glDrawArrays(int mode, int first, int count) { ! jogl.glDrawArrays(mode, first, count); } ! public void glDrawBuffer(int mode) { ! jogl.glDrawBuffer(mode); } ! public void glDrawElements(int mode, IntBuffer indices) { ! jogl.glDrawElements(mode, indices.limit(), GL_UNSIGNED_INT, indices); } ! public void glEnable(int cap) { ! jogl.glEnable(cap); } ! public void glEnableClientState(int cap) { ! jogl.glEnableClientState(cap); } ! public void glEnd() { ! jogl.glEnd(); } ! public void glFinish() { ! jogl.glFinish(); } ! public void glFlush() { ! jogl.glFlush(); } ! public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar) { ! jogl.glFrustum(left, right, bottom, top, zNear, zFar); } ! public int glGetError() { ! return jogl.glGetError(); } ! public void glGetFloat(int pname, FloatBuffer params) { ! jogl.glGetFloatv(pname, params); } ! public String glGetString(int name) { ! return jogl.glGetString(name); } ! public void glInterleavedArrays(int format, int stride, FloatBuffer pointer) { ! jogl.glInterleavedArrays(format, stride, pointer); } ! public void glLoadIdentity() { ! jogl.glLoadIdentity(); } ! public void glLoadMatrix(FloatBuffer m) { ! jogl.glLoadMatrixf(m); } ! public void glMatrixMode(int mode) { ! jogl.glMatrixMode(mode); } ! public void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar) { ! jogl.glOrtho(left, right, bottom, top, zNear, zFar); } ! public void glPixelStorei(int pname, int param) { ! jogl.glPixelStorei(pname, param); } ! public void glPointSize(float size) { ! jogl.glPointSize(size); } ! public void glPolygonMode(int face, int mode) { ! jogl.glPolygonMode(face, mode); } ! public void glPopMatrix() { ! jogl.glPopMatrix(); } ! public void glPushMatrix() { ! jogl.glPushMatrix(); } ! public void glReadPixels(int x, int y, int width, int height, int format, int type, ByteBuffer pixels) { ! jogl.glReadPixels(x, y, width, height, format, type, pixels); } ! public void glRotatef(float angle, float x, float y, float z) { ! jogl.glRotatef(angle, x, y, z); } ! public void glScalef(float x, float y, float z) { ! jogl.glScalef(x, y, z); } ! public void glScissor(int x, int y, int width, int height) { ! jogl.glScissor(x, y, width, height); } ! public void glShadeModel(int mode) { ! jogl.glShadeModel(mode); } ! public void glTexCoord2f(float s, float t) { ! jogl.glTexCoord2f(s, t); } ! public void glTexCoordPointer(int size, int stride, FloatBuffer pointer) { ! jogl.glTexCoordPointer(size, GL_FLOAT, stride, pointer); } ! public void glTexEnvi(int target, int pname, int param) { ! jogl.glTexEnvi(target, pname, param); } ! public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, ByteBuffer pixels) { ! jogl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } ! public void glTexImage2D(int target, int level, int internalformat, int width, int height, int border, int format, int type, IntBuffer pixels) { ! jogl.glTexImage2D(target, level, internalformat, width, height, border, format, type, pixels); } ! public void glTexParameterf(int target, int pname, float param) { ! jogl.glTexParameterf(target, pname, param); } ! public void glTexParameteri(int target, int pname, int param) { ! jogl.glTexParameteri(target, pname, param); } ! public void glTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int type, IntBuffer pixels) { ! jogl.glTexSubImage2D(target, level, xoffset, yoffset, width, height, format, type, pixels); } ! public void glTranslatef(float x, float y, float z) { ! jogl.glTranslatef(x, y, z); } ! public void glVertex2f(float x, float y) { ! jogl.glVertex2f(x, y); } ! public void glVertex3f(float x, float y, float z) { ! jogl.glVertex3f(x, y, z); } ! public void glVertexPointer(int size, int stride, FloatBuffer pointer) { ! jogl.glVertexPointer(size, GL_FLOAT, stride, pointer); } ! public void glViewport(int x, int y, int width, int height) { ! jogl.glViewport(x, y, width, height); } ! public void glColorTable(int target, int internalFormat, int width, int format, int type, ByteBuffer data) { ! jogl.glColorTable(target, internalFormat, width, format, type, data); } ! public void glActiveTextureARB(int texture) { ! jogl.glActiveTextureARB(texture); } ! public void glClientActiveTextureARB(int texture) { ! jogl.glClientActiveTextureARB(texture); } ! public void glPointParameterEXT(int pname, FloatBuffer pfParams) { ! jogl.glPointParameterfvEXT(pname, pfParams); } ! public void glPointParameterfEXT(int pname, float param) { ! jogl.glPointParameterfEXT(pname, param); ! } ! public void glLockArraysEXT(int first, int count) { ! jogl.glLockArraysEXT(first, count); ! } ! ! public void glArrayElement(int index) { ! jogl.glArrayElement(index); } + public void glUnlockArraysEXT() { + jogl.glUnlockArraysEXT(); + } + + public void glMultiTexCoord2f(int target, float s, float t) { + jogl.glMultiTexCoord2f(target, s, t); + } + + } |
From: Carsten W. <ca...@us...> - 2005-10-24 22:41:19
|
Update of /cvsroot/jake2/jake2/src/jake2/render/fastjogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4342/src/jake2/render/fastjogl Modified Files: Tag: render-refactoring Image.java Misc.java Mesh.java Warp.java Model.java Base.java Surf.java Draw.java Main.java Light.java Log Message: now uses QGL interface for OpenGL calls Index: Base.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Base.java,v retrieving revision 1.3 retrieving revision 1.3.4.1 diff -C2 -d -r1.3 -r1.3.4.1 *** Base.java 8 Jun 2005 20:43:07 -0000 1.3 --- Base.java 24 Oct 2005 22:41:12 -0000 1.3.4.1 *************** *** 26,31 **** package jake2.render.fastjogl; ! import jake2.render.JoglBase; ! import net.java.games.jogl.GL; /** --- 26,34 ---- package jake2.render.fastjogl; ! import jake2.client.viddef_t; ! import jake2.game.cvar_t; ! import jake2.render.*; ! ! import java.awt.Dimension; /** *************** *** 34,40 **** * @author cwei */ ! public abstract class Base extends JoglBase { ! static final int GL_COLOR_INDEX8_EXT = GL.GL_COLOR_INDEX; static final String REF_VERSION = "GL 0.01"; --- 37,43 ---- * @author cwei */ ! public abstract class Base implements QGLConst { ! static final int GL_COLOR_INDEX8_EXT = GL_COLOR_INDEX; static final String REF_VERSION = "GL 0.01"; *************** *** 153,155 **** --- 156,199 ---- static final int GL_RENDERER_OTHER = 0x80000000; + + /* + * base members + */ + + protected viddef_t vid = new viddef_t(); + + protected cvar_t vid_fullscreen; + + // protected QGL gl = JoglGL.getInstance(); //DummyGL.getInstance(); + protected QGL gl = LwjglGL.getInstance(); //DummyGL.getInstance(); + + // 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; + + protected abstract int GLimp_SetMode(Dimension dim, int mode, + boolean fullscreen); + + protected abstract void GLimp_Shutdown(); + + protected void GLimp_BeginFrame(float camera_separation) { + // do nothing + } + + protected void GLimp_AppActivate(boolean activate) { + // do nothing + } + + protected void GLimp_EnableLogging(boolean enable) { + // do nothing + } + + protected void GLimp_LogNewFrame() { + // do nothing + } } \ No newline at end of file Index: Image.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Image.java,v retrieving revision 1.8 retrieving revision 1.8.8.1 diff -C2 -d -r1.8 -r1.8.8.1 *** Image.java 10 Nov 2004 20:35:36 -0000 1.8 --- Image.java 24 Oct 2005 22:41:11 -0000 1.8.8.1 *************** *** 39,43 **** import java.util.Arrays; - import net.java.games.jogl.GL; /** --- 39,42 ---- *************** *** 70,76 **** int gl_tex_alpha_format = 4; ! int gl_filter_min = GL.GL_LINEAR_MIPMAP_NEAREST; ! int gl_filter_max = GL.GL_LINEAR; Image() { --- 69,75 ---- int gl_tex_alpha_format = 4; ! int gl_filter_min = GL_LINEAR_MIPMAP_NEAREST; ! int gl_filter_max = GL_LINEAR; Image() { *************** *** 86,101 **** assert (palette != null && palette.length == 256) : "int palette[256] bug"; - int i; - byte[] temptable = new byte[768]; - if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f) { ! for (i = 0; i < 256; i++) { ! temptable[i * 3 + 0] = (byte) ((palette[i] >> 0) & 0xff); ! temptable[i * 3 + 1] = (byte) ((palette[i] >> 8) & 0xff); ! temptable[i * 3 + 2] = (byte) ((palette[i] >> 16) & 0xff); } ! gl.glColorTableEXT(GL.GL_SHARED_TEXTURE_PALETTE_EXT, GL.GL_RGB, ! 256, GL.GL_RGB, GL.GL_UNSIGNED_BYTE, temptable); } } --- 85,98 ---- assert (palette != null && palette.length == 256) : "int palette[256] bug"; if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f) { ! ByteBuffer temptable = Lib.newByteBuffer(768); ! for (int i = 0; i < 256; i++) { ! temptable.put(i * 3 + 0, (byte) ((palette[i] >> 0) & 0xff)); ! temptable.put(i * 3 + 1, (byte) ((palette[i] >> 8) & 0xff)); ! temptable.put(i * 3 + 2, (byte) ((palette[i] >> 16) & 0xff)); } ! gl.glColorTable(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, ! 256, GL_RGB, GL_UNSIGNED_BYTE, temptable); } } *************** *** 104,116 **** if (enable) { GL_SelectTexture(GL_TEXTURE1); ! gl.glEnable(GL.GL_TEXTURE_2D); ! GL_TexEnv(GL.GL_REPLACE); } else { GL_SelectTexture(GL_TEXTURE1); ! gl.glDisable(GL.GL_TEXTURE_2D); ! GL_TexEnv(GL.GL_REPLACE); } GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv(GL.GL_REPLACE); } --- 101,113 ---- if (enable) { GL_SelectTexture(GL_TEXTURE1); ! gl.glEnable(GL_TEXTURE_2D); ! GL_TexEnv(GL_REPLACE); } else { GL_SelectTexture(GL_TEXTURE1); ! gl.glDisable(GL_TEXTURE_2D); ! GL_TexEnv(GL_REPLACE); } GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv(GL_REPLACE); } *************** *** 135,139 **** if (mode != lastmodes[gl_state.currenttmu]) { ! gl.glTexEnvi(GL.GL_TEXTURE_ENV, GL.GL_TEXTURE_ENV_MODE, mode); lastmodes[gl_state.currenttmu] = mode; } --- 132,136 ---- if (mode != lastmodes[gl_state.currenttmu]) { ! gl.glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode); lastmodes[gl_state.currenttmu] = mode; } *************** *** 150,154 **** gl_state.currenttextures[gl_state.currenttmu] = texnum; ! gl.glBindTexture(GL.GL_TEXTURE_2D, texnum); } --- 147,151 ---- gl_state.currenttextures[gl_state.currenttmu] = texnum; ! gl.glBindTexture(GL_TEXTURE_2D, texnum); } *************** *** 179,192 **** static final glmode_t modes[] = { ! new glmode_t("GL_NEAREST", GL.GL_NEAREST, GL.GL_NEAREST), ! new glmode_t("GL_LINEAR", GL.GL_LINEAR, GL.GL_LINEAR), new glmode_t("GL_NEAREST_MIPMAP_NEAREST", ! GL.GL_NEAREST_MIPMAP_NEAREST, GL.GL_NEAREST), new glmode_t("GL_LINEAR_MIPMAP_NEAREST", ! GL.GL_LINEAR_MIPMAP_NEAREST, GL.GL_LINEAR), new glmode_t("GL_NEAREST_MIPMAP_LINEAR", ! GL.GL_NEAREST_MIPMAP_LINEAR, GL.GL_NEAREST), ! new glmode_t("GL_LINEAR_MIPMAP_LINEAR", GL.GL_LINEAR_MIPMAP_LINEAR, ! GL.GL_LINEAR) }; static final int NUM_GL_MODES = modes.length; --- 176,189 ---- static final glmode_t modes[] = { ! new glmode_t("GL_NEAREST", GL_NEAREST, GL_NEAREST), ! new glmode_t("GL_LINEAR", GL_LINEAR, GL_LINEAR), new glmode_t("GL_NEAREST_MIPMAP_NEAREST", ! GL_NEAREST_MIPMAP_NEAREST, GL_NEAREST), new glmode_t("GL_LINEAR_MIPMAP_NEAREST", ! GL_LINEAR_MIPMAP_NEAREST, GL_LINEAR), new glmode_t("GL_NEAREST_MIPMAP_LINEAR", ! GL_NEAREST_MIPMAP_LINEAR, GL_NEAREST), ! new glmode_t("GL_LINEAR_MIPMAP_LINEAR", GL_LINEAR_MIPMAP_LINEAR, ! GL_LINEAR) }; static final int NUM_GL_MODES = modes.length; *************** *** 205,223 **** static final gltmode_t[] gl_alpha_modes = { new gltmode_t("default", 4), ! new gltmode_t("GL_RGBA", GL.GL_RGBA), ! new gltmode_t("GL_RGBA8", GL.GL_RGBA8), ! new gltmode_t("GL_RGB5_A1", GL.GL_RGB5_A1), ! new gltmode_t("GL_RGBA4", GL.GL_RGBA4), ! new gltmode_t("GL_RGBA2", GL.GL_RGBA2), }; static final int NUM_GL_ALPHA_MODES = gl_alpha_modes.length; static final gltmode_t[] gl_solid_modes = { new gltmode_t("default", 3), ! new gltmode_t("GL_RGB", GL.GL_RGB), ! new gltmode_t("GL_RGB8", GL.GL_RGB8), ! new gltmode_t("GL_RGB5", GL.GL_RGB5), ! new gltmode_t("GL_RGB4", GL.GL_RGB4), ! new gltmode_t("GL_R3_G3_B2", GL.GL_R3_G3_B2), ! new gltmode_t("GL_RGB2", GL.GL_RGB2_EXT) }; static final int NUM_GL_SOLID_MODES = gl_solid_modes.length; --- 202,220 ---- static final gltmode_t[] gl_alpha_modes = { new gltmode_t("default", 4), ! new gltmode_t("GL_RGBA", GL_RGBA), ! new gltmode_t("GL_RGBA8", GL_RGBA8), ! new gltmode_t("GL_RGB5_A1", GL_RGB5_A1), ! new gltmode_t("GL_RGBA4", GL_RGBA4), ! new gltmode_t("GL_RGBA2", GL_RGBA2), }; static final int NUM_GL_ALPHA_MODES = gl_alpha_modes.length; static final gltmode_t[] gl_solid_modes = { new gltmode_t("default", 3), ! new gltmode_t("GL_RGB", GL_RGB), ! new gltmode_t("GL_RGB8", GL_RGB8), ! new gltmode_t("GL_RGB5", GL_RGB5), ! new gltmode_t("GL_RGB4", GL_RGB4), ! new gltmode_t("GL_R3_G3_B2", GL_R3_G3_B2) }; ! /* new gltmode_t("GL_RGB2", GL_RGB2_EXT) */ static final int NUM_GL_SOLID_MODES = gl_solid_modes.length; *************** *** 251,257 **** if (glt.type != it_pic && glt.type != it_sky) { GL_Bind(glt.texnum); ! gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, gl_filter_min); ! gl.glTexParameteri(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, gl_filter_max); } --- 248,254 ---- if (glt.type != it_pic && glt.type != it_sky) { GL_Bind(glt.texnum); ! gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); ! gl.glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } *************** *** 980,984 **** * Returns has_alpha */ ! void GL_BuildPalettedTexture(byte[] paletted_texture, int[] scaled, int scaled_width, int scaled_height) { --- 977,981 ---- * Returns has_alpha */ ! void GL_BuildPalettedTexture(ByteBuffer paletted_texture, int[] scaled, int scaled_width, int scaled_height) { *************** *** 994,998 **** c = r | (g << 5) | (b << 11); ! paletted_texture[i] = gl_state.d_16to8table[c]; } } --- 991,995 ---- c = r | (g << 5) | (b << 11); ! paletted_texture.put(i, gl_state.d_16to8table[c]); } } *************** *** 1004,1008 **** int[] scaled = new int[256 * 256]; ! byte[] paletted_texture = new byte[256 * 256]; IntBuffer tex = Lib.newIntBuffer(512 * 256, ByteOrder.LITTLE_ENDIAN); --- 1001,1005 ---- int[] scaled = new int[256 * 256]; ! ByteBuffer paletted_texture = Lib.newByteBuffer(256*256); IntBuffer tex = Lib.newIntBuffer(512 * 256, ByteOrder.LITTLE_ENDIAN); *************** *** 1020,1024 **** Arrays.fill(scaled, 0); ! Arrays.fill(paletted_texture, (byte) 0); uploaded_paletted = false; --- 1017,1022 ---- Arrays.fill(scaled, 0); ! paletted_texture.clear(); ! for (int j=0; j<256*256; j++) paletted_texture.put(j,(byte)0); uploaded_paletted = false; *************** *** 1087,1100 **** GL_BuildPalettedTexture(paletted_texture, data, scaled_width, scaled_height); ! gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, ! scaled_height, 0, GL.GL_COLOR_INDEX, ! GL.GL_UNSIGNED_BYTE, paletted_texture); } else { ! tex.rewind(); ! tex.put(data, 0, scaled_width * scaled_height); ! gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, comp, ! scaled_width, scaled_height, 0, GL.GL_RGBA, ! GL.GL_UNSIGNED_BYTE, tex); } //goto done; --- 1085,1098 ---- GL_BuildPalettedTexture(paletted_texture, data, scaled_width, scaled_height); ! gl.glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, scaled_width, ! scaled_height, 0, GL_COLOR_INDEX, ! GL_UNSIGNED_BYTE, paletted_texture); } else { ! tex.clear(); ! tex.put(data, 0, scaled_width * scaled_height).flip(); ! gl.glTexImage2D(GL_TEXTURE_2D, 0, comp, ! scaled_width, scaled_height, 0, GL_RGBA, ! GL_UNSIGNED_BYTE, tex); } //goto done; *************** *** 1114,1125 **** GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, ! scaled_width, scaled_height, 0, GL.GL_COLOR_INDEX, ! GL.GL_UNSIGNED_BYTE, paletted_texture); } else { ! tex.rewind(); ! tex.put(scaled, 0, scaled_width * scaled_height); ! gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, comp, scaled_width, ! scaled_height, 0, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE, tex); } --- 1112,1123 ---- GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! gl.glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, ! scaled_width, scaled_height, 0, GL_COLOR_INDEX, ! GL_UNSIGNED_BYTE, paletted_texture); } else { ! tex.clear(); ! tex.put(scaled, 0, scaled_width * scaled_height).flip(); ! gl.glTexImage2D(GL_TEXTURE_2D, 0, comp, scaled_width, ! scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex); } *************** *** 1143,1156 **** GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! gl.glTexImage2D(GL.GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, ! scaled_height, 0, GL.GL_COLOR_INDEX, ! GL.GL_UNSIGNED_BYTE, paletted_texture); } else { ! tex.rewind(); ! tex.put(scaled, 0, scaled_width * scaled_height); ! gl.glTexImage2D(GL.GL_TEXTURE_2D, miplevel, comp, ! scaled_width, scaled_height, 0, GL.GL_RGBA, ! GL.GL_UNSIGNED_BYTE, tex); } } --- 1141,1154 ---- GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! gl.glTexImage2D(GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, scaled_width, ! scaled_height, 0, GL_COLOR_INDEX, ! GL_UNSIGNED_BYTE, paletted_texture); } else { ! tex.clear(); ! tex.put(scaled, 0, scaled_width * scaled_height).flip(); ! gl.glTexImage2D(GL_TEXTURE_2D, miplevel, comp, ! scaled_width, scaled_height, 0, GL_RGBA, ! GL_UNSIGNED_BYTE, tex); } } *************** *** 1162,1173 **** if (mipmap) { ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, gl_filter_min); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, gl_filter_max); } else { ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, gl_filter_max); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, gl_filter_max); } --- 1160,1171 ---- if (mipmap) { ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } else { ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } *************** *** 1194,1203 **** if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { ! gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, width, ! height, 0, GL.GL_COLOR_INDEX, GL.GL_UNSIGNED_BYTE, data); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, gl_filter_max); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, gl_filter_max); --- 1192,1201 ---- if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { ! gl.glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, width, ! height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, ByteBuffer.wrap(data)); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); *************** *** 1459,1462 **** --- 1457,1462 ---- } + private IntBuffer texnum = Lib.newIntBuffer(1); + /* * GL_FreeUnusedImages *************** *** 1485,1489 **** // free it ! gl.glDeleteTextures(1, new int[] { image.texnum }); image.clear(); } --- 1485,1490 ---- // free it ! texnum.put(0, image.texnum); ! gl.glDeleteTextures(texnum); image.clear(); } *************** *** 1585,1589 **** continue; // free image_t slot // free it ! gl.glDeleteTextures(1, new int[] { image.texnum }); image.clear(); } --- 1586,1591 ---- continue; // free image_t slot // free it ! texnum.put(0, image.texnum); ! gl.glDeleteTextures(texnum); image.clear(); } Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Surf.java,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -C2 -d -r1.10 -r1.10.4.1 *** Surf.java 8 Jun 2005 21:27:09 -0000 1.10 --- Surf.java 24 Oct 2005 22:41:12 -0000 1.10.4.1 *************** *** 38,44 **** import java.util.Arrays; - import net.java.games.jogl.GL; - import net.java.games.jogl.util.BufferUtils; - /** * Surf --- 38,41 ---- *************** *** 69,73 **** int c_visible_textures; ! static final int GL_LIGHTMAP_FORMAT = GL.GL_RGBA; static class gllightmapstate_t { --- 66,70 ---- int c_visible_textures; ! static final int GL_LIGHTMAP_FORMAT = GL_RGBA; static class gllightmapstate_t { *************** *** 153,157 **** */ void DrawGLPoly(glpoly_t p) { ! gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); } --- 150,154 ---- */ void DrawGLPoly(glpoly_t p) { ! gl.glDrawArrays(GL_POLYGON, p.pos, p.numverts); } *************** *** 169,173 **** p.beginScrolling(scroll); ! gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } --- 166,170 ---- p.beginScrolling(scroll); ! gl.glDrawArrays(GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } *************** *** 183,188 **** return; ! gl.glDisable(GL.GL_TEXTURE_2D); ! gl.glDisable(GL.GL_DEPTH_TEST); gl.glColor4f(1, 1, 1, 1); --- 180,185 ---- return; ! gl.glDisable(GL_TEXTURE_2D); ! gl.glDisable(GL_DEPTH_TEST); gl.glColor4f(1, 1, 1, 1); *************** *** 191,195 **** for (glpoly_t p = surf.polys; p != null; p = p.chain) { for (int j = 2; j < p.numverts; j++) { ! gl.glBegin(GL.GL_LINE_STRIP); gl.glVertex3f(p.x(0), p.y(0), p.z(0)); gl.glVertex3f(p.x(j-1), p.y(j-1), p.z(j-1)); --- 188,192 ---- for (glpoly_t p = surf.polys; p != null; p = p.chain) { for (int j = 2; j < p.numverts; j++) { ! gl.glBegin(GL_LINE_STRIP); gl.glVertex3f(p.x(0), p.y(0), p.z(0)); gl.glVertex3f(p.x(j-1), p.y(j-1), p.z(j-1)); *************** *** 202,207 **** } ! gl.glEnable(GL.GL_DEPTH_TEST); ! gl.glEnable(GL.GL_TEXTURE_2D); } --- 199,204 ---- } ! gl.glEnable(GL_DEPTH_TEST); ! gl.glEnable(GL_TEXTURE_2D); } *************** *** 225,239 **** // warp texture, no lightmaps ! GL_TexEnv(GL.GL_MODULATE); gl.glColor4f(gl_state.inverse_intensity, gl_state.inverse_intensity, gl_state.inverse_intensity, 1.0F); EmitWaterPolys(fa); ! GL_TexEnv(GL.GL_REPLACE); return; } else { GL_Bind(image.texnum); ! GL_TexEnv(GL.GL_REPLACE); } --- 222,236 ---- // warp texture, no lightmaps ! GL_TexEnv(GL_MODULATE); gl.glColor4f(gl_state.inverse_intensity, gl_state.inverse_intensity, gl_state.inverse_intensity, 1.0F); EmitWaterPolys(fa); ! GL_TexEnv(GL_REPLACE); return; } else { GL_Bind(image.texnum); ! GL_TexEnv(GL_REPLACE); } *************** *** 289,294 **** GL_Bind(gl_state.lightmap_textures + fa.lightmaptexturenum); ! gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, fa.light_s, fa.light_t, ! smax, tmax, GL_LIGHTMAP_FORMAT, GL.GL_UNSIGNED_BYTE, temp2); --- 286,291 ---- GL_Bind(gl_state.lightmap_textures + fa.lightmaptexturenum); ! gl.glTexSubImage2D(GL_TEXTURE_2D, 0, fa.light_s, fa.light_t, ! smax, tmax, GL_LIGHTMAP_FORMAT, GL_UNSIGNED_BYTE, temp2); *************** *** 319,326 **** // go back to the world matrix // ! gl.glLoadMatrixf(r_world_matrix); ! gl.glEnable(GL.GL_BLEND); ! GL_TexEnv(GL.GL_MODULATE); // the textures are prescaled up for a better lighting range, --- 316,323 ---- // go back to the world matrix // ! gl.glLoadMatrix(r_world_matrix); ! gl.glEnable(GL_BLEND); ! GL_TexEnv(GL_MODULATE); // the textures are prescaled up for a better lighting range, *************** *** 328,332 **** intens = gl_state.inverse_intensity; ! gl.glInterleavedArrays(GL.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); --- 325,329 ---- intens = gl_state.inverse_intensity; ! gl.glInterleavedArrays(GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); *************** *** 349,355 **** } ! GL_TexEnv(GL.GL_REPLACE); gl.glColor4f(1, 1, 1, 1); ! gl.glDisable(GL.GL_BLEND); r_alpha_surfaces = null; --- 346,352 ---- } ! GL_TexEnv(GL_REPLACE); gl.glColor4f(1, 1, 1, 1); ! gl.glDisable(GL_BLEND); r_alpha_surfaces = null; *************** *** 399,403 **** } ! GL_TexEnv(GL.GL_REPLACE); } --- 396,400 ---- } ! GL_TexEnv(GL_REPLACE); } *************** *** 460,466 **** lmtex = surf.lightmaptexturenum; ! gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL.GL_UNSIGNED_BYTE, temp); } else { --- 457,463 ---- lmtex = surf.lightmaptexturenum; ! gl.glTexSubImage2D(GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, temp); } else { *************** *** 474,480 **** lmtex = 0; ! gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL.GL_UNSIGNED_BYTE, temp); } --- 471,477 ---- lmtex = 0; ! gl.glTexSubImage2D(GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, temp); } *************** *** 497,506 **** for (p = surf.polys; p != null; p = p.chain) { p.beginScrolling(scroll); ! gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } } else { for (p = surf.polys; p != null; p = p.chain) { ! gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); } } --- 494,503 ---- for (p = surf.polys; p != null; p = p.chain) { p.beginScrolling(scroll); ! gl.glDrawArrays(GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } } else { for (p = surf.polys; p != null; p = p.chain) { ! gl.glDrawArrays(GL_POLYGON, p.pos, p.numverts); } } *************** *** 525,529 **** for (p = surf.polys; p != null; p = p.chain) { p.beginScrolling(scroll); ! gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } --- 522,526 ---- for (p = surf.polys; p != null; p = p.chain) { p.beginScrolling(scroll); ! gl.glDrawArrays(GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } *************** *** 532,536 **** // ========== for (p = surf.polys; p != null; p = p.chain) { ! gl.glDrawArrays(GL.GL_POLYGON, p.pos, p.numverts); } --- 529,533 ---- // ========== for (p = surf.polys; p != null; p = p.chain) { ! gl.glDrawArrays(GL_POLYGON, p.pos, p.numverts); } *************** *** 569,575 **** if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glEnable(GL.GL_BLEND); gl.glColor4f(1, 1, 1, 0.25f); ! GL_TexEnv(GL.GL_MODULATE); } --- 566,572 ---- if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glEnable(GL_BLEND); gl.glColor4f(1, 1, 1, 0.25f); ! GL_TexEnv(GL_MODULATE); } *************** *** 602,608 **** if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glDisable(GL.GL_BLEND); gl.glColor4f(1, 1, 1, 1); ! GL_TexEnv(GL.GL_REPLACE); } } --- 599,605 ---- if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glDisable(GL_BLEND); gl.glColor4f(1, 1, 1, 1); ! GL_TexEnv(GL_REPLACE); } } *************** *** 674,690 **** GL_EnableMultitexture(true); GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv(GL.GL_REPLACE); ! gl.glInterleavedArrays(GL.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); ! GL_TexEnv(GL.GL_MODULATE); ! gl.glTexCoordPointer(2, GL.GL_FLOAT, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY); R_DrawInlineBModel(); gl.glClientActiveTextureARB(GL_TEXTURE1); ! gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture(false); --- 671,687 ---- GL_EnableMultitexture(true); GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv(GL_REPLACE); ! gl.glInterleavedArrays(GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); ! GL_TexEnv(GL_MODULATE); ! gl.glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! gl.glEnableClientState(GL_TEXTURE_COORD_ARRAY); R_DrawInlineBModel(); gl.glClientActiveTextureARB(GL_TEXTURE1); ! gl.glDisableClientState(GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture(false); *************** *** 851,871 **** GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv(GL.GL_REPLACE); ! gl.glInterleavedArrays(GL.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); ! gl.glTexCoordPointer(2, GL.GL_FLOAT, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! gl.glEnableClientState(GL.GL_TEXTURE_COORD_ARRAY); if (gl_lightmap.value != 0) ! GL_TexEnv(GL.GL_REPLACE); else ! GL_TexEnv(GL.GL_MODULATE); R_RecursiveWorldNode(r_worldmodel.nodes[0]); // root node gl.glClientActiveTextureARB(GL_TEXTURE1); ! gl.glDisableClientState(GL.GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture(false); --- 848,868 ---- GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv(GL_REPLACE); ! gl.glInterleavedArrays(GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); GL_SelectTexture(GL_TEXTURE1); ! gl.glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! gl.glEnableClientState(GL_TEXTURE_COORD_ARRAY); if (gl_lightmap.value != 0) ! GL_TexEnv(GL_REPLACE); else ! GL_TexEnv(GL_MODULATE); R_RecursiveWorldNode(r_worldmodel.nodes[0]); // root node gl.glClientActiveTextureARB(GL_TEXTURE1); ! gl.glDisableClientState(GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture(false); *************** *** 979,986 **** GL_Bind(gl_state.lightmap_textures + texture); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, ! GL.GL_LINEAR); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, ! GL.GL_LINEAR); if (dynamic) { --- 976,983 ---- GL_Bind(gl_state.lightmap_textures + texture); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); ! ! gl_lms.lightmap_buffer.rewind(); if (dynamic) { *************** *** 992,1007 **** } ! gl.glTexSubImage2D(GL.GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, height, ! GL_LIGHTMAP_FORMAT, GL.GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer); } else { ! gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, gl_lms.internal_format, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_LIGHTMAP_FORMAT, ! GL.GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer); if (++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS) Com.Error(Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n"); ! //debugLightmap(gl_lms.lightmap_buffer, 128, 128, 4); } --- 989,1004 ---- } ! gl.glTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, height, ! GL_LIGHTMAP_FORMAT, GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer); } else { ! gl.glTexImage2D(GL_TEXTURE_2D, 0, gl_lms.internal_format, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer); if (++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS) Com.Error(Defines.ERR_DROP, "LM_UploadBlock() - MAX_LIGHTMAPS exceeded\n"); ! // debugLightmap(gl_lms.lightmap_buffer, 128, 128, 4); } *************** *** 1153,1157 **** lightstyle_t[] lightstyles; ! IntBuffer dummy = BufferUtils.newIntBuffer(128 * 128); /* --- 1150,1154 ---- lightstyle_t[] lightstyles; ! IntBuffer dummy = Lib.newIntBuffer(128 * 128); /* *************** *** 1219,1225 **** gl_lms.internal_format = gl_tex_alpha_format; } else if (format == 'I') { ! gl_lms.internal_format = GL.GL_INTENSITY8; } else if (format == 'L') { ! gl_lms.internal_format = GL.GL_LUMINANCE8; } else { gl_lms.internal_format = gl_tex_solid_format; --- 1216,1222 ---- gl_lms.internal_format = gl_tex_alpha_format; } else if (format == 'I') { ! gl_lms.internal_format = GL_INTENSITY8; } else if (format == 'L') { ! gl_lms.internal_format = GL_LUMINANCE8; } else { gl_lms.internal_format = gl_tex_solid_format; *************** *** 1230,1240 **** */ GL_Bind(gl_state.lightmap_textures + 0); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MIN_FILTER, ! GL.GL_LINEAR); ! gl.glTexParameterf(GL.GL_TEXTURE_2D, GL.GL_TEXTURE_MAG_FILTER, ! GL.GL_LINEAR); ! gl.glTexImage2D(GL.GL_TEXTURE_2D, 0, gl_lms.internal_format, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_LIGHTMAP_FORMAT, ! GL.GL_UNSIGNED_BYTE, dummy); } --- 1227,1237 ---- */ GL_Bind(gl_state.lightmap_textures + 0); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, ! GL_LINEAR); ! gl.glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, ! GL_LINEAR); ! gl.glTexImage2D(GL_TEXTURE_2D, 0, gl_lms.internal_format, BLOCK_WIDTH, BLOCK_HEIGHT, 0, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, dummy); } Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Light.java,v retrieving revision 1.12 retrieving revision 1.12.6.1 diff -C2 -d -r1.12 -r1.12.6.1 *** Light.java 7 May 2005 17:17:48 -0000 1.12 --- Light.java 24 Oct 2005 22:41:12 -0000 1.12.6.1 *************** *** 39,44 **** import java.util.Arrays; - import net.java.games.jogl.GL; - /** * Light --- 39,42 ---- *************** *** 66,70 **** Math3D.VectorSubtract(light.origin, r_origin, v); ! gl.glBegin(GL.GL_TRIANGLE_FAN); gl.glColor3f(light.color[0] * 0.2f, light.color[1] * 0.2f, light.color[2] * 0.2f); --- 64,68 ---- Math3D.VectorSubtract(light.origin, r_origin, v); ! gl.glBegin(GL_TRIANGLE_FAN); gl.glColor3f(light.color[0] * 0.2f, light.color[1] * 0.2f, light.color[2] * 0.2f); *************** *** 96,103 **** // advanced yet for this frame gl.glDepthMask(false); ! gl.glDisable(GL.GL_TEXTURE_2D); ! gl.glShadeModel(GL.GL_SMOOTH); ! gl.glEnable(GL.GL_BLEND); ! gl.glBlendFunc(GL.GL_ONE, GL.GL_ONE); for (int i = 0; i < r_newrefdef.num_dlights; i++) { --- 94,101 ---- // advanced yet for this frame gl.glDepthMask(false); ! gl.glDisable(GL_TEXTURE_2D); ! gl.glShadeModel(GL_SMOOTH); ! gl.glEnable(GL_BLEND); ! gl.glBlendFunc(GL_ONE, GL_ONE); for (int i = 0; i < r_newrefdef.num_dlights; i++) { *************** *** 106,112 **** gl.glColor3f(1, 1, 1); ! gl.glDisable(GL.GL_BLEND); ! gl.glEnable(GL.GL_TEXTURE_2D); ! gl.glBlendFunc(GL.GL_SRC_ALPHA, GL.GL_ONE_MINUS_SRC_ALPHA); gl.glDepthMask(true); } --- 104,110 ---- gl.glColor3f(1, 1, 1); ! gl.glDisable(GL_BLEND); ! gl.glEnable(GL_TEXTURE_2D); ! gl.glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); gl.glDepthMask(true); } *************** *** 607,612 **** if (monolightmap == '0') { for (i = 0; i < tmax; i++, destp += stride) { - //dest.position(destp); - for (j = 0; j < smax; j++) { --- 605,608 ---- *************** *** 658,663 **** } else { for (i = 0; i < tmax; i++, destp += stride) { - //dest.position(destp); - for (j = 0; j < smax; j++) { --- 654,657 ---- Index: Mesh.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Mesh.java,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -C2 -d -r1.12 -r1.12.4.1 *** Mesh.java 9 Jun 2005 07:59:58 -0000 1.12 --- Mesh.java 24 Oct 2005 22:41:11 -0000 1.12.4.1 *************** *** 31,43 **** import jake2.qcommon.qfiles; import jake2.render.image_t; ! import jake2.util.Math3D; ! import jake2.util.Vec3Cache; import java.nio.FloatBuffer; import java.nio.IntBuffer; - import net.java.games.jogl.GL; - import net.java.games.jogl.util.BufferUtils; - /** * Mesh --- 31,39 ---- import jake2.qcommon.qfiles; import jake2.render.image_t; ! import jake2.util.*; import java.nio.FloatBuffer; import java.nio.IntBuffer; /** * Mesh *************** *** 108,119 **** } ! FloatBuffer colorArrayBuf = BufferUtils ! .newFloatBuffer(qfiles.MAX_VERTS * 4); ! FloatBuffer vertexArrayBuf = BufferUtils ! .newFloatBuffer(qfiles.MAX_VERTS * 3); ! FloatBuffer textureArrayBuf = BufferUtils ! .newFloatBuffer(qfiles.MAX_VERTS * 2); boolean isFilled = false; --- 104,112 ---- } ! FloatBuffer colorArrayBuf = Lib.newFloatBuffer(qfiles.MAX_VERTS * 4); ! FloatBuffer vertexArrayBuf = Lib.newFloatBuffer(qfiles.MAX_VERTS * 3); ! FloatBuffer textureArrayBuf = Lib.newFloatBuffer(qfiles.MAX_VERTS * 2); boolean isFilled = false; *************** *** 153,157 **** | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE | Defines.RF_SHELL_HALF_DAM)) != 0) ! gl.glDisable(GL.GL_TEXTURE_2D); float frontlerp = 1.0f - backlerp; --- 146,150 ---- | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE | Defines.RF_SHELL_HALF_DAM)) != 0) ! gl.glDisable(GL_TEXTURE_2D); float frontlerp = 1.0f - backlerp; *************** *** 184,189 **** Vec3Cache.release(3); // frontv, move, backv ! //gl.glEnableClientState( GL.GL_VERTEX_ARRAY ); ! gl.glVertexPointer(3, GL.GL_FLOAT, 0, vertexArrayBuf); // PMM - added double damage shell --- 177,182 ---- Vec3Cache.release(3); // frontv, move, backv ! //gl.glEnableClientState( GL_VERTEX_ARRAY ); ! gl.glVertexPointer(3, 0, vertexArrayBuf); // PMM - added double damage shell *************** *** 193,198 **** gl.glColor4f(shadelight[0], shadelight[1], shadelight[2], alpha); } else { ! gl.glEnableClientState(GL.GL_COLOR_ARRAY); ! gl.glColorPointer(4, GL.GL_FLOAT, 0, colorArrayBuf); // --- 186,191 ---- gl.glColor4f(shadelight[0], shadelight[1], shadelight[2], alpha); } else { ! gl.glEnableClientState(GL_COLOR_ARRAY); ! gl.glColorPointer(4, 0, colorArrayBuf); // *************** *** 213,218 **** gl.glClientActiveTextureARB(GL_TEXTURE0); ! gl.glTexCoordPointer(2, GL.GL_FLOAT, 0, textureArrayBuf); ! //gl.glEnableClientState( GL.GL_TEXTURE_COORD_ARRAY); int pos = 0; --- 206,211 ---- gl.glClientActiveTextureARB(GL_TEXTURE0); ! gl.glTexCoordPointer(2, 0, textureArrayBuf); ! //gl.glEnableClientState( GL_TEXTURE_COORD_ARRAY); int pos = 0; *************** *** 236,242 **** srcIndexBuf = paliashdr.indexElements[j]; ! int mode = GL.GL_TRIANGLE_STRIP; if (count < 0) { ! mode = GL.GL_TRIANGLE_FAN; count = -count; } --- 229,235 ---- srcIndexBuf = paliashdr.indexElements[j]; ! int mode = GL_TRIANGLE_STRIP; if (count < 0) { ! mode = GL_TRIANGLE_FAN; count = -count; } *************** *** 250,254 **** } ! gl.glDrawElements(mode, count, GL.GL_UNSIGNED_INT, srcIndexBuf); pos += count; --- 243,247 ---- } ! gl.glDrawElements(mode, srcIndexBuf); pos += count; *************** *** 259,265 **** | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE | Defines.RF_SHELL_HALF_DAM)) != 0) ! gl.glEnable(GL.GL_TEXTURE_2D); ! gl.glDisableClientState(GL.GL_COLOR_ARRAY); } --- 252,258 ---- | Defines.RF_SHELL_GREEN | Defines.RF_SHELL_BLUE | Defines.RF_SHELL_DOUBLE | Defines.RF_SHELL_HALF_DAM)) != 0) ! gl.glEnable(GL_TEXTURE_2D); ! gl.glDisableClientState(GL_COLOR_ARRAY); } *************** *** 297,303 **** if (count < 0) { count = -count; ! gl.glBegin(GL.GL_TRIANGLE_FAN); } else ! gl.glBegin(GL.GL_TRIANGLE_STRIP); do { --- 290,296 ---- if (count < 0) { count = -count; ! gl.glBegin(GL_TRIANGLE_FAN); } else ! gl.glBegin(GL_TRIANGLE_STRIP); do { *************** *** 595,599 **** if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0 && (r_lefthand.value == 1.0f)) { ! gl.glMatrixMode(GL.GL_PROJECTION); gl.glPushMatrix(); gl.glLoadIdentity(); --- 588,592 ---- if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0 && (r_lefthand.value == 1.0f)) { ! gl.glMatrixMode(GL_PROJECTION); gl.glPushMatrix(); gl.glLoadIdentity(); *************** *** 601,607 **** MYgluPerspective(r_newrefdef.fov_y, (float) r_newrefdef.width / r_newrefdef.height, 4, 4096); ! gl.glMatrixMode(GL.GL_MODELVIEW); ! gl.glCullFace(GL.GL_BACK); } --- 594,600 ---- MYgluPerspective(r_newrefdef.fov_y, (float) r_newrefdef.width / r_newrefdef.height, 4, 4096); ! gl.glMatrixMode(GL_MODELVIEW); ! gl.glCullFace(GL_BACK); } *************** *** 629,637 **** // draw it ! gl.glShadeModel(GL.GL_SMOOTH); ! GL_TexEnv(GL.GL_MODULATE); if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glEnable(GL.GL_BLEND); } --- 622,630 ---- // draw it ! gl.glShadeModel(GL_SMOOTH); ! GL_TexEnv(GL_MODULATE); if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glEnable(GL_BLEND); } *************** *** 659,664 **** GL_DrawAliasFrameLerp(paliashdr, currententity.backlerp); ! GL_TexEnv(GL.GL_REPLACE); ! gl.glShadeModel(GL.GL_FLAT); gl.glPopMatrix(); --- 652,657 ---- GL_DrawAliasFrameLerp(paliashdr, currententity.backlerp); ! GL_TexEnv(GL_REPLACE); ! gl.glShadeModel(GL_FLAT); gl.glPopMatrix(); *************** *** 666,677 **** if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0 && (r_lefthand.value == 1.0F)) { ! gl.glMatrixMode(GL.GL_PROJECTION); gl.glPopMatrix(); ! gl.glMatrixMode(GL.GL_MODELVIEW); ! gl.glCullFace(GL.GL_FRONT); } if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glDisable(GL.GL_BLEND); } --- 659,670 ---- if ((currententity.flags & Defines.RF_WEAPONMODEL) != 0 && (r_lefthand.value == 1.0F)) { ! gl.glMatrixMode(GL_PROJECTION); gl.glPopMatrix(); ! gl.glMatrixMode(GL_MODELVIEW); ! gl.glCullFace(GL_FRONT); } if ((currententity.flags & Defines.RF_TRANSLUCENT) != 0) { ! gl.glDisable(GL_BLEND); } *************** *** 683,692 **** gl.glPushMatrix(); R_RotateForEntity(e); ! gl.glDisable(GL.GL_TEXTURE_2D); ! gl.glEnable(GL.GL_BLEND); gl.glColor4f(0, 0, 0, 0.5f); GL_DrawAliasShadow(paliashdr, currententity.frame); ! gl.glEnable(GL.GL_TEXTURE_2D); ! gl.glDisable(GL.GL_BLEND); gl.glPopMatrix(); } --- 676,685 ---- gl.glPushMatrix(); R_RotateForEntity(e); ! gl.glDisable(GL_TEXTURE_2D); ! gl.glEnable(GL_BLEND); gl.glColor4f(0, 0, 0, 0.5f); GL_DrawAliasShadow(paliashdr, currententity.frame); ! gl.glEnable(GL_TEXTURE_2D); ! gl.glDisable(GL_BLEND); gl.glPopMatrix(); } Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Model.java,v retrieving revision 1.12 retrieving revision 1.12.6.1 diff -C2 -d -r1.12 -r1.12.6.1 *** Model.java 15 May 2005 16:06:15 -0000 1.12 --- Model.java 24 Oct 2005 22:41:11 -0000 1.12.6.1 *************** *** 32,37 **** import jake2.qcommon.*; import jake2.render.*; ! import jake2.util.Math3D; ! import jake2.util.Vargs; import java.nio.*; --- 32,36 ---- import jake2.qcommon.*; import jake2.render.*; ! import jake2.util.*; import java.nio.*; *************** *** 39,44 **** import java.util.Vector; - import net.java.games.jogl.util.BufferUtils; - /** * Model --- 38,41 ---- *************** *** 1196,1204 **** static final int MODEL_BUFFER_SIZE = 50000; ! static FloatBuffer globalModelTextureCoordBuf = BufferUtils ! .newFloatBuffer(MODEL_BUFFER_SIZE * 2); ! static IntBuffer globalModelVertexIndexBuf = BufferUtils ! .newIntBuffer(MODEL_BUFFER_SIZE); void precompileGLCmds(qfiles.dmdl_t model) { --- 1193,1199 ---- static final int MODEL_BUFFER_SIZE = 50000; ! static FloatBuffer globalModelTextureCoordBuf = Lib.newFloatBuffer(MODEL_BUFFER_SIZE * 2); ! static IntBuffer globalModelVertexIndexBuf = Lib.newIntBuffer(MODEL_BUFFER_SIZE); void precompileGLCmds(qfiles.dmdl_t model) { Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/fastjogl/Main.java,v retrieving revision 1.8 retrieving revision 1.8.6.1 diff -C2 -d -r1.8 -r1.8.6.1 *** Main.java 7 May 2005 18:23:26 -0000 1.8 --- Main.java 24 Oct 2005 22:41:12 -0000 1.8.6.1 *************** *** 34,37 **** --- 34,38 ---- import jake2.qcommon.*; import jake2.render.*; + import jake2.util.*; import jake2.util.Math3D; import jake2.util.Vargs; *************** *** 41,45 **** import java.nio.IntBuffer; - import net.java.games.jogl.GL; import net.java.games.jogl.Version; --- 42,45 ---- *************** *** 113,120 **** */ - int GL_TEXTURE0 = GL.GL_TEXTURE0; - int GL_TEXTURE1 = GL.GL_TEXTURE1; - - model_t r_worldmodel; --- 113,116 ---- *************** *** 147,151 **** float[] r_origin = { 0, 0, 0 }; ! float r_world_matrix[] = new float[16]; float r_base_world_matrix[] = new float[16]; --- 143,147 ---- float[] r_origin = { 0, 0, 0 }; ! FloatBuffer r_world_matrix = Lib.newFloatBuffer(16); float r_base_world_matrix[] = new float[16]; *************** *** 289,293 **** if (alpha != 1.0F) ! gl.glEnable(GL.GL_BLEND); gl.glColor4f(1, 1, 1, alpha); --- 285,289 ---- if (alpha != 1.0F) ! gl.glEnable(GL_BLEND); gl.glColor4f(1, 1, 1, alpha); *************** *** 295,306 **** GL_Bind(currentmodel.skins[e.frame].texnum); ! GL_TexEnv(GL.GL_MODULATE); if (alpha == 1.0) ! gl.glEnable(GL.GL_ALPHA_TEST); else ! gl.glDisable(GL.GL_ALPHA_TEST); ! gl.glBegin(GL.GL_QUADS); gl.glTexCoord2f(0, 1); --- 291,302 ---- GL_Bind(currentmodel.skins[e.frame].texnum); ! GL_TexEnv(GL_MODULATE); if (alpha == 1.0) ! gl.glEnable(GL_ALPHA_TEST); else ! gl.glDisable(GL_ALPHA_TEST); ! gl.glBegin(GL_QUADS); gl.glTexCoord2f(0, 1); *************** *** 326,334 **** gl.glEnd(); ! gl.glDisable(GL.GL_ALPHA_TEST); ! GL_TexEnv(GL.GL_REPLACE); if (alpha != 1.0F) ! gl.glDisable(GL.GL_BLEND); gl.glColor4f(1, 1, 1, 1); --- 322,330 ---- gl.glEnd(); ! gl.glDisable(GL_ALPHA_TEST); ! GL_TexEnv(GL_REPLACE); if (alpha != 1.0F) ! gl.glDisable(GL_BLEND); gl.glColor4f(1, 1, 1, 1); *************** *** 358,369 **** R_RotateForEntity(currententity); ! gl.glDisable(GL.GL_TEXTURE_2D); gl.glColor3f(shadelight[0], shadelight[1], shadelight[2]); // this replaces the TRIANGLE_FAN ! glut.glutWireCube(gl, 20); ! /* ! gl.glBegin(GL.GL_TRIANGLE_FAN); gl.glVertex3f(0, 0, -16); int i; --- 354,364 ---- R_RotateForEntity(currententity); ! gl.glDisable(GL_TEXTURE_2D); gl.glColor3f(shadelight[0], shadelight[1], shadelight[2]); // this replaces the TRIANGLE_FAN ! //glut.glutWireCube(gl, 20); ! gl.glBegin(GL_TRIANGLE_FAN); gl.glVertex3f(0, 0, -16); int i; *************** *** 373,377 **** gl.glEnd(); ! gl.glBegin(GL.GL_TRIANGLE_FAN); gl.glVertex3f (0, 0, 16); for (i=4 ; i>=0 ; i--) { --- 368,372 ---- gl.glEnd(); ! gl.glBegin(GL_TRIANGLE_FAN); gl.glVertex3f (0, 0, 16); for (i=4 ; i>=0 ; i--) { *************** *** 379,386 **** } gl.glEnd(); ! */ gl.glColor3f(1, 1, 1); gl.glPopMatrix(); ! gl.glEnable(GL.GL_TEXTURE_2D); } --- 374,381 ---- } gl.glEnd(); ! gl.glColor3f(1, 1, 1); gl.glPopMatrix(); ! gl.glEnable(GL_TEXTURE_2D); } *************** *** 481,488 **** GL_Bind(r_particletexture.texnum); gl.glDepthMask(false); // no z buffering ! gl.glEnable(GL.GL_BLEND); ! GL_TexEnv(GL.GL_MODULATE); ! gl.glBegin(GL.GL_TRIANGLES); FloatBuffer sourceVertices = particle_t.vertexArray; --- 476,483 ---- GL_Bind(r_particletexture.texnum); gl.glDepthMask(false); // no z buffering ! gl.glEnable(GL_BLEND); ! GL_TexEnv(GL_MODULATE); ! gl.glBegin(GL_TRIANGLES); FloatBuffer sourceVertices = particle_t.vertexArray; *************** *** 521,528 **** gl.glEnd(); ! gl.glDisable(GL.GL_BLEND); gl.glColor4f(1, 1, 1, 1); gl.glDepthMask(true); // back to normal Z buffering ! GL_TexEnv(GL.GL_REPLACE); } --- 516,523 ---- gl.glEnd(); ! gl.glDisable(GL_BLEND); gl.glColor4f(1, 1, 1, 1); gl.glDepthMask(true); // back to normal Z buffering ! GL_TexEnv(GL_REPLACE); } *************** *** 536,558 **** if (gl_ext_pointparameters.value != 0.0f && qglPointParameterfEXT) { ! //gl.glEnableClientState(GL.GL_VERTEX_ARRAY); ! gl.glVertexPointer(3, GL.GL_FLOAT, 0, particle_t.vertexArray); ! gl.glEnableClientState(GL.GL_COLOR_ARRAY); ! gl.glColorPointer(4, GL.GL_UNSIGNED_BYTE, 0, particle_t.colorArray); gl.glDepthMask(false); ! gl.glEnable(GL.GL_BLEND); ! gl.glDisable(GL.GL_TEXTURE_2D); gl.glPointSize(gl_particle_size.value); ! gl.glDrawArrays(GL.GL_POINTS, 0, r_newrefdef.num_particles); ! gl.glDisableClientState(GL.GL_COLOR_ARRAY); ! //gl.glDisableClientState(GL.GL_VERTEX_ARRAY); ! gl.glDisable(GL.GL_BLEND); gl.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); gl.glDepthMask(true); ! gl.glEnable(GL.GL_TEXTURE_2D); } --- 531,553 ---- if (gl_ext_pointparameters.value != 0.0f && qglPointParameterfEXT) { ! //gl.glEnableClientState(GL_VERTEX_ARRAY); ! gl.glVertexPointer(3, 0, particle_t.vertexArray); ! gl.glEnableClientState(GL_COLOR_ARRAY); ! gl.glColorPointer(4, true, 0, particle_t.getColorAsByteBuffer()); gl.glDepthMask(false); ! gl.glEnable(GL_BLEND); ! gl.glDisable(GL_TEXTURE_2D); gl.glPointSize(gl_particle_size.value); ! gl.glDrawArrays(GL_POINTS, 0, r_newrefdef.num_particles); ! gl.glDisableClientState(GL_COLOR_ARRAY); ! //gl.glDisableClientState(GL_VERTEX_ARRAY); ! gl.glDisable(GL_BLEND); gl.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); gl.glDepthMask(true); ! gl.glEnable(GL_TEXTURE_2D); } *************** *** 574,581 **** return; ! gl.glDisable(GL.GL_ALPHA_TEST); ! gl.glEnable(GL.GL_BLEND); ! gl.glDisable(GL.GL_DEPTH_TEST); ! gl.glDisable(GL.GL_TEXTURE_2D); gl.glLoadIdentity(); --- 569,576 ---- return; ! gl.glDisable(GL_ALPHA_TEST); ! gl.glEnable(GL_BLEND); ! gl.glDisable(GL_DEPTH_TEST); ! gl.glDisable(GL_TEXTURE_2D); gl.glLoadIdentity(); *************** *** 587,591 **** gl.glColor4f(v_blend[0], v_blend[1], v_blend[2], v_blend[3]); ! gl.glBegin(GL.GL_QUADS); gl.glVertex3f(10, 100, 100); --- 582,586 ---- gl.glColor4f(v_blend[0], v_blend[1], v_blend[2], v_blend[3]); ! gl.glBegin(GL_QUADS); gl.glVertex3f(10, 100, 100); *************** *** 595,601 **** gl.glEnd(); ! gl.glDisable(GL.GL_BLEND); ! gl.glEnable(GL.GL_TEXTURE_2D); ! gl.glEnable(GL.GL_ALPHA_TEST); gl.glColor4f(1, 1, 1, 1); --- 590,596 ---- gl.glEnd(); ! gl.glDisable(GL_BLEND); ! gl.glEnable(GL_TEXTURE_2D); ! gl.glEnable(GL_ALPHA_TEST); gl.glColor4f(1, 1, 1, 1); *************** *** 684,688 **** // clear out the portion of the screen that the NOWORLDMODEL defines if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) { ! gl.glEnable(GL.GL_SCISSOR_TEST); gl.glClearColor(0.3f, 0.3f, 0.3f, 1.0f); gl.glScissor( --- 679,683 ---- // clear out the portion of the screen that the NOWORLDMODEL defines if ((r_newrefdef.rdflags & Defines.RDF_NOWORLDMODEL) != 0) { ! gl.glEnable(GL_SCISSOR_TEST); gl.glClearColor(0.3f, 0.3f, 0.3f, 1.0f); gl.glScissor( *************** *** 691,697 **** r_newrefdef.width, r_newrefdef.height); ! gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); gl.glClearColor(1.0f, 0.0f, 0.5f, 0.5f); ! gl.glDisable(GL.GL_SCISSOR_TEST); } } --- 686,692 ---- r_newrefdef.width, r_newrefdef.height); ! gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); gl.glClearColor(1.0f, 0.0f, 0.5f, 0.5f); ! gl.glDisable(GL_SCISSOR_TEST); } } *************** *** 740,750 **** // float screenaspect = (float) r_newrefdef.width / r_newrefdef.height; ! gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); MYgluPerspective(r_newrefdef.fov_y, screenaspect, 4, 4096); ! gl.glCullFace(GL.GL_FRONT); ! gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); --- 735,745 ---- // float screenaspect = (float) r_newrefdef.width / r_newrefdef.height; ! gl.glMatrixMode(GL_PROJECTION); gl.glLoadIdentity(); MYgluPerspective(r_newrefdef.fov_y, screenaspect, 4, 4096); ! gl.glCullFace(GL_FRONT); ! gl.glMatrixMode(GL_MODELVIEW); gl.glLoadIdentity(); *************** *** 756,760 **** gl.glTranslatef(-r_newrefdef.vieworg[0], -r_newrefdef.vieworg[1], -r_newrefdef.vieworg[2]); ! gl.glGetFloatv(GL.GL_MODELVIEW_MATRIX, r_world_matrix); // --- 751,755 ---- gl.glTranslatef(-r_newrefdef.vieworg[0], -r_newrefdef.vieworg[1], -r_newrefdef.vieworg[2]); ! gl.glGetFloat(GL_MODELVIEW_MATRIX, r_world_matrix); // *************** *** 762,772 **** // if (gl_cull.value != 0.0f) ! gl.glEnable(GL.GL_CULL_FACE); else ! gl.glDisable(GL.GL_CULL_FACE); ! gl.glDisable(GL.GL_BLEND); ! gl.glDisable(GL.GL_ALPHA_TEST); ! gl.glEnable(GL.GL_DEPTH_TEST); } --- 757,767 ---- // if (gl_cull.value != 0.0f) ! gl.glEnable(GL_CULL_FACE); else ! gl.glDisable(GL_CULL_FACE); ! gl.glDisable(GL_BLEND); ! gl.glDisable(GL_ALPHA_TEST); ! gl.glEnable(GL_DEPTH_TEST); } *************** *** 782,786 **** if (gl_clear.value != 0.0f) { ! gl.glClear(GL.GL_COLOR_BUFFER_BIT); } --- 777,781 ---- if (gl_clear.value != 0.0f) { ! gl.glClear(GL_COLOR_BUFFER_BIT); } *************** *** 789,809 **** gldepthmin = 0; gldepthmax = 0.49999f; ! gl.glDepthFunc(GL.GL_LEQUAL); } else { gldepthmin = 1; gldepthmax = 0.5f; ! gl.glDepthFunc(GL.GL_GEQUAL); } } else { if (gl_clear.value != 0.0f) ! gl.glClear(GL.GL_COLOR_BUFFER_BIT | GL.GL_DEPTH_BUFFER_BIT); else ! gl.glClear(GL.GL_DEPTH_BUFFER_BIT); gldepthmin = 0; gldepthmax = 1; ! gl.glDepthFunc(GL.GL_LEQUAL); } gl.glDepthRange(gldepthmin, gldepthmax); --- 784,804 ---- gldepthmin = 0; gldepthmax = 0.49999f; ! gl.glDepthFunc(GL_LEQUAL); } else { gldepthmin = 1; gldepthmax = 0.5f; ! gl.glDepthFunc(GL_GEQUAL); } } else { if (gl_clear.value != 0.0f) ! gl.glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); else ! gl.glClear(GL_DEPTH_BUFFER_BIT); gldepthmin = 0; gldepthmax = 1; ! gl.glDepthFunc(GL_LEQUAL); } gl.glDepthRange(gldepthmin, gldepthmax); *************** *** 877,889 **** // set 2D virtual screen size gl.glViewport(0, 0, vid.width, vid.height); ! gl.glMatrixMode(GL.GL_PROJECTION); gl.glLoadIdentity(); gl.glOrtho(0, vid.width, vid.height, 0, -99999, 99999); ! gl.glMatrixMode(GL.GL_MODELVIEW); gl.glLoadIdentity(); ! gl.glDisable(GL.GL_DEPTH_TEST); ! gl.glDisable(GL.GL_CULL_FACE); ! gl... [truncated message content] |
From: Carsten W. <ca...@us...> - 2005-10-24 22:38:28
|
Update of /cvsroot/jake2/jake2/src/jake2/render/jogl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3942/src/jake2/render/jogl Modified Files: Tag: render-refactoring Main.java Log Message: add R_Init() with default xpos, ypos to 0, 0 Index: Main.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/jogl/Main.java,v retrieving revision 1.8.6.1 retrieving revision 1.8.6.2 diff -C2 -d -r1.8.6.1 -r1.8.6.2 *** Main.java 16 Jul 2005 18:25:37 -0000 1.8.6.1 --- Main.java 24 Oct 2005 22:38:21 -0000 1.8.6.2 *************** *** 1070,1073 **** --- 1070,1077 ---- float[] r_turbsin = new float[256]; + protected boolean R_Init() { + return R_Init(0, 0); + } + protected boolean R_Init(int vid_xpos, int vid_ypos) { |