From: Carsten W. <ca...@us...> - 2005-07-10 17:56:00
|
Update of /cvsroot/jake2/jake2/src/jake2/render/lwjgl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18867/src/jake2/render/lwjgl Modified Files: Tag: render-refactoring Main.java Draw.java Warp.java Model.java Light.java Misc.java Surf.java LWJGLBase.java Mesh.java Image.java Base.java Log Message: modifications to use the QGL interface. all lwjgl specific code is removed Index: Image.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Image.java,v retrieving revision 1.3 retrieving revision 1.3.6.1 diff -C2 -d -r1.3 -r1.3.6.1 *** Image.java 7 May 2005 17:31:37 -0000 1.3 --- Image.java 10 Jul 2005 17:55:51 -0000 1.3.6.1 *************** *** 42,49 **** import java.util.Arrays; - import org.lwjgl.BufferUtils; - import org.lwjgl.opengl.EXTSharedTexturePalette; - import org.lwjgl.opengl.GL11; - /** * Image --- 42,45 ---- *************** *** 76,81 **** int gl_tex_alpha_format = 4; ! int gl_filter_min = GL11.GL_LINEAR_MIPMAP_NEAREST; ! int gl_filter_max = GL11.GL_LINEAR; Image() { --- 72,77 ---- int gl_tex_alpha_format = 4; ! int gl_filter_min = GL_LINEAR_MIPMAP_NEAREST; ! int gl_filter_max = GL_LINEAR; Image() { *************** *** 97,101 **** if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f) { ! ByteBuffer temptable=BufferUtils.createByteBuffer(768); for (i = 0; i < 256; i++) { temptable.put(i * 3 + 0, (byte) ((palette[i] >> 0) & 0xff)); --- 93,97 ---- if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f) { ! ByteBuffer temptable = Lib.newByteBuffer(768); for (i = 0; i < 256; i++) { temptable.put(i * 3 + 0, (byte) ((palette[i] >> 0) & 0xff)); *************** *** 104,108 **** } ! gl.glColorTable(EXTSharedTexturePalette.GL_SHARED_TEXTURE_PALETTE_EXT, GL11.GL_RGB, 256, GL11.GL_RGB, GL11.GL_UNSIGNED_BYTE, temptable); } } --- 100,104 ---- } ! glColorTable(GL_SHARED_TEXTURE_PALETTE_EXT, GL_RGB, 256, GL_RGB, GL_UNSIGNED_BYTE, temptable); } } *************** *** 110,124 **** void GL_EnableMultitexture(boolean enable) { if (enable) { ! GL_SelectTexture(GL_TEXTURE1); ! gl.glEnable(GL11.GL_TEXTURE_2D); ! GL_TexEnv(GL11.GL_REPLACE); } else { ! GL_SelectTexture(GL_TEXTURE1); ! gl.glDisable(GL11.GL_TEXTURE_2D); ! GL_TexEnv(GL11.GL_REPLACE); } ! GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv(GL11.GL_REPLACE); } --- 106,120 ---- void GL_EnableMultitexture(boolean enable) { if (enable) { ! GL_SelectTexture(TEXTURE1); ! glEnable(GL_TEXTURE_2D); ! GL_TexEnv(GL_REPLACE); } else { ! GL_SelectTexture(TEXTURE1); ! glDisable(GL_TEXTURE_2D); ! GL_TexEnv(GL_REPLACE); } ! GL_SelectTexture(TEXTURE0); ! GL_TexEnv(GL_REPLACE); } *************** *** 126,130 **** int tmu; ! tmu = (texture == GL_TEXTURE0) ? 0 : 1; if (tmu == gl_state.currenttmu) { --- 122,126 ---- int tmu; ! tmu = (texture == TEXTURE0) ? 0 : 1; if (tmu == gl_state.currenttmu) { *************** *** 134,139 **** gl_state.currenttmu = tmu; ! gl.glActiveTextureARB(texture); ! gl.glClientActiveTextureARB(texture); } --- 130,135 ---- gl_state.currenttmu = tmu; ! glActiveTextureARB(texture); ! glClientActiveTextureARB(texture); } *************** *** 144,148 **** if (mode != lastmodes[gl_state.currenttmu]) { ! gl.glTexEnvi(GL11.GL_TEXTURE_ENV, GL11.GL_TEXTURE_ENV_MODE, mode); lastmodes[gl_state.currenttmu] = mode; } --- 140,144 ---- if (mode != lastmodes[gl_state.currenttmu]) { ! glTexEnvi(GL_TEXTURE_ENV, GL_TEXTURE_ENV_MODE, mode); lastmodes[gl_state.currenttmu] = mode; } *************** *** 159,168 **** gl_state.currenttextures[gl_state.currenttmu] = texnum; ! gl.glBindTexture(GL11.GL_TEXTURE_2D, texnum); } void GL_MBind(int target /* GLenum */, int texnum) { GL_SelectTexture(target); ! if (target == GL_TEXTURE0) { if (gl_state.currenttextures[0] == texnum) return; --- 155,164 ---- gl_state.currenttextures[gl_state.currenttmu] = texnum; ! glBindTexture(GL_TEXTURE_2D, texnum); } void GL_MBind(int target /* GLenum */, int texnum) { GL_SelectTexture(target); ! if (target == TEXTURE0) { if (gl_state.currenttextures[0] == texnum) return; *************** *** 189,198 **** static final glmode_t modes[] = { ! new glmode_t("GL_NEAREST", GL11.GL_NEAREST, GL11.GL_NEAREST), ! new glmode_t("GL_LINEAR", GL11.GL_LINEAR, GL11.GL_LINEAR), ! new glmode_t("GL_NEAREST_MIPMAP_NEAREST", GL11.GL_NEAREST_MIPMAP_NEAREST, GL11.GL_NEAREST), ! new glmode_t("GL_LINEAR_MIPMAP_NEAREST", GL11.GL_LINEAR_MIPMAP_NEAREST, GL11.GL_LINEAR), ! new glmode_t("GL_NEAREST_MIPMAP_LINEAR", GL11.GL_NEAREST_MIPMAP_LINEAR, GL11.GL_NEAREST), ! new glmode_t("GL_LINEAR_MIPMAP_LINEAR", GL11.GL_LINEAR_MIPMAP_LINEAR, GL11.GL_LINEAR)}; static final int NUM_GL_MODES = modes.length; --- 185,194 ---- 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; *************** *** 212,220 **** { new gltmode_t("default", 4), ! new gltmode_t("GL_RGBA", GL11.GL_RGBA), ! new gltmode_t("GL_RGBA8", GL11.GL_RGBA8), ! new gltmode_t("GL_RGB5_A1", GL11.GL_RGB5_A1), ! new gltmode_t("GL_RGBA4", GL11.GL_RGBA4), ! new gltmode_t("GL_RGBA2", GL11.GL_RGBA2), }; --- 208,216 ---- { 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), }; *************** *** 224,232 **** { new gltmode_t("default", 3), ! new gltmode_t("GL_RGB", GL11.GL_RGB), ! new gltmode_t("GL_RGB8", GL11.GL_RGB8), ! new gltmode_t("GL_RGB5", GL11.GL_RGB5), ! new gltmode_t("GL_RGB4", GL11.GL_RGB4), ! new gltmode_t("GL_R3_G3_B2", GL11.GL_R3_G3_B2), // #ifdef GL_RGB2_EXT //new gltmode_t("GL_RGB2", GL.GL_RGB2_EXT) --- 220,228 ---- { 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), // #ifdef GL_RGB2_EXT //new gltmode_t("GL_RGB2", GL.GL_RGB2_EXT) *************** *** 264,269 **** if (glt.type != it_pic && glt.type != it_sky) { GL_Bind(glt.texnum); ! gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, gl_filter_min); ! gl.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, gl_filter_max); } } --- 260,265 ---- if (glt.type != it_pic && glt.type != it_sky) { GL_Bind(glt.texnum); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); ! glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } } *************** *** 1055,1059 **** int[] scaled = new int[256 * 256]; //byte[] paletted_texture = new byte[256 * 256]; ! ByteBuffer paletted_texture=BufferUtils.createByteBuffer(256*256); IntBuffer tex = Lib.newIntBuffer(512 * 256, ByteOrder.LITTLE_ENDIAN); --- 1051,1055 ---- int[] scaled = new int[256 * 256]; //byte[] paletted_texture = new byte[256 * 256]; ! ByteBuffer paletted_texture = Lib.newByteBuffer(256*256); IntBuffer tex = Lib.newIntBuffer(512 * 256, ByteOrder.LITTLE_ENDIAN); *************** *** 1128,1133 **** uploaded_paletted = true; GL_BuildPalettedTexture(paletted_texture, data, scaled_width, scaled_height); ! gl.glTexImage2D( ! GL11.GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, --- 1124,1129 ---- uploaded_paletted = true; GL_BuildPalettedTexture(paletted_texture, data, scaled_width, scaled_height); ! glTexImage2D( ! GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, *************** *** 1135,1146 **** scaled_height, 0, ! GL11.GL_COLOR_INDEX, ! GL11.GL_UNSIGNED_BYTE, paletted_texture); } else { tex.rewind(); tex.put(data); tex.rewind(); ! gl.glTexImage2D( ! GL11.GL_TEXTURE_2D, 0, comp, --- 1131,1142 ---- scaled_height, 0, ! GL_COLOR_INDEX, ! GL_UNSIGNED_BYTE, paletted_texture); } else { tex.rewind(); tex.put(data); tex.rewind(); ! glTexImage2D( ! GL_TEXTURE_2D, 0, comp, *************** *** 1148,1153 **** scaled_height, 0, ! GL11.GL_RGBA, ! GL11.GL_UNSIGNED_BYTE, tex); } --- 1144,1149 ---- scaled_height, 0, ! GL_RGBA, ! GL_UNSIGNED_BYTE, tex); } *************** *** 1166,1171 **** uploaded_paletted = true; GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! gl.glTexImage2D( ! GL11.GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, --- 1162,1167 ---- uploaded_paletted = true; GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! glTexImage2D( ! GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, *************** *** 1173,1183 **** scaled_height, 0, ! GL11.GL_COLOR_INDEX, ! GL11.GL_UNSIGNED_BYTE, paletted_texture); } else { tex.rewind(); tex.put(scaled); tex.rewind(); ! gl.glTexImage2D(GL11.GL_TEXTURE_2D, 0, comp, scaled_width, scaled_height, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, tex); } --- 1169,1179 ---- scaled_height, 0, ! GL_COLOR_INDEX, ! GL_UNSIGNED_BYTE, paletted_texture); } else { tex.rewind(); tex.put(scaled); tex.rewind(); ! glTexImage2D(GL_TEXTURE_2D, 0, comp, scaled_width, scaled_height, 0, GL_RGBA, GL_UNSIGNED_BYTE, tex); } *************** *** 1198,1203 **** uploaded_paletted = true; GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! gl.glTexImage2D( ! GL11.GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, --- 1194,1199 ---- uploaded_paletted = true; GL_BuildPalettedTexture(paletted_texture, scaled, scaled_width, scaled_height); ! glTexImage2D( ! GL_TEXTURE_2D, miplevel, GL_COLOR_INDEX8_EXT, *************** *** 1205,1216 **** scaled_height, 0, ! GL11.GL_COLOR_INDEX, ! GL11.GL_UNSIGNED_BYTE, paletted_texture); } else { tex.rewind(); tex.put(scaled); tex.rewind(); ! gl.glTexImage2D( ! GL11.GL_TEXTURE_2D, miplevel, comp, --- 1201,1212 ---- scaled_height, 0, ! GL_COLOR_INDEX, ! GL_UNSIGNED_BYTE, paletted_texture); } else { tex.rewind(); tex.put(scaled); tex.rewind(); ! glTexImage2D( ! GL_TEXTURE_2D, miplevel, comp, *************** *** 1218,1223 **** scaled_height, 0, ! GL11.GL_RGBA, ! GL11.GL_UNSIGNED_BYTE, tex); } --- 1214,1219 ---- scaled_height, 0, ! GL_RGBA, ! GL_UNSIGNED_BYTE, tex); } *************** *** 1231,1240 **** if (mipmap) { ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, gl_filter_min); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, gl_filter_max); } else { ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, gl_filter_max); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, gl_filter_max); } --- 1227,1236 ---- if (mipmap) { ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_min); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } else { ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); } *************** *** 1262,1269 **** if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { ! gl.glTexImage2D(GL11.GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, width, height, 0, GL11.GL_COLOR_INDEX, GL11.GL_UNSIGNED_BYTE, ByteBuffer.wrap(data)); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, gl_filter_max); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, gl_filter_max); // TODO check this --- 1258,1265 ---- if (qglColorTableEXT && gl_ext_palettedtexture.value != 0.0f && is_sky) { ! glTexImage2D(GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, width, height, 0, GL_COLOR_INDEX, GL_UNSIGNED_BYTE, ByteBuffer.wrap(data)); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, gl_filter_max); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, gl_filter_max); // TODO check this *************** *** 1540,1544 **** } ! IntBuffer texnumBuffer=BufferUtils.createIntBuffer(1); /* --- 1536,1540 ---- } ! IntBuffer texnumBuffer=Lib.newIntBuffer(1); /* *************** *** 1574,1578 **** texnumBuffer.clear(); texnumBuffer.put(0,image.texnum); ! gl.glDeleteTextures(texnumBuffer); image.clear(); } --- 1570,1574 ---- texnumBuffer.clear(); texnumBuffer.put(0,image.texnum); ! glDeleteTextures(texnumBuffer); image.clear(); } *************** *** 1586,1596 **** protected void Draw_GetPalette() { int r, g, b; - Dimension dim; - byte[] pic; byte[][] palette = new byte[1][]; //new byte[768]; // get the palette ! pic = LoadPCX("pics/colormap.pcx", palette, dim = new Dimension()); if (palette[0] == null || palette[0].length != 768) --- 1582,1590 ---- protected void Draw_GetPalette() { int r, g, b; byte[][] palette = new byte[1][]; //new byte[768]; // get the palette ! LoadPCX("pics/colormap.pcx", palette, null); if (palette[0] == null || palette[0].length != 768) *************** *** 1686,1690 **** texnumBuffer.clear(); texnumBuffer.put(0,image.texnum); ! gl.glDeleteTextures(texnumBuffer); image.clear(); } --- 1680,1684 ---- texnumBuffer.clear(); texnumBuffer.put(0,image.texnum); ! glDeleteTextures(texnumBuffer); image.clear(); } Index: Surf.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Surf.java,v retrieving revision 1.9 retrieving revision 1.9.4.1 diff -C2 -d -r1.9 -r1.9.4.1 *** Surf.java 8 Jun 2005 21:27:10 -0000 1.9 --- Surf.java 10 Jul 2005 17:55:50 -0000 1.9.4.1 *************** *** 37,43 **** import java.util.Arrays; - import org.lwjgl.BufferUtils; - import org.lwjgl.opengl.GL11; - /** * Surf --- 37,40 ---- *************** *** 65,69 **** int c_visible_textures; ! static final int GL_LIGHTMAP_FORMAT = GL11.GL_RGBA; static class gllightmapstate_t --- 62,66 ---- int c_visible_textures; ! static final int GL_LIGHTMAP_FORMAT = GL_RGBA; static class gllightmapstate_t *************** *** 139,143 **** void DrawGLPoly(glpoly_t p) { ! gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); } --- 136,140 ---- void DrawGLPoly(glpoly_t p) { ! glDrawArrays(GL_POLYGON, p.pos, p.numverts); } *************** *** 152,156 **** scroll = -64.0f; p.beginScrolling(scroll); ! gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } --- 149,153 ---- scroll = -64.0f; p.beginScrolling(scroll); ! glDrawArrays(GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } *************** *** 164,170 **** return; ! gl.glDisable(GL11.GL_TEXTURE_2D); ! gl.glDisable(GL11.GL_DEPTH_TEST); ! gl.glColor4f(1, 1, 1, 1); msurface_t surf; --- 161,167 ---- return; ! glDisable(GL_TEXTURE_2D); ! glDisable(GL_DEPTH_TEST); ! glColor4f(1, 1, 1, 1); msurface_t surf; *************** *** 175,184 **** for (p = surf.polys; p != null; p = p.chain) { for (j = 2; j < p.numverts; j++) { ! gl.glBegin(GL11.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)); ! gl.glVertex3f(p.x(j), p.y(j), p.z(j)); ! gl.glVertex3f(p.x(0), p.y(0), p.z(0)); ! gl.glEnd(); } } --- 172,181 ---- for (p = surf.polys; p != null; p = p.chain) { for (j = 2; j < p.numverts; j++) { ! glBegin(GL_LINE_STRIP); ! glVertex3f(p.x(0), p.y(0), p.z(0)); ! glVertex3f(p.x(j-1), p.y(j-1), p.z(j-1)); ! glVertex3f(p.x(j), p.y(j), p.z(j)); ! glVertex3f(p.x(0), p.y(0), p.z(0)); ! glEnd(); } } *************** *** 186,191 **** } ! gl.glEnable(GL11.GL_DEPTH_TEST); ! gl.glEnable(GL11.GL_TEXTURE_2D); } --- 183,188 ---- } ! glEnable(GL_DEPTH_TEST); ! glEnable(GL_TEXTURE_2D); } *************** *** 206,216 **** // warp texture, no lightmaps ! GL_TexEnv( GL11.GL_MODULATE ); ! gl.glColor4f( gl_state.inverse_intensity, gl_state.inverse_intensity, gl_state.inverse_intensity, 1.0F ); EmitWaterPolys (fa); ! GL_TexEnv( GL11.GL_REPLACE ); return; --- 203,213 ---- // warp texture, no lightmaps ! GL_TexEnv( GL_MODULATE ); ! glColor4f( gl_state.inverse_intensity, gl_state.inverse_intensity, gl_state.inverse_intensity, 1.0F ); EmitWaterPolys (fa); ! GL_TexEnv( GL_REPLACE ); return; *************** *** 219,223 **** { GL_Bind( image.texnum ); ! GL_TexEnv( GL11.GL_REPLACE ); } --- 216,220 ---- { GL_Bind( image.texnum ); ! GL_TexEnv( GL_REPLACE ); } *************** *** 277,285 **** GL_Bind( gl_state.lightmap_textures + fa.lightmaptexturenum ); ! gl.glTexSubImage2D( GL11.GL_TEXTURE_2D, 0, fa.light_s, fa.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL11.GL_UNSIGNED_BYTE, temp2 ); fa.lightmapchain = gl_lms.lightmap_surfaces[fa.lightmaptexturenum]; --- 274,282 ---- GL_Bind( gl_state.lightmap_textures + fa.lightmaptexturenum ); ! glTexSubImage2D( GL_TEXTURE_2D, 0, fa.light_s, fa.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, temp2 ); fa.lightmapchain = gl_lms.lightmap_surfaces[fa.lightmaptexturenum]; *************** *** 312,319 **** // go back to the world matrix // ! gl.glLoadMatrix(r_world_matrix); ! gl.glEnable (GL11.GL_BLEND); ! GL_TexEnv(GL11.GL_MODULATE ); --- 309,316 ---- // go back to the world matrix // ! glLoadMatrix(r_world_matrix); ! glEnable (GL_BLEND); ! GL_TexEnv(GL_MODULATE ); *************** *** 322,326 **** float intens = gl_state.inverse_intensity; ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); for (msurface_t s = r_alpha_surfaces ; s != null ; s=s.texturechain) --- 319,323 ---- float intens = gl_state.inverse_intensity; ! glInterleavedArrays(GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); for (msurface_t s = r_alpha_surfaces ; s != null ; s=s.texturechain) *************** *** 329,337 **** c_brush_polys++; if ((s.texinfo.flags & Defines.SURF_TRANS33) != 0) ! gl.glColor4f (intens, intens, intens, 0.33f); else if ((s.texinfo.flags & Defines.SURF_TRANS66) != 0) ! gl.glColor4f (intens, intens, intens, 0.66f); else ! gl.glColor4f (intens,intens,intens,1); if ((s.flags & Defines.SURF_DRAWTURB) != 0) EmitWaterPolys(s); --- 326,334 ---- c_brush_polys++; if ((s.texinfo.flags & Defines.SURF_TRANS33) != 0) ! glColor4f (intens, intens, intens, 0.33f); else if ((s.texinfo.flags & Defines.SURF_TRANS66) != 0) ! glColor4f (intens, intens, intens, 0.66f); else ! glColor4f (intens,intens,intens,1); if ((s.flags & Defines.SURF_DRAWTURB) != 0) EmitWaterPolys(s); *************** *** 342,348 **** } ! GL_TexEnv( GL11.GL_REPLACE ); ! gl.glColor4f (1,1,1,1); ! gl.glDisable (GL11.GL_BLEND); r_alpha_surfaces = null; --- 339,345 ---- } ! GL_TexEnv( GL_REPLACE ); ! glColor4f (1,1,1,1); ! glDisable (GL_BLEND); r_alpha_surfaces = null; *************** *** 396,400 **** } ! GL_TexEnv( GL11.GL_REPLACE ); } --- 393,397 ---- } ! GL_TexEnv( GL_REPLACE ); } *************** *** 455,467 **** R_SetCacheState( surf ); ! GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + surf.lightmaptexturenum ); lmtex = surf.lightmaptexturenum; ! gl.glTexSubImage2D( GL11.GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL11.GL_UNSIGNED_BYTE, temp ); } --- 452,464 ---- R_SetCacheState( surf ); ! GL_MBind(TEXTURE1, gl_state.lightmap_textures + surf.lightmaptexturenum ); lmtex = surf.lightmaptexturenum; ! glTexSubImage2D( GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, temp ); } *************** *** 473,485 **** R_BuildLightMap( surf, temp, smax); ! GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + 0 ); lmtex = 0; ! gl.glTexSubImage2D( GL11.GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL11.GL_UNSIGNED_BYTE, temp ); } --- 470,482 ---- R_BuildLightMap( surf, temp, smax); ! GL_MBind(TEXTURE1, gl_state.lightmap_textures + 0 ); lmtex = 0; ! glTexSubImage2D( GL_TEXTURE_2D, 0, surf.light_s, surf.light_t, smax, tmax, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, temp ); } *************** *** 487,492 **** c_brush_polys++; ! GL_MBind( GL_TEXTURE0, image.texnum ); ! GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + lmtex ); // ========== --- 484,489 ---- c_brush_polys++; ! GL_MBind(TEXTURE0, image.texnum ); ! GL_MBind(TEXTURE1, gl_state.lightmap_textures + lmtex ); // ========== *************** *** 503,507 **** { p.beginScrolling(scroll); ! gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } --- 500,504 ---- { p.beginScrolling(scroll); ! glDrawArrays(GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } *************** *** 511,515 **** for ( p = surf.polys; p != null; p = p.chain ) { ! gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); } } --- 508,512 ---- for ( p = surf.polys; p != null; p = p.chain ) { ! glDrawArrays(GL_POLYGON, p.pos, p.numverts); } } *************** *** 521,526 **** c_brush_polys++; ! GL_MBind( GL_TEXTURE0, image.texnum ); ! GL_MBind( GL_TEXTURE1, gl_state.lightmap_textures + lmtex); // ========== --- 518,523 ---- c_brush_polys++; ! GL_MBind(TEXTURE0, image.texnum ); ! GL_MBind(TEXTURE1, gl_state.lightmap_textures + lmtex); // ========== *************** *** 537,541 **** { p.beginScrolling(scroll); ! gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } --- 534,538 ---- { p.beginScrolling(scroll); ! glDrawArrays(GL_POLYGON, p.pos, p.numverts); p.endScrolling(); } *************** *** 547,551 **** for ( p = surf.polys; p != null; p = p.chain ) { ! gl.glDrawArrays(GL11.GL_POLYGON, p.pos, p.numverts); } --- 544,548 ---- for ( p = surf.polys; p != null; p = p.chain ) { ! glDrawArrays(GL_POLYGON, p.pos, p.numverts); } *************** *** 581,587 **** if ( (currententity.flags & Defines.RF_TRANSLUCENT) != 0 ) { ! gl.glEnable (GL11.GL_BLEND); ! gl.glColor4f (1,1,1,0.25f); ! GL_TexEnv( GL11.GL_MODULATE ); } --- 578,584 ---- if ( (currententity.flags & Defines.RF_TRANSLUCENT) != 0 ) { ! glEnable (GL_BLEND); ! glColor4f (1,1,1,0.25f); ! GL_TexEnv( GL_MODULATE ); } *************** *** 623,629 **** if ( (currententity.flags & Defines.RF_TRANSLUCENT) != 0 ) { ! gl.glDisable (GL11.GL_BLEND); ! gl.glColor4f (1,1,1,1); ! GL_TexEnv( GL11.GL_REPLACE ); } } --- 620,626 ---- if ( (currententity.flags & Defines.RF_TRANSLUCENT) != 0 ) { ! glDisable (GL_BLEND); ! glColor4f (1,1,1,1); ! GL_TexEnv( GL_REPLACE ); } } *************** *** 666,670 **** if (R_CullBox(mins, maxs)) return; ! gl.glColor3f (1,1,1); // memset (gl_lms.lightmap_surfaces, 0, sizeof(gl_lms.lightmap_surfaces)); --- 663,667 ---- if (R_CullBox(mins, maxs)) return; ! glColor3f (1,1,1); // memset (gl_lms.lightmap_surfaces, 0, sizeof(gl_lms.lightmap_surfaces)); *************** *** 683,687 **** } ! gl.glPushMatrix(); e.angles[0] = -e.angles[0]; // stupid quake bug --- 680,684 ---- } ! glPushMatrix(); e.angles[0] = -e.angles[0]; // stupid quake bug *************** *** 692,711 **** GL_EnableMultitexture( true ); ! GL_SelectTexture(GL_TEXTURE0); ! GL_TexEnv( GL11.GL_REPLACE ); ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! GL_SelectTexture(GL_TEXTURE1); ! GL_TexEnv( GL11.GL_MODULATE ); ! gl.glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); R_DrawInlineBModel(); ! gl.glClientActiveTextureARB(GL_TEXTURE1); ! gl.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture( false ); ! gl.glPopMatrix(); } --- 689,708 ---- GL_EnableMultitexture( true ); ! GL_SelectTexture(TEXTURE0); ! GL_TexEnv( GL_REPLACE ); ! glInterleavedArrays(GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! GL_SelectTexture(TEXTURE1); ! GL_TexEnv( GL_MODULATE ); ! glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! glEnableClientState(GL_TEXTURE_COORD_ARRAY); R_DrawInlineBModel(); ! glClientActiveTextureARB(TEXTURE1); ! glDisableClientState(GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture( false ); ! glPopMatrix(); } *************** *** 867,871 **** gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; ! gl.glColor3f (1,1,1); // memset (gl_lms.lightmap_surfaces, 0, sizeof(gl_lms.lightmap_surfaces)); // TODO wird bei multitexture nicht gebraucht --- 864,868 ---- gl_state.currenttextures[0] = gl_state.currenttextures[1] = -1; ! glColor3f (1,1,1); // memset (gl_lms.lightmap_surfaces, 0, sizeof(gl_lms.lightmap_surfaces)); // TODO wird bei multitexture nicht gebraucht *************** *** 876,895 **** GL_EnableMultitexture( true ); ! GL_SelectTexture( GL_TEXTURE0); ! GL_TexEnv( GL11.GL_REPLACE ); ! gl.glInterleavedArrays(GL11.GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! GL_SelectTexture( GL_TEXTURE1); ! gl.glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! gl.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY); if ( gl_lightmap.value != 0) ! GL_TexEnv( GL11.GL_REPLACE ); else ! GL_TexEnv( GL11.GL_MODULATE ); R_RecursiveWorldNode(r_worldmodel.nodes[0]); // root node ! gl.glClientActiveTextureARB(GL_TEXTURE1); ! gl.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture( false ); --- 873,892 ---- GL_EnableMultitexture( true ); ! GL_SelectTexture(TEXTURE0); ! GL_TexEnv( GL_REPLACE ); ! glInterleavedArrays(GL_T2F_V3F, Polygon.BYTE_STRIDE, globalPolygonInterleavedBuf); ! GL_SelectTexture(TEXTURE1); ! glTexCoordPointer(2, Polygon.BYTE_STRIDE, globalPolygonTexCoord1Buf); ! 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 ! glClientActiveTextureARB(TEXTURE1); ! glDisableClientState(GL_TEXTURE_COORD_ARRAY); GL_EnableMultitexture( false ); *************** *** 1000,1005 **** GL_Bind( gl_state.lightmap_textures + texture ); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); gl_lms.lightmap_buffer.rewind(); --- 997,1002 ---- GL_Bind( gl_state.lightmap_textures + texture ); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); gl_lms.lightmap_buffer.rewind(); *************** *** 1013,1027 **** } ! gl.glTexSubImage2D( GL11.GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, height, GL_LIGHTMAP_FORMAT, ! GL11.GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer ); } else { ! gl.glTexImage2D( GL11.GL_TEXTURE_2D, 0, gl_lms.internal_format, --- 1010,1024 ---- } ! glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0, BLOCK_WIDTH, height, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer ); } else { ! glTexImage2D( GL_TEXTURE_2D, 0, gl_lms.internal_format, *************** *** 1029,1033 **** 0, GL_LIGHTMAP_FORMAT, ! GL11.GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) --- 1026,1030 ---- 0, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, gl_lms.lightmap_buffer ); if ( ++gl_lms.current_lightmap_texture == MAX_LIGHTMAPS ) *************** *** 1188,1192 **** lightstyle_t[] lightstyles; ! private final IntBuffer dummy = BufferUtils.createIntBuffer(128*128); /** --- 1185,1189 ---- lightstyle_t[] lightstyles; ! private final IntBuffer dummy = Lib.newIntBuffer(128*128); /** *************** *** 1213,1217 **** GL_EnableMultitexture( true ); ! GL_SelectTexture( GL_TEXTURE1); /* --- 1210,1214 ---- GL_EnableMultitexture( true ); ! GL_SelectTexture(TEXTURE1); /* *************** *** 1264,1272 **** else if ( format == 'I' ) { ! gl_lms.internal_format = GL11.GL_INTENSITY8; } else if ( format == 'L' ) { ! gl_lms.internal_format = GL11.GL_LUMINANCE8; } else --- 1261,1269 ---- else if ( format == 'I' ) { ! gl_lms.internal_format = GL_INTENSITY8; } else if ( format == 'L' ) { ! gl_lms.internal_format = GL_LUMINANCE8; } else *************** *** 1279,1285 **** */ GL_Bind( gl_state.lightmap_textures + 0 ); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); ! gl.glTexImage2D( GL11.GL_TEXTURE_2D, 0, gl_lms.internal_format, --- 1276,1282 ---- */ GL_Bind( gl_state.lightmap_textures + 0 ); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); ! glTexImage2D( GL_TEXTURE_2D, 0, gl_lms.internal_format, *************** *** 1287,1291 **** 0, GL_LIGHTMAP_FORMAT, ! GL11.GL_UNSIGNED_BYTE, dummy ); } --- 1284,1288 ---- 0, GL_LIGHTMAP_FORMAT, ! GL_UNSIGNED_BYTE, dummy ); } Index: Light.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Light.java,v retrieving revision 1.4 retrieving revision 1.4.6.1 diff -C2 -d -r1.4 -r1.4.6.1 *** Light.java 7 May 2005 17:21:42 -0000 1.4 --- Light.java 10 Jul 2005 17:55:50 -0000 1.4.6.1 *************** *** 39,44 **** import java.util.Arrays; - import org.lwjgl.opengl.GL11; - /** * Light --- 39,42 ---- *************** *** 72,83 **** Math3D.VectorSubtract (light.origin, r_origin, v); ! gl.glBegin (GL11.GL_TRIANGLE_FAN); ! gl.glColor3f (light.color[0]*0.2f, light.color[1]*0.2f, light.color[2]*0.2f); int i; for (i=0 ; i<3 ; i++) v[i] = light.origin[i] - vpn[i]*rad; ! gl.glVertex3f(v[0], v[1], v[2]); ! gl.glColor3f (0,0,0); int j; --- 70,81 ---- Math3D.VectorSubtract (light.origin, r_origin, v); ! glBegin (GL_TRIANGLE_FAN); ! glColor3f (light.color[0]*0.2f, light.color[1]*0.2f, light.color[2]*0.2f); int i; for (i=0 ; i<3 ; i++) v[i] = light.origin[i] - vpn[i]*rad; ! glVertex3f(v[0], v[1], v[2]); ! glColor3f (0,0,0); int j; *************** *** 89,95 **** v[j] = (float)(light.origin[j] + vright[j]*Math.cos(a)*rad + vup[j]*Math.sin(a)*rad); ! gl.glVertex3f(v[0], v[1], v[2]); } ! gl.glEnd (); } --- 87,93 ---- v[j] = (float)(light.origin[j] + vright[j]*Math.cos(a)*rad + vup[j]*Math.sin(a)*rad); ! glVertex3f(v[0], v[1], v[2]); } ! glEnd (); } *************** *** 104,112 **** r_dlightframecount = r_framecount + 1; // because the count hasn't // advanced yet for this frame ! gl.glDepthMask(false); ! gl.glDisable(GL11.GL_TEXTURE_2D); ! gl.glShadeModel (GL11.GL_SMOOTH); ! gl.glEnable (GL11.GL_BLEND); ! gl.glBlendFunc (GL11.GL_ONE, GL11.GL_ONE); for (int i=0 ; i<r_newrefdef.num_dlights ; i++) --- 102,110 ---- r_dlightframecount = r_framecount + 1; // because the count hasn't // advanced yet for this frame ! glDepthMask(false); ! glDisable(GL_TEXTURE_2D); ! glShadeModel (GL_SMOOTH); ! glEnable (GL_BLEND); ! glBlendFunc (GL_ONE, GL_ONE); for (int i=0 ; i<r_newrefdef.num_dlights ; i++) *************** *** 115,123 **** } ! gl.glColor3f (1,1,1); ! gl.glDisable(GL11.GL_BLEND); ! gl.glEnable(GL11.GL_TEXTURE_2D); ! gl.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); ! gl.glDepthMask(true); } --- 113,121 ---- } ! glColor3f (1,1,1); ! glDisable(GL_BLEND); ! glEnable(GL_TEXTURE_2D); ! glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); ! glDepthMask(true); } Index: Base.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Base.java,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** Base.java 8 Jun 2005 21:24:52 -0000 1.4 --- Base.java 10 Jul 2005 17:55:51 -0000 1.4.4.1 *************** *** 26,30 **** package jake2.render.lwjgl; ! import org.lwjgl.opengl.GL11; /** --- 26,34 ---- package jake2.render.lwjgl; ! import jake2.client.viddef_t; ! import jake2.game.cvar_t; ! import jake2.render.QGL; ! ! import java.awt.Dimension; /** *************** *** 33,51 **** * @author dsanders/cwei */ ! public abstract class Base extends LWJGLBase { ! ! static final int GL_COLOR_INDEX8_EXT = GL11.GL_COLOR_INDEX; ! static final String REF_VERSION = "GL 0.01"; ! // up / down static final int PITCH = 0; ! // left / right static final int YAW = 1; ! // fall over static final int ROLL = 2; ! /* * skins will be outline flood filled and mip mapped pics and sprites with --- 37,55 ---- * @author dsanders/cwei */ ! public abstract class Base extends QGL { ! ! static final int GL_COLOR_INDEX8_EXT = GL_COLOR_INDEX; ! static final String REF_VERSION = "GL 0.01"; ! // up / down static final int PITCH = 0; ! // left / right static final int YAW = 1; ! // fall over static final int ROLL = 2; ! /* * skins will be outline flood filled and mip mapped pics and sprites with *************** *** 56,154 **** // enum imagetype_t static final int it_skin = 0; ! static final int it_sprite = 1; ! static final int it_wall = 2; ! static final int it_pic = 3; ! static final int it_sky = 4; ! // enum modtype_t static final int mod_bad = 0; ! static final int mod_brush = 1; ! static final int mod_sprite = 2; ! static final int mod_alias = 3; ! static final int TEXNUM_LIGHTMAPS = 1024; ! static final int TEXNUM_SCRAPS = 1152; ! static final int TEXNUM_IMAGES = 1153; ! static final int MAX_GLTEXTURES = 1024; ! static final int MAX_LBM_HEIGHT = 480; ! static final float BACKFACE_EPSILON = 0.01f; ! /* * * GL config stuff */ static final int GL_RENDERER_VOODOO = 0x00000001; ! static final int GL_RENDERER_VOODOO2 = 0x00000002; ! static final int GL_RENDERER_VOODOO_RUSH = 0x00000004; ! static final int GL_RENDERER_BANSHEE = 0x00000008; ! static final int GL_RENDERER_3DFX = 0x0000000F; ! static final int GL_RENDERER_PCX1 = 0x00000010; ! static final int GL_RENDERER_PCX2 = 0x00000020; ! static final int GL_RENDERER_PMX = 0x00000040; ! static final int GL_RENDERER_POWERVR = 0x00000070; ! static final int GL_RENDERER_PERMEDIA2 = 0x00000100; ! static final int GL_RENDERER_GLINT_MX = 0x00000200; ! static final int GL_RENDERER_GLINT_TX = 0x00000400; ! static final int GL_RENDERER_3DLABS_MISC = 0x00000800; ! static final int GL_RENDERER_3DLABS = 0x00000F00; ! static final int GL_RENDERER_REALIZM = 0x00001000; ! static final int GL_RENDERER_REALIZM2 = 0x00002000; ! static final int GL_RENDERER_INTERGRAPH = 0x00003000; ! static final int GL_RENDERER_3DPRO = 0x00004000; ! static final int GL_RENDERER_REAL3D = 0x00008000; ! static final int GL_RENDERER_RIVA128 = 0x00010000; ! static final int GL_RENDERER_DYPIC = 0x00020000; ! static final int GL_RENDERER_V1000 = 0x00040000; ! static final int GL_RENDERER_V2100 = 0x00080000; ! static final int GL_RENDERER_V2200 = 0x00100000; ! static final int GL_RENDERER_RENDITION = 0x001C0000; ! static final int GL_RENDERER_O2 = 0x00100000; ! static final int GL_RENDERER_IMPACT = 0x00200000; ! static final int GL_RENDERER_RE = 0x00400000; ! static final int GL_RENDERER_IR = 0x00800000; ! static final int GL_RENDERER_SGI = 0x00F00000; ! static final int GL_RENDERER_MCD = 0x01000000; ! static final int GL_RENDERER_OTHER = 0x80000000; } \ No newline at end of file --- 60,197 ---- // enum imagetype_t static final int it_skin = 0; ! static final int it_sprite = 1; ! static final int it_wall = 2; ! static final int it_pic = 3; ! static final int it_sky = 4; ! // enum modtype_t static final int mod_bad = 0; ! static final int mod_brush = 1; ! static final int mod_sprite = 2; ! static final int mod_alias = 3; ! static final int TEXNUM_LIGHTMAPS = 1024; ! static final int TEXNUM_SCRAPS = 1152; ! static final int TEXNUM_IMAGES = 1153; ! static final int MAX_GLTEXTURES = 1024; ! static final int MAX_LBM_HEIGHT = 480; ! static final float BACKFACE_EPSILON = 0.01f; ! /* * * GL config stuff */ static final int GL_RENDERER_VOODOO = 0x00000001; ! static final int GL_RENDERER_VOODOO2 = 0x00000002; ! static final int GL_RENDERER_VOODOO_RUSH = 0x00000004; ! static final int GL_RENDERER_BANSHEE = 0x00000008; ! static final int GL_RENDERER_3DFX = 0x0000000F; ! static final int GL_RENDERER_PCX1 = 0x00000010; ! static final int GL_RENDERER_PCX2 = 0x00000020; ! static final int GL_RENDERER_PMX = 0x00000040; ! static final int GL_RENDERER_POWERVR = 0x00000070; ! static final int GL_RENDERER_PERMEDIA2 = 0x00000100; ! static final int GL_RENDERER_GLINT_MX = 0x00000200; ! static final int GL_RENDERER_GLINT_TX = 0x00000400; ! static final int GL_RENDERER_3DLABS_MISC = 0x00000800; ! static final int GL_RENDERER_3DLABS = 0x00000F00; ! static final int GL_RENDERER_REALIZM = 0x00001000; ! static final int GL_RENDERER_REALIZM2 = 0x00002000; ! static final int GL_RENDERER_INTERGRAPH = 0x00003000; ! static final int GL_RENDERER_3DPRO = 0x00004000; ! static final int GL_RENDERER_REAL3D = 0x00008000; ! static final int GL_RENDERER_RIVA128 = 0x00010000; ! static final int GL_RENDERER_DYPIC = 0x00020000; ! static final int GL_RENDERER_V1000 = 0x00040000; ! static final int GL_RENDERER_V2100 = 0x00080000; ! static final int GL_RENDERER_V2200 = 0x00100000; ! static final int GL_RENDERER_RENDITION = 0x001C0000; ! static final int GL_RENDERER_O2 = 0x00100000; ! static final int GL_RENDERER_IMPACT = 0x00200000; ! static final int GL_RENDERER_RE = 0x00400000; ! static final int GL_RENDERER_IR = 0x00800000; ! static final int GL_RENDERER_SGI = 0x00F00000; ! static final int GL_RENDERER_MCD = 0x01000000; ! static final int GL_RENDERER_OTHER = 0x80000000; + + /* + * base members + */ + + protected viddef_t vid = new viddef_t(); + + protected cvar_t vid_fullscreen; + + // enum rserr_t + protected static final int rserr_ok = 0; + + protected static final int rserr_invalid_fullscreen = 1; + + protected static final int rserr_invalid_mode = 2; + + protected static final int rserr_unknown = 3; + + 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: Draw.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Draw.java,v retrieving revision 1.2 retrieving revision 1.2.8.1 diff -C2 -d -r1.2 -r1.2.8.1 *** Draw.java 14 Dec 2004 12:56:59 -0000 1.2 --- Draw.java 10 Jul 2005 17:55:50 -0000 1.2.8.1 *************** *** 30,33 **** --- 30,34 ---- import jake2.qcommon.Com; import jake2.render.image_t; + import jake2.util.Lib; import java.awt.Dimension; *************** *** 35,41 **** import java.nio.IntBuffer; - import org.lwjgl.BufferUtils; - import org.lwjgl.opengl.GL11; - /** * Draw --- 36,39 ---- *************** *** 55,60 **** draw_chars = GL_FindImage("pics/conchars.pcx", it_pic); GL_Bind(draw_chars.texnum); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_NEAREST); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_NEAREST); } --- 53,58 ---- draw_chars = GL_FindImage("pics/conchars.pcx", it_pic); GL_Bind(draw_chars.texnum); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); } *************** *** 85,98 **** GL_Bind(draw_chars.texnum); ! gl.glBegin (GL11.GL_QUADS); ! gl.glTexCoord2f (fcol, frow); ! gl.glVertex2f (x, y); ! gl.glTexCoord2f (fcol + size, frow); ! gl.glVertex2f (x+8, y); ! gl.glTexCoord2f (fcol + size, frow + size); ! gl.glVertex2f (x+8, y+8); ! gl.glTexCoord2f (fcol, frow + size); ! gl.glVertex2f (x, y+8); ! gl.glEnd (); } --- 83,96 ---- GL_Bind(draw_chars.texnum); ! glBegin (GL_QUADS); ! glTexCoord2f (fcol, frow); ! glVertex2f (x, y); ! glTexCoord2f (fcol + size, frow); ! glVertex2f (x+8, y); ! glTexCoord2f (fcol + size, frow + size); ! glVertex2f (x+8, y+8); ! glTexCoord2f (fcol, frow + size); ! glVertex2f (x, y+8); ! glEnd (); } *************** *** 150,169 **** if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0) ) && !image.has_alpha) ! gl.glDisable(GL11.GL_ALPHA_TEST); GL_Bind(image.texnum); ! gl.glBegin (GL11.GL_QUADS); ! gl.glTexCoord2f (image.sl, image.tl); ! gl.glVertex2f (x, y); ! gl.glTexCoord2f (image.sh, image.tl); ! gl.glVertex2f (x+w, y); ! gl.glTexCoord2f (image.sh, image.th); ! gl.glVertex2f (x+w, y+h); ! gl.glTexCoord2f (image.sl, image.th); ! gl.glVertex2f (x, y+h); ! gl.glEnd (); if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) !=0 ) ) && !image.has_alpha) ! gl.glEnable(GL11.GL_ALPHA_TEST); } --- 148,167 ---- if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0) ) && !image.has_alpha) ! glDisable(GL_ALPHA_TEST); GL_Bind(image.texnum); ! glBegin (GL_QUADS); ! glTexCoord2f (image.sl, image.tl); ! glVertex2f (x, y); ! glTexCoord2f (image.sh, image.tl); ! glVertex2f (x+w, y); ! glTexCoord2f (image.sh, image.th); ! glVertex2f (x+w, y+h); ! glTexCoord2f (image.sl, image.th); ! glVertex2f (x, y+h); ! glEnd (); if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) !=0 ) ) && !image.has_alpha) ! glEnable(GL_ALPHA_TEST); } *************** *** 188,208 **** if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! gl.glDisable (GL11.GL_ALPHA_TEST); GL_Bind(image.texnum); ! gl.glBegin (GL11.GL_QUADS); ! gl.glTexCoord2f (image.sl, image.tl); ! gl.glVertex2f (x, y); ! gl.glTexCoord2f (image.sh, image.tl); ! gl.glVertex2f (x+image.width, y); ! gl.glTexCoord2f (image.sh, image.th); ! gl.glVertex2f (x+image.width, y+image.height); ! gl.glTexCoord2f (image.sl, image.th); ! gl.glVertex2f (x, y+image.height); ! gl.glEnd (); if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! gl.glEnable (GL11.GL_ALPHA_TEST); } --- 186,206 ---- if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! glDisable (GL_ALPHA_TEST); GL_Bind(image.texnum); ! glBegin (GL_QUADS); ! glTexCoord2f (image.sl, image.tl); ! glVertex2f (x, y); ! glTexCoord2f (image.sh, image.tl); ! glVertex2f (x+image.width, y); ! glTexCoord2f (image.sh, image.th); ! glVertex2f (x+image.width, y+image.height); ! glTexCoord2f (image.sl, image.th); ! glVertex2f (x, y+image.height); ! glEnd (); if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! glEnable (GL_ALPHA_TEST); } *************** *** 226,245 **** if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! gl.glDisable(GL11.GL_ALPHA_TEST); GL_Bind(image.texnum); ! gl.glBegin (GL11.GL_QUADS); ! gl.glTexCoord2f(x/64.0f, y/64.0f); ! gl.glVertex2f (x, y); ! gl.glTexCoord2f( (x+w)/64.0f, y/64.0f); ! gl.glVertex2f(x+w, y); ! gl.glTexCoord2f( (x+w)/64.0f, (y+h)/64.0f); ! gl.glVertex2f(x+w, y+h); ! gl.glTexCoord2f( x/64.0f, (y+h)/64.0f ); ! gl.glVertex2f (x, y+h); ! gl.glEnd (); if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! gl.glEnable(GL11.GL_ALPHA_TEST); } --- 224,243 ---- if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! glDisable(GL_ALPHA_TEST); GL_Bind(image.texnum); ! glBegin (GL_QUADS); ! glTexCoord2f(x/64.0f, y/64.0f); ! glVertex2f (x, y); ! glTexCoord2f( (x+w)/64.0f, y/64.0f); ! glVertex2f(x+w, y); ! glTexCoord2f( (x+w)/64.0f, (y+h)/64.0f); ! glVertex2f(x+w, y+h); ! glTexCoord2f( x/64.0f, (y+h)/64.0f ); ! glVertex2f (x, y+h); ! glEnd (); if ( ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) && !image.has_alpha) ! glEnable(GL_ALPHA_TEST); } *************** *** 257,265 **** Com.Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); ! gl.glDisable(GL11.GL_TEXTURE_2D); int color = d_8to24table[colorIndex]; ! gl.glColor3ub( (byte)((color >> 0) & 0xff), // r (byte)((color >> 8) & 0xff), // g --- 255,263 ---- Com.Error(Defines.ERR_FATAL, "Draw_Fill: bad color"); ! glDisable(GL_TEXTURE_2D); int color = d_8to24table[colorIndex]; ! glColor3ub( (byte)((color >> 0) & 0xff), // r (byte)((color >> 8) & 0xff), // g *************** *** 267,280 **** ); ! gl.glBegin (GL11.GL_QUADS); ! gl.glVertex2f(x,y); ! gl.glVertex2f(x+w, y); ! gl.glVertex2f(x+w, y+h); ! gl.glVertex2f(x, y+h); ! gl.glEnd(); ! gl.glColor3f(1,1,1); ! gl.glEnable(GL11.GL_TEXTURE_2D); } --- 265,278 ---- ); ! glBegin (GL_QUADS); ! glVertex2f(x,y); ! glVertex2f(x+w, y); ! glVertex2f(x+w, y+h); ! glVertex2f(x, y+h); ! glEnd(); ! glColor3f(1,1,1); ! glEnable(GL_TEXTURE_2D); } *************** *** 287,310 **** */ protected void Draw_FadeScreen() { ! gl.glEnable(GL11.GL_BLEND); ! gl.glDisable(GL11.GL_TEXTURE_2D); ! gl.glColor4f(0, 0, 0, 0.8f); ! gl.glBegin(GL11.GL_QUADS); ! gl.glVertex2f(0,0); ! gl.glVertex2f(vid.width, 0); ! gl.glVertex2f(vid.width, vid.height); ! gl.glVertex2f(0, vid.height); ! gl.glEnd(); ! gl.glColor4f(1,1,1,1); ! gl.glEnable(GL11.GL_TEXTURE_2D); ! gl.glDisable(GL11.GL_BLEND); } // ==================================================================== ! IntBuffer image32=BufferUtils.createIntBuffer(256*256); ! ByteBuffer image8=BufferUtils.createByteBuffer(256*256); --- 285,308 ---- */ protected void Draw_FadeScreen() { ! glEnable(GL_BLEND); ! glDisable(GL_TEXTURE_2D); ! glColor4f(0, 0, 0, 0.8f); ! glBegin(GL_QUADS); ! glVertex2f(0,0); ! glVertex2f(vid.width, 0); ! glVertex2f(vid.width, vid.height); ! glVertex2f(0, vid.height); ! glEnd(); ! glColor4f(1,1,1,1); ! glEnable(GL_TEXTURE_2D); ! glDisable(GL_BLEND); } // ==================================================================== ! IntBuffer image32=Lib.newIntBuffer(256*256); ! ByteBuffer image8=Lib.newByteBuffer(256*256); *************** *** 358,362 **** } } ! gl.glTexImage2D (GL11.GL_TEXTURE_2D, 0, gl_tex_solid_format, 256, 256, 0, GL11.GL_RGBA, GL11.GL_UNSIGNED_BYTE, image32); } else --- 356,360 ---- } } ! glTexImage2D (GL_TEXTURE_2D, 0, gl_tex_solid_format, 256, 256, 0, GL_RGBA, GL_UNSIGNED_BYTE, image32); } else *************** *** 382,413 **** } ! gl.glTexImage2D( GL11.GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, 256, 256, 0, ! GL11.GL_COLOR_INDEX, ! GL11.GL_UNSIGNED_BYTE, image8 ); } ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); ! gl.glTexParameterf(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) ! gl.glDisable (GL11.GL_ALPHA_TEST); ! gl.glBegin (GL11.GL_QUADS); ! gl.glTexCoord2f (0, 0); ! gl.glVertex2f (x, y); ! gl.glTexCoord2f (1, 0); ! gl.glVertex2f (x+w, y); ! gl.glTexCoord2f (1, t); ! gl.glVertex2f (x+w, y+h); ! gl.glTexCoord2f (0, t); ! gl.glVertex2f (x, y+h); ! gl.glEnd (); if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) ! gl.glEnable (GL11.GL_ALPHA_TEST); } --- 380,411 ---- } ! glTexImage2D( GL_TEXTURE_2D, 0, GL_COLOR_INDEX8_EXT, 256, 256, 0, ! GL_COLOR_INDEX, ! GL_UNSIGNED_BYTE, image8 ); } ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); ! glTexParameterf(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR); if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) ! glDisable (GL_ALPHA_TEST); ! glBegin (GL_QUADS); ! glTexCoord2f (0, 0); ! glVertex2f (x, y); ! glTexCoord2f (1, 0); ! glVertex2f (x+w, y); ! glTexCoord2f (1, t); ! glVertex2f (x+w, y+h); ! glTexCoord2f (0, t); ! glVertex2f (x, y+h); ! glEnd (); if ( ( gl_config.renderer == GL_RENDERER_MCD ) || ( (gl_config.renderer & GL_RENDERER_RENDITION) != 0 ) ) ! glEnable (GL_ALPHA_TEST); } Index: Model.java =================================================================== RCS file: /cvsroot/jake2/jake2/src/jake2/render/lwjgl/Model.java,v retrieving revision 1.10 retrieving revision 1.10.6.1 diff -C2 -d -r1.10 -r1.10.6.1 *** Model.java 15 May 2005 15:59:57 -0000 1.10 --- Model.java 10 Jul 2005 17:55:50 -0000 1.10.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 org.lwjgl.BufferUtils; - /** * Model --- 38,41 ---- *************** *** 1292,1297 **** */ static final int MODEL_BUFFER_SIZE = 50000; ! static FloatBuffer globalModelTextureCoordBuf = BufferUtils.createFloatBuffer(MODEL_BUFFER_SIZE * 2); ! static IntBuffer globalModelVertexIndexBuf = BufferUtils.createIntBuffer(MODEL_BUFFER_SIZE); void precompileGLCmds(qfiles.dmdl_t model) { --- 1289,1294 ---- */ 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/lwjgl/Main.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** Main.java 7 May 2005 18:23:25 -0000 1.7 --- Main.java 10 Jul 2005 17:55:50 -0000 1.7.6.1 *************** *** 28,49 **** import jake2.Defines; import jake2.Globals; ! import jake2.client.VID; ! import jake2.client.entity_t; ! import jake2.client.particle_t; ! import jake2.client.refdef_t; ! import jake2.game.Cmd; ! import jake2.game.cplane_t; ! import jake2.game.cvar_t; ! import jake2.qcommon.Com; ! import jake2.qcommon.Cvar; ! import jake2.qcommon.qfiles; ! import jake2.qcommon.xcommand_t; ! import jake2.render.glconfig_t; ! import jake2.render.glstate_t; ! import jake2.render.image_t; ! import jake2.render.mleaf_t; ! import jake2.render.model_t; ! import jake2.util.Math3D; ! import jake2.util.Vargs; import java.awt.Dimension; --- 28,36 ---- import jake2.Defines; import jake2.Globals; ! import jake2.client.*; ! import jake2.game.*; ! import jake2.qcommon.*; ! import jake2.render.*; ! import jake2.util.*; import java.awt.Dimension; *************** *** 51,59 **** import java.nio.IntBuffer; - import org.lwjgl.BufferUtils; - import org.lwjgl.opengl.ARBMultitexture; - import org.lwjgl.opengl.GL11; - import org.lwjgl.opengl.GL13; - /** * Main --- 38,41 ---- *************** *** 124,129 **** */ ! int GL_TEXTURE0 = GL13.GL_TEXTURE0; ! int GL_TEXTURE1 = GL13.GL_TEXTURE1; model_t r_worldmodel; --- 106,111 ---- */ ! int TEXTURE0 = GL_TEXTURE0; ! int TEXTURE1 = GL_TEXTURE1; model_t r_worldmodel; *************** *** 158,162 **** //float r_world_matrix[] = new float[16]; ! FloatBuffer r_world_matrix=BufferUtils.createFloatBuffer(16); float r_base_world_matrix[] = new float[16]; --- 140,144 ---- //float r_world_matrix[] = new float[16]; ! FloatBuffer r_world_matrix = Lib.newFloatBuffer(16); float r_base_world_matrix[] = new float[16]; *************** *** 259,267 **** */ final void R_RotateForEntity(entity_t e) { ! gl.glTranslatef(e.origin[0], e.origin[1], e.origin[2]); ! gl.glRotatef(e.angles[1], 0, 0, 1); ! gl.glRotatef(-e.angles[0], 0, 1, 0); ! gl.glRotatef(-e.angles[2], 1, 0, 0); } --- 241,249 ---- */ final void R_RotateForEntity(entity_t e) { ! glTranslatef(e.origin[0], e.origin[1], e.origin[2]); ! glRotatef(e.angles[1], 0, 0, 1); ! glRotatef(-e.angles[0], 0, 1, 0); ! glRotatef(-e.angles[2], 1, 0, 0); } *************** *** 298,345 **** if (alpha != 1.0F) ! gl.glEnable(GL11.GL_BLEND); ! gl.glColor4f(1, 1, 1, alpha); GL_Bind(currentmodel.skins[e.frame].texnum); ! GL_TexEnv(GL11.GL_MODULATE); if (alpha == 1.0) ! gl.glEnable(GL11.GL_ALPHA_TEST); else ! gl.glDisable(GL11.GL_ALPHA_TEST); ! gl.glBegin(GL11.GL_QUADS); ! gl.glTexCoord2f(0, 1); Math3D.VectorMA(e.origin, -frame.origin_y, vup, point); Math3D.VectorMA(point, -frame.origin_x, vright, point); ! gl.glVertex3f(point[0], point[1], point[2]); ! gl.glTexCoord2f(0, 0); Math3D.VectorMA(e.origin, frame.height - frame.origin_y, vup, point); Math3D.VectorMA(point, -frame.origin_x, vright, point); ! gl.glVertex3f(point[0], point[1], point[2]); ! gl.glTexCoord2f(1, 0); Math3D.VectorMA(e.origin, frame.height - frame.origin_y, vup, point); Math3D.VectorMA(point, frame.width - frame.origin_x, vright, point); ! gl.glVertex3f(point[0], point[1], point[2]); ! gl.glTexCoord2f(1, 1); Math3D.VectorMA(e.origin, -frame.origin_y, vup, point); Math3D.VectorMA(point, frame.width - frame.origin_x, vright, point); ! gl.glVertex3f(point[0], point[1], point[2]); ! gl.glEnd(); ! gl.glDisable(GL11.GL_ALPHA_TEST); ! GL_TexEnv(GL11.GL_REPLACE); if (alpha != 1.0F) ! gl.glDisable(GL11.GL_BLEND); ! gl.glColor4f(1, 1, 1, 1); } --- 280,327 ---- if (alpha != 1.0F) ! glEnable(GL_BLEND); ! glColor4f(1, 1, 1, alpha); GL_Bind(currentmodel.skins[e.frame].texnum); ! GL_TexEnv(GL_MODULATE); if (alpha == 1.0) ! glEnable(GL_ALPHA_TEST); else ! glDisable(GL_ALPHA_TEST); ! glBegin(GL_QUADS); ! glTexCoord2f(0, 1); Math3D.VectorMA(e.origin, -frame.origin_y, vup, point); Math3D.VectorMA(point, -frame.origin_x, vright, point); ! glVertex3f(point[0], point[1], point[2]); ! glTexCoord2f(0, 0); Math3D.VectorMA(e.origin, frame.height - frame.origin_y, vup, point); Math3D.VectorMA(point, -frame.origin_x, vright, poi... [truncated message content] |