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); + } + + } |