You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
|
1
(1) |
2
(4) |
3
|
4
|
5
|
|
6
|
7
(2) |
8
(3) |
9
(5) |
10
|
11
(4) |
12
|
|
13
(2) |
14
(2) |
15
(2) |
16
(9) |
17
|
18
|
19
|
|
20
|
21
(7) |
22
(4) |
23
(4) |
24
|
25
(10) |
26
|
|
27
(4) |
28
(16) |
29
(14) |
30
(11) |
31
(1) |
|
|
|
From: Brian M. <ma...@us...> - 2005-03-25 01:41:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22506/src/java/org/lwjgl/devil Modified Files: ILUT.java Log Message: added ilutGet<type>v Index: ILUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILUT.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ILUT.java 25 Mar 2005 01:15:26 -0000 1.4 +++ ILUT.java 25 Mar 2005 01:41:17 -0000 1.5 @@ -33,6 +33,8 @@ import java.io.File; import java.lang.reflect.Method; +import java.nio.ByteBuffer; +import java.nio.IntBuffer; import java.util.ArrayList; import java.util.List; import java.util.StringTokenizer; @@ -94,15 +96,16 @@ public static native boolean ilutEnable(int mode); public static native boolean ilutGetBoolean(int mode); public static native int ilutGetInteger(int mode); - public static native String ilutGetString(int stringName); + public static native void ilutGetBooleanv(int mode, ByteBuffer param); + public static native void ilutGetIntegerv(int mode, IntBuffer Param); + public static native String ilutGetString(int stringName); private static native void ilutInit(); public static native boolean ilutIsDisabled(int mode); public static native boolean ilutIsEnabled(int mode); public static native void ilutPopAttrib(); public static native void ilutPushAttrib(int bits); public static native void ilutSetInteger(int Mode, int param); - // public static native void ilutGetBooleanv(int mode, ILboolean *Param); - // public static native void ilutGetIntegerv(int mode, ILint *Param); + // ImageLib Utility Toolkit's OpenGL Functions public static native int ilutGLBindTexImage(); |
|
From: Brian M. <ma...@us...> - 2005-03-25 01:40:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22093/src/java/org/lwjgl/test/devil Modified Files: BasicTest.java Log Message: cleanup Index: BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil/BasicTest.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- BasicTest.java 25 Mar 2005 01:08:18 -0000 1.7 +++ BasicTest.java 25 Mar 2005 01:40:42 -0000 1.8 @@ -31,13 +31,16 @@ */ package org.lwjgl.test.devil; -import org.lwjgl.devil.*; - import java.net.URL; import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; +import org.lwjgl.devil.IL; +import org.lwjgl.devil.ILU; +import org.lwjgl.devil.ILUT; +import org.lwjgl.devil.ILinfo; + /** * $Id$ * <p>The core DevIL and ILU API.</p> @@ -105,7 +108,7 @@ System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); System.out.println("ILUT Vendor: " + ILUT.ilutGetString(ILUT.ILUT_VENDOR)); - + try { ILUT.destroy(); ILU.destroy(); |
|
From: Brian M. <ma...@us...> - 2005-03-25 01:15:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8614/src/java/org/lwjgl/devil Modified Files: IL.java ILUT.java ILU.java Log Message: small cleanup Index: ILUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILUT.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ILUT.java 25 Mar 2005 01:08:17 -0000 1.3 +++ ILUT.java 25 Mar 2005 01:15:26 -0000 1.4 @@ -42,8 +42,9 @@ /** * $Id$ - * + * <p> * The DevIL ILUT API. + * </p> * * @author captainjester <cap...@us...> * @author Brian Matzon <br...@ma...> @@ -83,6 +84,7 @@ public static final int ILUT_OPENGL = 0; public static final int ILUT_VENDOR = IL.IL_VENDOR; + public static final int ILUT_VERSION_NUM = IL.IL_VERSION_NUM; /** Have we been created? */ protected static boolean created; Index: IL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/IL.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- IL.java 25 Mar 2005 01:08:17 -0000 1.8 +++ IL.java 25 Mar 2005 01:15:26 -0000 1.9 @@ -50,10 +50,12 @@ /** * $Id$ - * + * <p> * The core DevIL API. + * </p> * * @author captainjester <cap...@us...> + * @author Brian Matzon <br...@ma...> * @version $Revision$ */ public class IL { @@ -81,8 +83,6 @@ public static final int IL_VENDOR = 0x1F00; // IL-specific public const's - public static final int IL_VERSION_1_6_0 = 1; - public static final int IL_VERSION = 160; public static final int IL_LOAD_EXT = 0x1F01; public static final int IL_SAVE_EXT = 0x1F02; @@ -301,8 +301,7 @@ public static final int IL_EOF = -1; /** Have we been created? */ - protected static boolean created; - + protected static boolean created; public static native boolean ilActiveImage(int Number); public static native boolean ilActiveLayer(int Number); Index: ILU.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILU.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ILU.java 25 Mar 2005 01:08:17 -0000 1.4 +++ ILU.java 25 Mar 2005 01:15:26 -0000 1.5 @@ -44,8 +44,9 @@ /** * $Id$ - * + * <p> * The DevIL ILU API. + * </p> * * @author captainjester <cap...@us...> * @author Brian Matzon <br...@ma...> |
|
From: Brian M. <ma...@us...> - 2005-03-25 01:08:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5020/org/lwjgl/devil Modified Files: IL.java ILU.java ILUT.java Log Message: dynamic loading of devil Index: ILUT.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILUT.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- ILUT.java 15 Mar 2005 03:53:42 -0000 1.2 +++ ILUT.java 25 Mar 2005 01:08:17 -0000 1.3 @@ -31,7 +31,14 @@ */ package org.lwjgl.devil; +import java.io.File; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; /** * $Id$ @@ -39,22 +46,17 @@ * The DevIL ILUT API. * * @author captainjester <cap...@us...> + * @author Brian Matzon <br...@ma...> * @version $Revision$ */ public class ILUT { - /** Have we been created? */ - protected static boolean created; - - public static final int ILUT_VERSION_1_6_7 = 1; - public static final int ILUT_VERSION = 167; - -// Attribute Bits + // Attribute Bits public static final int ILUT_OPENGL_BIT = 0x00000001; public static final int ILUT_ALL_ATTRIB_BITS = 0x000FFFFF; -// Error Types + // Error Types public static final int ILUT_INVALID_ENUM = 0x0501; public static final int ILUT_OUT_OF_MEMORY = 0x0502; public static final int ILUT_INVALID_VALUE = 0x0505; @@ -67,7 +69,7 @@ public static final int ILUT_NOT_SUPPORTED = 0x0550; -// State Definitions + // State Definitions public static final int ILUT_PALETTE_MODE = 0x0600; public static final int ILUT_OPENGL_CONV = 0x0610; public static final int ILUT_MAXTEX_WIDTH = 0x0630; @@ -75,46 +77,32 @@ public static final int ILUT_MAXTEX_DEPTH = 0x0632; public static final int ILUT_GL_USE_S3TC = 0x0634; public static final int ILUT_GL_GEN_S3TC = 0x0635; - -// This new state does automatic texture target detection -// if enabled. Currently, only cubemap detection is supported. -// if the current image is no cubemap, the 2d texture is chosen. public static final int ILUT_GL_AUTODETECT_TEXTURE_TARGET = 0x0807; -// The different rendering api's...more to be added later? + // The different rendering api's...more to be added later? public static final int ILUT_OPENGL = 0; - - static { -// System.loadLibrary("ILU"); - System.loadLibrary("lwjgl-devil"); - } + + public static final int ILUT_VENDOR = IL.IL_VENDOR; + + /** Have we been created? */ + protected static boolean created; - /** - * @return true if DevIL has been created - */ - public static boolean isCreated() { - return created; - } - public static native void initNativeStubs() throws LWJGLException; - - public static native boolean ilutRenderer(int renderer); - -// ImageLib Utility Toolkit Functions + public static native boolean ilutRenderer(int renderer); public static native boolean ilutDisable(int mode); public static native boolean ilutEnable(int mode); public static native boolean ilutGetBoolean(int mode); -// public static native void ilutGetBooleanv(int mode, ILboolean *Param); public static native int ilutGetInteger(int mode); -// public static native void ilutGetIntegerv(int mode, ILint *Param); public static native String ilutGetString(int stringName); - public static native void ilutInit(); + private static native void ilutInit(); public static native boolean ilutIsDisabled(int mode); public static native boolean ilutIsEnabled(int mode); public static native void ilutPopAttrib(); public static native void ilutPushAttrib(int bits); public static native void ilutSetInteger(int Mode, int param); + // public static native void ilutGetBooleanv(int mode, ILboolean *Param); + // public static native void ilutGetIntegerv(int mode, ILint *Param); -// ImageLib Utility Toolkit's OpenGL Functions + // ImageLib Utility Toolkit's OpenGL Functions public static native int ilutGLBindTexImage(); public static native int ilutGLBindMipmaps(); public static native boolean ilutGLBuildMipmaps(); @@ -124,17 +112,142 @@ public static native boolean ilutGLSaveImage(String fileName, int texID); public static native boolean ilutGLSetTex(int texID); public static native boolean ilutGLTexImage(int level); - + + /** + * @return true if ILUT has been created + */ + public static boolean isCreated() { + return created; + } + + /** + * Creates a new instance of ILUT. Cannot be created unless IL has been created. + */ public static void create() throws LWJGLException { - if (!created) { - nCreate(); - ILUT.initNativeStubs(); - ILUT.ilutInit(); - ilutRenderer(ILUT_OPENGL); - created = true; - } - + if(!IL.isCreated()) { + throw new LWJGLException("Cannot create ILUT without having created IL instance"); + } + + String[] ilutPaths = getILUTPaths(); + nCreate(ilutPaths); + created = true; + + try { + ILUT.initNativeStubs(); + ILUT.ilutInit(); + created = true; + } catch (LWJGLException e) { + destroy(); + throw e; + } } - public static native void nCreate(); + private static native void initNativeStubs() throws LWJGLException; + + private static native void resetNativeStubs(Class clazz); + + /** + * Exit cleanly by calling destroy. + */ + public static void destroy() { + resetNativeStubs(ILUT.class); + if (created) { + nDestroy(); + } + created = false; + } + + /** + * Native method to create ILUT instance + * + * @param iluPaths Array of strings containing paths to search for ILUT library + */ + protected static native void nCreate(String[] ilutPaths) throws LWJGLException; + + /** + * Native method the destroy the ILUT + */ + protected static native void nDestroy(); + + private static String[] getILUTPaths() throws LWJGLException { + // need to pass path of possible locations of IL to native side + List possible_paths = new ArrayList(); + + String osName = System.getProperty("os.name"); + + String libname; + String platform_lib_name; + if (osName.startsWith("Win")) { + libname = "ILUT"; + platform_lib_name = "ILUT.dll"; + } else if (osName.startsWith("Lin")) { + libname = "ILUT"; + platform_lib_name = "ILUT.so"; + } else if (osName.startsWith("Mac")) { + libname = "ILUT"; + platform_lib_name = "ILUT.dylib"; + } else { + throw new LWJGLException("Unknown platform: " + osName); + } + + // Add all possible paths from java.library.path + String java_library_path = System.getProperty("java.library.path"); + StringTokenizer st = new StringTokenizer(System.getProperty("java.library.path"), File.pathSeparator); + while (st.hasMoreTokens()) { + String path = st.nextToken(); + possible_paths.add(path + File.separator + platform_lib_name); + } + + String classloader_path = getPathFromClassLoader(libname); + if (classloader_path != null) { + Sys.log("getPathFromClassLoader: Path found: " + classloader_path); + possible_paths.add(classloader_path); + } + String lwjgl_classloader_path = getPathFromClassLoader("lwjgl"); + if (lwjgl_classloader_path != null) { + Sys.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path); + possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator)) + + File.separator + platform_lib_name); + } + + //add cwd path + possible_paths.add(platform_lib_name); + + //create needed string array + String[] ilutPaths = new String[possible_paths.size()]; + possible_paths.toArray(ilutPaths); + + return ilutPaths; + } + + /** + * Tries to locate ILUT from the current ClassLoader + * This method exists because ILUT is loaded from native code, and as such + * is exempt from ClassLoader library loading rutines. ILUT therefore always fails. + * We therefore invoke the protected method of the ClassLoader to see if it can + * locate it. + * + * @param libname Name of library to search for + * @return Absolute path to library if found, otherwise null + */ + private static String getPathFromClassLoader(String libname) { + try { + Sys.log("getPathFromClassLoader: searching for: " + libname); + Object o = IL.class.getClassLoader(); + Class c = o.getClass(); + while (c != null) { + try { + Method findLibrary = c.getDeclaredMethod("findLibrary", new Class[] { String.class}); + findLibrary.setAccessible(true); + Object[] arguments = new Object[] { libname}; + return (String) findLibrary.invoke(o, arguments); + } catch (NoSuchMethodException e) { + c = c.getSuperclass(); + } + } + } catch (Exception e) { + Sys.log("Failure locating ILUT using classloader:" + e); + } + return null; + } } Index: IL.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/IL.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- IL.java 15 Mar 2005 03:53:42 -0000 1.7 +++ IL.java 25 Mar 2005 01:08:17 -0000 1.8 @@ -32,14 +32,22 @@ package org.lwjgl.devil; import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.File; import java.io.IOException; import java.io.InputStream; +import java.lang.reflect.Method; import java.net.URL; import java.nio.ByteBuffer; import java.nio.IntBuffer; [...1169 lines suppressed...] + try { + Sys.log("getPathFromClassLoader: searching for: " + libname); + Object o = IL.class.getClassLoader(); + Class c = o.getClass(); + while (c != null) { + try { + Method findLibrary = c.getDeclaredMethod("findLibrary", new Class[] { String.class}); + findLibrary.setAccessible(true); + Object[] arguments = new Object[] { libname}; + return (String) findLibrary.invoke(o, arguments); + } catch (NoSuchMethodException e) { + c = c.getSuperclass(); + } + } + } catch (Exception e) { + Sys.log("Failure locating DevIL using classloader:" + e); + } + return null; + } } Index: ILU.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/devil/ILU.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ILU.java 15 Mar 2005 03:53:42 -0000 1.3 +++ ILU.java 25 Mar 2005 01:08:17 -0000 1.4 @@ -31,10 +31,16 @@ */ package org.lwjgl.devil; +import java.io.File; +import java.lang.reflect.Method; import java.nio.IntBuffer; +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; import org.lwjgl.BufferChecks; import org.lwjgl.LWJGLException; +import org.lwjgl.Sys; /** * $Id$ @@ -42,15 +48,11 @@ * The DevIL ILU API. * * @author captainjester <cap...@us...> + * @author Brian Matzon <br...@ma...> * @version $Revision$ */ public class ILU { - /** Have we been created? */ - protected static boolean created; - - public static final int ILU_VERSION_1_6_7 = 1; - public static final int ILU_VERSION = 167; - + public static final int ILU_FILTER = 0x2600; public static final int ILU_NEAREST = 0x2601; public static final int ILU_LINEAR = 0x2602; @@ -62,7 +64,7 @@ public static final int ILU_SCALE_LANCZOS3 = 0x2608; public static final int ILU_SCALE_MITCHELL = 0x2609; -// Error types + // Error types public static final int ILU_INVALID_ENUM = 0x0501; public static final int ILU_OUT_OF_MEMORY = 0x0502; public static final int ILU_INTERNAL_ERROR = 0x0504; @@ -70,7 +72,7 @@ public static final int ILU_ILLEGAL_OPERATION = 0x0506; public static final int ILU_INVALID_PARAM = 0x0509; -// Values + // Values public static final int ILU_PLACEMENT = 0x0700; public static final int ILU_LOWER_LEFT = 0x0701; public static final int ILU_LOWER_RIGHT = 0x0702; @@ -78,23 +80,19 @@ public static final int ILU_UPPER_RIGHT = 0x0704; public static final int ILU_CENTER = 0x0705; public static final int ILU_CONVOLUTION_MATRIX = 0x0710; -// public static final int ILU_VERSION_NUM = IL_VERSION_NUM; -// public static final int ILU_VENDOR = IL_VENDOR; + public static final int ILU_VERSION_NUM = IL.IL_VERSION_NUM; + public static final int ILU_VENDOR = IL.IL_VENDOR; + + /** Have we been created? */ + protected static boolean created; - static { -// System.loadLibrary("ILU"); - System.loadLibrary("lwjgl-devil"); - } - /** - * @return true if DevIL has been created + * @return true if ILU has been created */ public static boolean isCreated() { return created; } - public static native void initNativeStubs() throws LWJGLException; - public static native boolean iluAlienify(); public static native boolean iluBlurAvg(int iter); public static native boolean iluBlurGaussian(int iter); @@ -121,25 +119,18 @@ BufferChecks.checkDirect(param); niluGetIntegerv(mode, param, param.position()); } - public static native void niluGetIntegerv(int mode, IntBuffer param, int param_offset); + private static native void niluGetIntegerv(int mode, IntBuffer param, int param_offset); public static native String iluGetString(int stringName); public static native void iluImageParameter(int pName, int param); - public static native void iluInit(); + private static native void iluInit(); public static native boolean iluInvertAlpha(); public static native int iluLoadImage(String fileName); public static native boolean iluMirror(); public static native boolean iluNegative(); public static native boolean iluNoisify(float tolerance); public static native boolean iluPixelize(int pixSize); - // TODO result placed in a pointer -// public static native void iluRegionfv(ILpointf points[], int n); - // TODO result placed in a pointer -// public static native void iluRegioniv(ILpointi points[], int n); public static native boolean iluReplaceColour(byte red, byte green, byte blue, float tolerance); public static native boolean iluRotate(float angle); - - // TODO Not implemented in the native lib -// public static native boolean iluRotate3D(float x, float y, float z, float Angle); public static native boolean iluSaturate1f(float saturation); public static native boolean iluSaturate4f(float r, float g, float b, float saturation); public static native boolean iluScale(int width, int height, int depth); @@ -147,23 +138,13 @@ public static native boolean iluSharpen(float factor, int iter); public static native boolean iluSwapColours(); public static native boolean iluWave(float angle); - /** - * - */ - public static void create() throws LWJGLException { - if (!created) { - nCreate(); - ILU.initNativeStubs(); - ILU.iluInit(); - created = true; - } - - } - public static native void nCreate(); + // public static native void iluRegionfv(ILpointf points[], int n); + // public static native void iluRegioniv(ILpointi points[], int n); + // public static native boolean iluRotate3D(float x, float y, float z, float Angle); - //DevIL lib allows both spellings of colour. - //Will do the same this way. + /* DevIL lib allows both spellings of colour. We support that too */ + // ======================================================================== public static void iluColorsUsed() { iluColoursUsed(); } @@ -176,4 +157,136 @@ public static void iluScaleColors(float r, float g, float b) { iluScaleColours(r, g, b); } + // ------------------------------------------------------------------------ + + /** + * Creates a new instance of ILU. Cannot be created unless IL has been created. + */ + public static void create() throws LWJGLException { + if(!IL.isCreated()) { + throw new LWJGLException("Cannot create ILU without having created IL instance"); + } + + String[] iluPaths = getILUPaths(); + nCreate(iluPaths); + created = true; + + try { + ILU.initNativeStubs(); + ILU.iluInit(); + created = true; + } catch (LWJGLException e) { + destroy(); + throw e; + } + } + + private static native void initNativeStubs() throws LWJGLException; + + private static native void resetNativeStubs(Class clazz); + + /** + * Exit cleanly by calling destroy. + */ + public static void destroy() { + resetNativeStubs(ILU.class); + if (created) { + nDestroy(); + } + created = false; + } + + /** + * Native method to create ILU instance + * + * @param iluPaths Array of strings containing paths to search for ILU library + */ + protected static native void nCreate(String[] iluPaths) throws LWJGLException; + + /** + * Native method the destroy the ILU + */ + protected static native void nDestroy(); + + private static String[] getILUPaths() throws LWJGLException { + // need to pass path of possible locations of ILU to native side + List possible_paths = new ArrayList(); + + String osName = System.getProperty("os.name"); + + String libname; + String platform_lib_name; + if (osName.startsWith("Win")) { + libname = "ILU"; + platform_lib_name = "ILU.dll"; + } else if (osName.startsWith("Lin")) { + libname = "ILU"; + platform_lib_name = "ILU.so"; + } else if (osName.startsWith("Mac")) { + libname = "ILU"; + platform_lib_name = "ILU.dylib"; + } else { + throw new LWJGLException("Unknown platform: " + osName); + } + + // Add all possible paths from java.library.path + String java_library_path = System.getProperty("java.library.path"); + StringTokenizer st = new StringTokenizer(System.getProperty("java.library.path"), File.pathSeparator); + while (st.hasMoreTokens()) { + String path = st.nextToken(); + possible_paths.add(path + File.separator + platform_lib_name); + } + + String classloader_path = getPathFromClassLoader(libname); + if (classloader_path != null) { + Sys.log("getPathFromClassLoader: Path found: " + classloader_path); + possible_paths.add(classloader_path); + } + String lwjgl_classloader_path = getPathFromClassLoader("lwjgl"); + if (lwjgl_classloader_path != null) { + Sys.log("getPathFromClassLoader: Path found: " + lwjgl_classloader_path); + possible_paths.add(lwjgl_classloader_path.substring(0, lwjgl_classloader_path.lastIndexOf(File.separator)) + + File.separator + platform_lib_name); + } + + //add cwd path + possible_paths.add(platform_lib_name); + + //create needed string array + String[] iluPaths = new String[possible_paths.size()]; + possible_paths.toArray(iluPaths); + + return iluPaths; + } + + /** + * Tries to locate ILU from the current ClassLoader + * This method exists because ILU is loaded from native code, and as such + * is exempt from ClassLoader library loading rutines. ILU therefore always fails. + * We therefore invoke the protected method of the ClassLoader to see if it can + * locate it. + * + * @param libname Name of library to search for + * @return Absolute path to library if found, otherwise null + */ + private static String getPathFromClassLoader(String libname) { + try { + Sys.log("getPathFromClassLoader: searching for: " + libname); + Object o = IL.class.getClassLoader(); + Class c = o.getClass(); + while (c != null) { + try { + Method findLibrary = c.getDeclaredMethod("findLibrary", new Class[] { String.class}); + findLibrary.setAccessible(true); + Object[] arguments = new Object[] { libname}; + return (String) findLibrary.invoke(o, arguments); + } catch (NoSuchMethodException e) { + c = c.getSuperclass(); + } + } + } catch (Exception e) { + Sys.log("Failure locating ILU using classloader:" + e); + } + return null; + } } |
|
From: Brian M. <ma...@us...> - 2005-03-25 01:08:27
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5020/org/lwjgl/test/devil Modified Files: BasicTest.java Log Message: dynamic loading of devil Index: BasicTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/devil/BasicTest.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- BasicTest.java 9 Jan 2005 23:59:33 -0000 1.6 +++ BasicTest.java 25 Mar 2005 01:08:18 -0000 1.7 @@ -37,6 +37,7 @@ import java.nio.ByteBuffer; import java.nio.ByteOrder; import java.nio.IntBuffer; + /** * $Id$ * <p>The core DevIL and ILU API.</p> @@ -45,67 +46,73 @@ * @version $Revision$ */ public class BasicTest { - public static void main(String args[]) { - try { - IL.create(); - ILU.create(); - } - catch(Exception e) { - e.printStackTrace(); - System.exit(0); - } - System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); - System.out.println("ilGenImages"); - IntBuffer im = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); - IL.ilGenImages(1, im); - System.out.println("ilBindImage"); - IL.ilBindImage(im.get(0)); - IL.ilEnable(IL.IL_ORIGIN_SET); - IL.ilOriginFunc(IL.IL_ORIGIN_UPPER_LEFT); - System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); - String imageFile = "F:/Apps/Java/eclipse/workspace/LWJGL/res/ILtest.tga"; - URL imageURL = BasicTest.class.getResource("/res/ILtest.tga"); - System.out.println("ilLoadFromURL " + imageURL); - System.out.println("load lump = " + IL.ilLoadFromURL(imageURL)); - System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); - int newIm = IL.ilCloneCurImage(); - IL.ilCopyImage(im.get(0)); - IL.ilBindImage(newIm); - ByteBuffer buf = IL.ilGetData(); - System.out.println("ilGetData"); - System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); - int limit = buf.limit(); - System.out.println("limit = " + limit); - for(int i=0;i<buf.limit();i+=3) { - System.out.println(buf.get(i) + " " + buf.get(i + 1) + " " + buf.get(i + 2)); - } - - System.out.println("current image = " + im.get(0) + " IL.ilGetInteger(IL.IL_ACTIVE_IMAGE) = " + IL.ilGetInteger(IL.IL_ACTIVE_IMAGE)); - System.out.println("Version: " + IL.ilGetInteger(IL.IL_VERSION_NUM)); - System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); - - ILinfo info = new ILinfo(); - ILU.iluGetImageInfo(info); - System.out.println("info.id = " + info.id); - System.out.println("info.width = " + info.width); - System.out.println("info.height = " + info.height); - System.out.println("info.depth = " + info.depth); - System.out.println("info.bpp = " + info.bpp); - System.out.println("info.sizeOfData = " + info.sizeOfData); - System.out.println("info.format = " + info.format); - System.out.println("info.type = " + info.type); - System.out.println("info.origin = " + info.origin); - System.out.println("info.palType = " + info.palType); - System.out.println("info.palSize = " + info.palSize); - System.out.println("info.numNext = " + info.numNext); - System.out.println("info.numMips = " + info.numMips); - System.out.println("info.numLayers = " + info.numLayers); - System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); - -// ILpointf pointf[] = new ILpointf[3]; -// ILU.iluRegionfv(pointf, pointf.length); -// for(int i=0;i<pointf.length;i++) { -// System.out.println("point[" + i + "] x = " + pointf[i].x + " y = " + pointf[i].y); -// } - } + + public static void main(String args[]) { + try { + IL.create(); + ILU.create(); + ILUT.create(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(0); + } + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + System.out.println("ilGenImages"); + IntBuffer im = ByteBuffer.allocateDirect(4).order(ByteOrder.nativeOrder()).asIntBuffer(); + IL.ilGenImages(1, im); + System.out.println("ilBindImage"); + IL.ilBindImage(im.get(0)); + IL.ilEnable(IL.IL_ORIGIN_SET); + IL.ilOriginFunc(IL.IL_ORIGIN_UPPER_LEFT); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + URL imageURL = BasicTest.class.getResource("/res/ILtest.tga"); + System.out.println("ilLoadFromURL " + imageURL); + System.out.println("load lump = " + IL.ilLoadFromURL(imageURL)); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + int newIm = IL.ilCloneCurImage(); + IL.ilCopyImage(im.get(0)); + IL.ilBindImage(newIm); + ByteBuffer buf = IL.ilGetData(); + System.out.println("ilGetData"); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + int limit = buf.limit(); + System.out.println("limit = " + limit); + for (int i = 0; i < buf.limit(); i += 3) { + System.out.println(buf.get(i) + " " + buf.get(i + 1) + " " + buf.get(i + 2)); + } + + System.out.println("current image = " + im.get(0) + " IL.ilGetInteger(IL.IL_ACTIVE_IMAGE) = " + + IL.ilGetInteger(IL.IL_ACTIVE_IMAGE)); + System.out.println("Version: " + IL.ilGetInteger(IL.IL_VERSION_NUM)); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + + ILinfo info = new ILinfo(); + ILU.iluGetImageInfo(info); + System.out.println("info.id = " + info.id); + System.out.println("info.width = " + info.width); + System.out.println("info.height = " + info.height); + System.out.println("info.depth = " + info.depth); + System.out.println("info.bpp = " + info.bpp); + System.out.println("info.sizeOfData = " + info.sizeOfData); + System.out.println("info.format = " + info.format); + System.out.println("info.type = " + info.type); + System.out.println("info.origin = " + info.origin); + System.out.println("info.palType = " + info.palType); + System.out.println("info.palSize = " + info.palSize); + System.out.println("info.numNext = " + info.numNext); + System.out.println("info.numMips = " + info.numMips); + System.out.println("info.numLayers = " + info.numLayers); + System.out.println("error = " + ILU.iluErrorString(IL.ilGetError())); + + System.out.println("ILUT Vendor: " + ILUT.ilutGetString(ILUT.ILUT_VENDOR)); + + try { + ILUT.destroy(); + ILU.destroy(); + IL.destroy(); + } catch (Exception e) { + e.printStackTrace(); + System.exit(0); + } + } } |
|
From: Brian M. <ma...@us...> - 2005-03-25 01:07:37
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/devil In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4540 Modified Files: extil.c extil.h org_lwjgl_devil_IL.c org_lwjgl_devil_ILU.c org_lwjgl_devil_ILUT.c Added Files: devil-common.h extilu.c extilu.h extilut.c extilut.h Log Message: dynamic loading of devil --- NEW FILE: devil-common.h --- #ifndef __DEVIL_COMMON_H__ #define __DEVIL_COMMON_H__ #include <jni.h> #include <stdio.h> #include <string.h> #include "org_lwjgl_devil_IL.h" #include "org_lwjgl_devil_ILU.h" #include "org_lwjgl_devil_ILUT.h" #include "common_tools.h" /*-----------------------------------------*/ typedef unsigned int GLuint; #ifdef _UNICODE #ifndef _WIN32_WCE #include <wchar.h> #endif typedef wchar_t* ILstring; #else typedef char* ILstring; #endif//_UNICODE #if (_MSC_VER >= 800) || defined(_STDCALL_SUPPORTED) || defined(__BORLANDC__) || defined(__LCC__) #define ILAPIENTRY __stdcall #define IL_PACKSTRUCT //#elif defined(linux) || defined(MACOSX) || defined(__CYGWIN__) //fix bug 840364 #elif defined( __GNUC__ ) // this should work for any of the above commented platforms // plus any platform using GCC #define ILAPIENTRY #define IL_PACKSTRUCT __attribute__ ((packed)) #else #define ILAPIENTRY #define IL_PACKSTRUCT #endif // This is from Win32's <wingdi.h> and <winnt.h> #if defined(__LCC__) #define ILAPI __stdcall #elif defined(_WIN32) //changed 20031221 to fix bug 840421 #ifdef IL_STATIC_LIB #define ILAPI #else #ifdef _IL_BUILD_LIBRARY #define ILAPI __declspec(dllexport) #else #define ILAPI __declspec(dllimport) #endif #endif #elif __APPLE__ #define ILAPI extern #else #define ILAPI #endif typedef void* ILHANDLE; typedef unsigned int ILenum; typedef unsigned char ILboolean; typedef unsigned int ILbitfield; typedef char ILbyte; typedef short ILshort; typedef int ILint; typedef int ILsizei; typedef unsigned char ILubyte; typedef unsigned short ILushort; typedef unsigned int ILuint; typedef float ILfloat; typedef float ILclampf; typedef double ILdouble; typedef double ILclampd; typedef void ILvoid; typedef struct ILinfo { ILuint Id; // the image's id ILubyte *Data; // the image's data ILuint Width; // the image's width ILuint Height; // the image's height ILuint Depth; // the image's depth ILubyte Bpp; // bytes per pixel (not bits) of the image ILuint SizeOfData; // the total size of the data (in bytes) ILenum Format; // image format (in IL enum style) ILenum Type; // image type (in IL enum style) ILenum Origin; // origin of the image ILubyte *Palette; // the image's palette ILenum PalType; // palette type ILuint PalSize; // palette size ILenum CubeFlags; // flags for what cube map sides are present ILuint NumNext; // number of images following ILuint NumMips; // number of mipmaps ILuint NumLayers; // number of layers } ILinfo; typedef struct ILpointf { ILfloat x, y; } ILpointf; typedef struct ILpointi { ILint x, y; } ILpointi; #define IL_IMAGE_WIDTH 0x0DE4 #define IL_IMAGE_HEIGHT 0x0DE5 #define IL_IMAGE_BYTES_PER_PIXEL 0x0DE8 // Registered format procedures typedef ILenum (ILAPIENTRY *IL_LOADPROC)(const ILstring); typedef ILenum (ILAPIENTRY *IL_SAVEPROC)(const ILstring); /*-----------------------------------------*/ #if defined(_WIN32) && !defined(APIENTRY) #define WIN32_LEAN_AND_MEAN 1 #include <windows.h> #endif #ifndef APIENTRY #define APIENTRY #endif #endif /* __EXTIL_H__ */ --- NEW FILE: extilut.c --- #include "extilut.h" /* Handle to ilut Library */ #ifdef _WIN32 static HMODULE devILUThandle; #endif #ifdef _X11 static void* devILUThandle; #endif #ifdef _MACOSX #include <mach-o/dyld.h> #include <stdlib.h> #include <string.h> static const struct mach_header* devILUThandle; #endif /** * Retrieves a function pointer from the ilut library * @param function Name of function to retrieve */ static void *NativeGetFunctionPointer(const char *function) { #ifdef _WIN32 return GetProcAddress(devILUThandle, function); #endif #ifdef _X11 return dlsym(devILUThandle, function); #endif #ifdef _MACOSX char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); if (mac_symbol_name == NULL) return NULL; mac_symbol_name[0] = '_'; strcpy(&(mac_symbol_name[1]), function); NSSymbol symbol = NSLookupSymbolInImage(devILUThandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); free(mac_symbol_name); if (symbol == NULL) return NULL; return NSAddressOfSymbol(symbol); #endif } /** * Retrieves a pointer to the named function * * @param function Name of function * @return pointer to named function, or NULL if not found */ static void* extilut_GetProcAddress(const char* function) { void *p = NativeGetFunctionPointer(function); if (p == NULL) { printfDebug("Could not locate symbol %s\n", function); } return p; } /** * Initializes all functions for class */ void extilut_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) { ext_InitializeClass(env, clazz, &extilut_GetProcAddress, num_functions, functions); } /** * Opens the native library */ bool extilut_Open(JNIEnv *env, jobjectArray ilPaths) { jsize pathcount = (*env)->GetArrayLength(env, ilPaths); int i; jstring path; char *path_str; printfDebug("Found %d ilut paths\n", (int)pathcount); for(i=0;i<pathcount;i++) { path = (jstring) (*env)->GetObjectArrayElement(env, ilPaths, i); path_str = GetStringNativeChars(env, path); printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILUThandle = LoadLibrary(path_str); #endif #ifdef _X11 devILUThandle = dlopen(path_str, RTLD_LAZY); #endif #ifdef _MACOSX devILUThandle = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); #endif if (devILUThandle != NULL) { printfDebug("Found ilut at '%s'\n", path_str); } free(path_str); if (devILUThandle != NULL) { return true; } } throwException(env, "Could not load ilut library."); return false; } /** * Closes the native library */ void extilut_Close(void) { #ifdef _WIN32 FreeLibrary(devILUThandle); #endif #ifdef _X11 if (devILUThandle != NULL) { dlclose(devILUThandle); } #endif #ifdef _MACOSX // Cannot remove the image #endif devILUThandle = NULL; } --- NEW FILE: extilu.h --- #ifndef __EXTILU_H__ #define __EXTILU_H__ #include "devil-common.h" extern bool extilu_Open(JNIEnv *env, jobjectArray ilPaths); extern void extilu_Close(void); extern void extilu_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions); #endif Index: extil.h =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extil.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- extil.h 12 Jan 2005 12:30:31 -0000 1.5 +++ extil.h 25 Mar 2005 01:07:26 -0000 1.6 @@ -1,53 +1,10 @@ #ifndef __EXTIL_H__ #define __EXTIL_H__ -#include <jni.h> -#include <stdio.h> -#include <string.h> -//#include <gl/gl.h> -#include <IL/il.h> -#include <IL/ilu.h> -#include <IL/ilut.h> -#include "org_lwjgl_devil_IL.h" -#include "org_lwjgl_devil_ILU.h" -#include "org_lwjgl_devil_ILUT.h" -#include "common_tools.h" - - -/*-----------------------------------------*/ -/*-----------------------------------------*/ - -#if defined(_WIN32) && !defined(APIENTRY) -#define WIN32_LEAN_AND_MEAN 1 -#include <windows.h> - -#endif - -#define __ilext_h_ -#define __ILEXT_H_ -#define __il_h_ -#define __IL_H__ - -#include <string.h> - -#ifndef APIENTRY -#define APIENTRY -#endif - -#include "common_tools.h" - -#ifdef __cplusplus -extern "C" { -#endif +#include "devil-common.h" -/* initializes everything, call this right after the rc is created. the function returns 0 if successful */ -extern bool extil_Open(JNIEnv *env); +extern bool extil_Open(JNIEnv *env, jobjectArray ilPaths); extern void extil_Close(void); extern void extil_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions); -extern bool extil_InitializeFunctions(int num_functions, ExtFunction *functions); -#ifdef __cplusplus -} -#endif - -#endif /* __EXTIL_H__ */ +#endif \ No newline at end of file Index: org_lwjgl_devil_ILUT.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/org_lwjgl_devil_ILUT.c,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- org_lwjgl_devil_ILUT.c 12 Jan 2005 12:32:37 -0000 1.2 +++ org_lwjgl_devil_ILUT.c 25 Mar 2005 01:07:27 -0000 1.3 @@ -1,4 +1,48 @@ -#include "extil.h" +#include "extilut.h" + +typedef ILboolean (ILAPIENTRY *ilutRendererPROC) (ILenum Renderer); +typedef ILboolean (ILAPIENTRY *ilutDisablePROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilutEnablePROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilutGetBooleanPROC) (ILenum Mode); +typedef ILint (ILAPIENTRY *ilutGetIntegerPROC) (ILenum Mode); +typedef const ILstring (ILAPIENTRY *ilutGetStringPROC) (ILenum StringName); +typedef ILvoid (ILAPIENTRY *ilutInitPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilutIsDisabledPROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilutIsEnabledPROC) (ILenum Mode); +typedef ILvoid (ILAPIENTRY *ilutPopAttribPROC) (ILvoid); +typedef ILvoid (ILAPIENTRY *ilutPushAttribPROC) (ILuint Bits); +typedef ILvoid (ILAPIENTRY *ilutSetIntegerPROC) (ILenum Mode, ILint Param); +typedef GLuint (ILAPIENTRY *ilutGLBindTexImagePROC) (); +typedef GLuint (ILAPIENTRY *ilutGLBindMipmapsPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilutGLBuildMipmapsPROC) (ILvoid); +typedef GLuint (ILAPIENTRY *ilutGLLoadImagePROC) (const ILstring FileName); +typedef ILboolean (ILAPIENTRY *ilutGLScreenPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilutGLScreeniePROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilutGLSaveImagePROC) (const ILstring FileName, GLuint TexID); +typedef ILboolean (ILAPIENTRY *ilutGLSetTexPROC) (GLuint TexID); +typedef ILboolean (ILAPIENTRY *ilutGLTexImagePROC) (GLuint Level); + +static ilutRendererPROC ilutRenderer; +static ilutDisablePROC ilutDisable; +static ilutEnablePROC ilutEnable; +static ilutGetBooleanPROC ilutGetBoolean; +static ilutGetIntegerPROC ilutGetInteger; +static ilutGetStringPROC ilutGetString; +static ilutInitPROC ilutInit; +static ilutIsDisabledPROC ilutIsDisabled; +static ilutIsEnabledPROC ilutIsEnabled; +static ilutPopAttribPROC ilutPopAttrib; +static ilutPushAttribPROC ilutPushAttrib; +static ilutSetIntegerPROC ilutSetInteger; +static ilutGLBindTexImagePROC ilutGLBindTexImage; +static ilutGLBindMipmapsPROC ilutGLBindMipmaps; +static ilutGLBuildMipmapsPROC ilutGLBuildMipmaps; +static ilutGLLoadImagePROC ilutGLLoadImage; +static ilutGLScreenPROC ilutGLScreen; +static ilutGLScreeniePROC ilutGLScreenie; +static ilutGLSaveImagePROC ilutGLSaveImage; +static ilutGLSetTexPROC ilutGLSetTex; +static ilutGLTexImagePROC ilutGLTexImage; /* * Class: org_lwjgl_devil_ILUT @@ -202,25 +246,46 @@ * Method: nCreate * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILUT_nCreate(JNIEnv *env, jclass clazz){ - /*if (!extilut_Open(env)) { +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILUT_nCreate(JNIEnv *env, jclass clazz, jobjectArray ilutPaths){ + if (!extilut_Open(env, ilutPaths)) { throwException(env, "Failed to load ILUT library"); return; - }*/ + } } -#ifdef __cplusplus -extern "C" { -#endif +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILUT_nDestroy(JNIEnv *env, jclass clazz) { + extilut_Close(); +} -/* - * Class: org_lwjgl_devil_ILUT - * Method: initNativeStubs - * Signature: ()V - */ -JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILUT_initNativeStubs(JNIEnv *env, jclass clazz){ +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILUT_resetNativeStubs(JNIEnv *env, jclass clazz, jclass ilut_class) { + (*env)->UnregisterNatives(env, ilut_class); } -#ifdef __cplusplus +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILUT_initNativeStubs(JNIEnv *env, jclass clazz){ +JavaMethodAndExtFunction functions[] = { + {"ilutRenderer", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutRenderer, "ilutRenderer", (void*)&ilutRenderer}, + {"ilutDisable", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutDisable, "ilutDisable", (void*)&ilutDisable}, + {"ilutEnable", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutEnable, "ilutEnable", (void*)&ilutEnable}, + {"ilutGetBoolean", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutGetBoolean, "ilutGetBoolean", (void*)&ilutGetBoolean}, + {"ilutGetInteger", "(I)I", (void*)&Java_org_lwjgl_devil_ILUT_ilutGetInteger, "ilutGetInteger", (void*)&ilutGetInteger}, + {"ilutGetString", "(I)Ljava/lang/String;", (void*)&Java_org_lwjgl_devil_ILUT_ilutGetString, "ilutGetString", (void*)&ilutGetString}, + {"ilutInit", "()V", (void*)&Java_org_lwjgl_devil_ILUT_ilutInit, "ilutInit", (void*)&ilutInit}, + {"ilutIsDisabled", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutIsDisabled, "ilutIsDisabled", (void*)&ilutIsDisabled}, + {"ilutIsEnabled", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutIsDisabled, "ilutIsDisabled", (void*)&ilutIsDisabled}, + {"ilutPopAttrib", "()V", (void*)&Java_org_lwjgl_devil_ILUT_ilutPopAttrib, "ilutPopAttrib", (void*)&ilutPopAttrib}, + {"ilutPushAttrib", "(I)V", (void*)&Java_org_lwjgl_devil_ILUT_ilutPushAttrib, "ilutPushAttrib", (void*)&ilutPushAttrib}, + {"ilutSetInteger", "(II)V", (void*)&Java_org_lwjgl_devil_ILUT_ilutSetInteger, "ilutSetInteger", (void*)&ilutSetInteger}, + + {"ilutGLBindTexImage", "()I", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLBindTexImage, "ilutGLBindTexImage", (void*)&ilutGLBindTexImage}, + {"ilutGLBindMipmaps", "()I", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLBindMipmaps, "ilutGLBindMipmaps", (void*)&ilutGLBindMipmaps}, + {"ilutGLBuildMipmaps", "()Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLBuildMipmaps, "ilutGLBuildMipmaps", (void*)&ilutGLBuildMipmaps}, + {"ilutGLLoadImage", "(Ljava/lang/String;)I", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLLoadImage, "ilutGLLoadImage", (void*)&ilutGLLoadImage}, + {"ilutGLScreen", "()Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLScreen, "ilutGLScreen", (void*)&ilutGLScreen}, + {"ilutGLScreenie", "()Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLScreenie, "ilutGLScreenie", (void*)&ilutGLScreenie}, + {"ilutGLSaveImage", "(Ljava/lang/String;I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLSaveImage, "ilutGLSaveImage", (void*)&ilutGLSaveImage}, + {"ilutGLSetTex", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLSetTex, "ilutGLSetTex", (void*)&ilutGLSetTex}, + {"ilutGLTexImage", "(I)Z", (void*)&Java_org_lwjgl_devil_ILUT_ilutGLTexImage, "ilutGLTexImage", (void*)&ilutGLTexImage}, + }; + int num_functions = NUMFUNCTIONS(functions); + extilut_InitializeClass(env, clazz, num_functions, functions); } -#endif Index: org_lwjgl_devil_IL.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/org_lwjgl_devil_IL.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- org_lwjgl_devil_IL.c 9 Feb 2005 10:57:32 -0000 1.15 +++ org_lwjgl_devil_IL.c 25 Mar 2005 01:07:27 -0000 1.16 @@ -1,5 +1,179 @@ #include "extil.h" +typedef ILboolean (ILAPIENTRY *ilActiveImagePROC) (ILuint Number); +typedef ILboolean (ILAPIENTRY *ilActiveLayerPROC) (ILuint Number); +typedef ILboolean (ILAPIENTRY *ilActiveMipmapPROC) (ILuint Number); +typedef ILboolean (ILAPIENTRY *ilApplyPalPROC) (const ILstring FileName); +typedef ILboolean (ILAPIENTRY *ilApplyProfilePROC) (const ILstring InProfile, const ILstring OutProfile); +typedef ILvoid (ILAPIENTRY *ilBindImagePROC) (ILuint Image); +typedef ILboolean (ILAPIENTRY *ilBlitPROC) (ILuint Source, ILint DestX, ILint DestY, ILint DestZ, ILuint SrcX, ILuint SrcY, ILuint SrcZ, ILuint Width, ILuint Height, ILuint Depth); +typedef ILvoid (ILAPIENTRY *ilClearColourPROC) (ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha); +typedef ILboolean (ILAPIENTRY *ilClearImagePROC) (ILvoid); +typedef ILuint (ILAPIENTRY *ilCloneCurImagePROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilCompressFuncPROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilConvertImagePROC) (ILenum DestFormat, ILenum DestType); +typedef ILboolean (ILAPIENTRY *ilConvertPalPROC) (ILenum DestFormat); +typedef ILboolean (ILAPIENTRY *ilCopyImagePROC) (ILuint Src); +typedef ILuint (ILAPIENTRY *ilCopyPixelsPROC) (ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, ILvoid *Data); +typedef ILuint (ILAPIENTRY *ilCreateSubImagePROC) (ILenum Type, ILuint Num); +typedef ILboolean (ILAPIENTRY *ilDefaultImagePROC) (ILvoid); +typedef ILvoid (ILAPIENTRY *ilDeleteImagesPROC) (ILsizei Num, const ILuint *Images); +typedef ILboolean (ILAPIENTRY *ilDisablePROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilEnablePROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilFormatFuncPROC) (ILenum Mode); +typedef ILvoid (ILAPIENTRY *ilGenImagesPROC) (ILsizei Num, ILuint *Images); +typedef ILubyte* (ILAPIENTRY *ilGetAlphaPROC) (ILenum Type); +typedef ILvoid (ILAPIENTRY *ilModAlphaPROC) ( ILint AlphaValue ); +typedef ILvoid (ILAPIENTRY *ilSetAlphaPROC) ( ILuint AlphaValue ); +typedef ILboolean (ILAPIENTRY *ilGetBooleanPROC) (ILenum Mode); +typedef ILvoid (ILAPIENTRY *ilGetBooleanvPROC) (ILenum Mode, ILboolean *Param); +typedef ILubyte* (ILAPIENTRY *ilGetDataPROC) (ILvoid); +typedef ILuint (ILAPIENTRY *ilGetDXTCDataPROC) (ILvoid *Buffer, ILuint BufferSize, ILenum DXTCFormat); +typedef ILenum (ILAPIENTRY *ilGetErrorPROC) (ILvoid); +typedef ILint (ILAPIENTRY *ilGetIntegerPROC) (ILenum Mode); +typedef ILvoid (ILAPIENTRY *ilGetIntegervPROC) (ILenum Mode, ILint *Param); +typedef ILuint (ILAPIENTRY *ilGetLumpPosPROC) (ILvoid); +typedef ILubyte* (ILAPIENTRY *ilGetPalettePROC) (ILvoid); +typedef const ILstring (ILAPIENTRY *ilGetStringPROC) (ILenum StringName); +typedef ILvoid (ILAPIENTRY *ilHintPROC) (ILenum Target, ILenum Mode); +typedef ILvoid (ILAPIENTRY *ilInitPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilIsDisabledPROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilIsEnabledPROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilIsImagePROC) (ILuint Image); +typedef ILboolean (ILAPIENTRY *ilIsValidPROC) (ILenum Type, const ILstring FileName); +typedef ILboolean (ILAPIENTRY *ilIsValidFPROC) (ILenum Type, ILHANDLE File); +typedef ILboolean (ILAPIENTRY *ilIsValidLPROC) (ILenum Type, ILvoid *Lump, ILuint Size); +typedef ILvoid (ILAPIENTRY *ilKeyColourPROC) (ILclampf Red, ILclampf Green, ILclampf Blue, ILclampf Alpha); +typedef ILboolean (ILAPIENTRY *ilLoadPROC) (ILenum Type, const ILstring FileName); +typedef ILboolean (ILAPIENTRY *ilLoadFPROC) (ILenum Type, ILHANDLE File); +typedef ILboolean (ILAPIENTRY *ilLoadImagePROC) (const ILstring FileName); +typedef ILboolean (ILAPIENTRY *ilLoadLPROC) (ILenum Type, ILvoid *Lump, ILuint Size); +typedef ILboolean (ILAPIENTRY *ilLoadPalPROC) (const ILstring FileName); +typedef ILboolean (ILAPIENTRY *ilOriginFuncPROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilOverlayImagePROC) (ILuint Source, ILint XCoord, ILint YCoord, ILint ZCoord); +typedef ILvoid (ILAPIENTRY *ilPopAttribPROC) (ILvoid); +typedef ILvoid (ILAPIENTRY *ilPushAttribPROC) (ILuint Bits); +typedef ILvoid (ILAPIENTRY *ilRegisterFormatPROC) (ILenum Format); +typedef ILboolean (ILAPIENTRY *ilRegisterLoadPROC) (const ILstring Ext, IL_LOADPROC Load); +typedef ILboolean (ILAPIENTRY *ilRegisterMipNumPROC) (ILuint Num); +typedef ILboolean (ILAPIENTRY *ilRegisterNumImagesPROC) (ILuint Num); +typedef ILvoid (ILAPIENTRY *ilRegisterOriginPROC) (ILenum Origin); +typedef ILvoid (ILAPIENTRY *ilRegisterPalPROC) (ILvoid *Pal, ILuint Size, ILenum Type); +typedef ILboolean (ILAPIENTRY *ilRegisterSavePROC) (const ILstring Ext, IL_SAVEPROC Save); +typedef ILvoid (ILAPIENTRY *ilRegisterTypePROC) (ILenum Type); +typedef ILboolean (ILAPIENTRY *ilRemoveLoadPROC) (const ILstring Ext); +typedef ILboolean (ILAPIENTRY *ilRemoveSavePROC) (const ILstring Ext); +typedef ILvoid (ILAPIENTRY *ilResetMemoryPROC) (ILvoid); +typedef ILvoid (ILAPIENTRY *ilResetReadPROC) (ILvoid); +typedef ILvoid (ILAPIENTRY *ilResetWritePROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilSavePROC) (ILenum Type, const ILstring FileName); +typedef ILuint (ILAPIENTRY *ilSaveFPROC) (ILenum Type, ILHANDLE File); +typedef ILboolean (ILAPIENTRY *ilSaveImagePROC) (const ILstring FileName); +typedef ILuint (ILAPIENTRY *ilSaveLPROC) (ILenum Type, ILvoid *Lump, ILuint Size); +typedef ILboolean (ILAPIENTRY *ilSavePalPROC) (const ILstring FileName); +typedef ILboolean (ILAPIENTRY *ilSetDataPROC) (ILvoid *Data); +typedef ILboolean (ILAPIENTRY *ilSetDurationPROC) (ILuint Duration); +typedef ILvoid (ILAPIENTRY *ilSetIntegerPROC) (ILenum Mode, ILint Param); +typedef ILvoid (ILAPIENTRY *ilSetMemoryPROC) (mAlloc, mFree); +typedef ILvoid (ILAPIENTRY *ilSetPixelsPROC) (ILint XOff, ILint YOff, ILint ZOff, ILuint Width, ILuint Height, ILuint Depth, ILenum Format, ILenum Type, ILvoid *Data); +typedef ILvoid (ILAPIENTRY *ilSetReadPROC) (fOpenRProc, fCloseRProc, fEofProc, fGetcProc, fReadProc, fSeekRProc, fTellRProc); +typedef ILvoid (ILAPIENTRY *ilSetStringPROC) (ILenum Mode, const char *String); +typedef ILvoid (ILAPIENTRY *ilSetWritePROC) (fOpenWProc, fCloseWProc, fPutcProc, fSeekWProc, fTellWProc, fWriteProc); +typedef ILvoid (ILAPIENTRY *ilShutDownPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *ilTexImagePROC) (ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp, ILenum Format, ILenum Type, ILvoid *Data); +typedef ILboolean (ILAPIENTRY *ilTypeFuncPROC) (ILenum Mode); +typedef ILboolean (ILAPIENTRY *ilLoadDataPROC) (const ILstring FileName, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp); +typedef ILboolean (ILAPIENTRY *ilLoadDataFPROC) (ILHANDLE File, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp); +typedef ILboolean (ILAPIENTRY *ilLoadDataLPROC) (ILvoid *Lump, ILuint Size, ILuint Width, ILuint Height, ILuint Depth, ILubyte Bpp); +typedef ILboolean (ILAPIENTRY *ilSaveDataPROC) (const ILstring FileName); + +static ilActiveImagePROC ilActiveImage; +static ilActiveLayerPROC ilActiveLayer; +static ilActiveMipmapPROC ilActiveMipmap; +static ilApplyPalPROC ilApplyPal; +static ilApplyProfilePROC ilApplyProfile; +static ilBindImagePROC ilBindImage; +static ilBlitPROC ilBlit; +static ilClearColourPROC ilClearColour; +static ilClearImagePROC ilClearImage; +static ilCloneCurImagePROC ilCloneCurImage; +static ilCompressFuncPROC ilCompressFunc; +static ilConvertImagePROC ilConvertImage; +static ilConvertPalPROC ilConvertPal; +static ilCopyImagePROC ilCopyImage; +static ilCopyPixelsPROC ilCopyPixels; +static ilCreateSubImagePROC ilCreateSubImage; +static ilDefaultImagePROC ilDefaultImage; +static ilDeleteImagesPROC ilDeleteImages; +static ilDisablePROC ilDisable; +static ilEnablePROC ilEnable; +static ilFormatFuncPROC ilFormatFunc; +static ilGenImagesPROC ilGenImages; +static ilGetAlphaPROC ilGetAlpha; +static ilModAlphaPROC ilModAlpha; +static ilSetAlphaPROC ilSetAlpha; +static ilGetBooleanPROC ilGetBoolean; +static ilGetBooleanvPROC ilGetBooleanv; +static ilGetDataPROC ilGetData; +static ilGetDXTCDataPROC ilGetDXTCData; +static ilGetErrorPROC ilGetError; +static ilGetIntegerPROC ilGetInteger; +static ilGetIntegervPROC ilGetIntegerv; +static ilGetLumpPosPROC ilGetLumpPos; +static ilGetPalettePROC ilGetPalette; +static ilGetStringPROC ilGetString; +static ilHintPROC ilHint; +static ilInitPROC ilInit; +static ilIsDisabledPROC ilIsDisabled; +static ilIsEnabledPROC ilIsEnabled; +static ilIsImagePROC ilIsImage; +static ilIsValidPROC ilIsValid; +static ilIsValidFPROC ilIsValidF; +static ilIsValidLPROC ilIsValidL; +static ilKeyColourPROC ilKeyColour; +static ilLoadPROC ilLoad; +static ilLoadFPROC ilLoadF; +static ilLoadImagePROC ilLoadImage; +static ilLoadLPROC ilLoadL; +static ilLoadPalPROC ilLoadPal; +static ilOriginFuncPROC ilOriginFunc; +static ilOverlayImagePROC ilOverlayImage; +static ilPopAttribPROC ilPopAttrib; +static ilPushAttribPROC ilPushAttrib; +static ilRegisterFormatPROC ilRegisterFormat; +static ilRegisterLoadPROC ilRegisterLoad; +static ilRegisterMipNumPROC ilRegisterMipNum; +static ilRegisterNumImagesPROC ilRegisterNumImages; +static ilRegisterOriginPROC ilRegisterOrigin; +static ilRegisterPalPROC ilRegisterPal; +static ilRegisterSavePROC ilRegisterSave; +static ilRegisterTypePROC ilRegisterType; +static ilRemoveLoadPROC ilRemoveLoad; +static ilRemoveSavePROC ilRemoveSave; +static ilResetMemoryPROC ilResetMemory; +static ilResetReadPROC ilResetRead; +static ilResetWritePROC ilResetWrite; +static ilSavePROC ilSave; +static ilSaveFPROC ilSaveF; +static ilSaveImagePROC ilSaveImage; +static ilSaveLPROC ilSaveL; +static ilSavePalPROC ilSavePal; +static ilSetDataPROC ilSetData; +static ilSetDurationPROC ilSetDuration; +static ilSetIntegerPROC ilSetInteger; +static ilSetMemoryPROC ilSetMemory; +static ilSetPixelsPROC ilSetPixels; +static ilSetReadPROC ilSetRead; +static ilSetStringPROC ilSetString; +static ilSetWritePROC ilSetWrite; +static ilShutDownPROC ilShutDown; +static ilTexImagePROC ilTexImage; +static ilTypeFuncPROC ilTypeFunc; +static ilLoadDataPROC ilLoadData; +static ilLoadDataFPROC ilLoadDataF; +static ilLoadDataLPROC ilLoadDataL; +static ilSaveDataPROC ilSaveData; + /* * Class: org_lwjgl_devil_IL * Method: ilActiveImage @@ -214,7 +388,6 @@ ilGenImages((ILsizei)num, (ILuint *)lists); } - /* * Class: org_lwjgl_devil_IL * Method: ilGetAlpha @@ -657,7 +830,6 @@ */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_IL_nilTexImage(JNIEnv *env, jclass clazz, jint width, jint height, jint depth , jbyte bpp, jint format, jint type, jobject data_buffer, jint data_offset) { ILbyte *data = (ILbyte *)(*env)->GetDirectBufferAddress(env, data_buffer); - return ilTexImage((ILuint)width, (ILuint)height, (ILuint)depth , (ILubyte)bpp, (ILenum)format, (ILenum)type, (ILvoid *)(data + data_offset)); } @@ -712,18 +884,22 @@ * Method: nCreate * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_lwjgl_devil_IL_nCreate(JNIEnv *env, jclass clazz) { - /*if (!extil_Open(env)) { +JNIEXPORT void JNICALL Java_org_lwjgl_devil_IL_nCreate(JNIEnv *env, jclass clazz, jobjectArray ilPaths) { + if (!extil_Open(env, ilPaths)) { throwException(env, "Failed to load DevIL library"); return; - }*/ + } +} + +JNIEXPORT void JNICALL Java_org_lwjgl_devil_IL_nDestroy(JNIEnv *env, jclass clazz) { + extil_Close(); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_devil_IL_resetNativeStubs(JNIEnv *env, jclass clazz, jclass il_class) { + (*env)->UnregisterNatives(env, il_class); } -#ifdef __cplusplus -extern "C" { -#endif JNIEXPORT void JNICALL Java_org_lwjgl_devil_IL_initNativeStubs(JNIEnv *env, jclass clazz) { -/* JavaMethodAndExtFunction functions[] = { {"ilActiveImage", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilActiveImage, "ilActiveImage", (void*)&ilActiveImage}, {"ilActiveLayer", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilActiveLayer, "ilActiveLayer", (void*)&ilActiveLayer}, @@ -747,15 +923,15 @@ {"ilEnable", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilEnable, "ilEnable", (void*)&ilEnable}, {"ilFormatFunc", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilFormatFunc, "ilFormatFunc", (void*)&ilFormatFunc}, {"nilGenImages", "(ILjava/nio/IntBuffer;I)V", (void*)&Java_org_lwjgl_devil_IL_nilGenImages, "ilGenImages", (void*)&ilGenImages}, - {"ilGetAlpha", "(I)[B", (void*)&Java_org_lwjgl_devil_IL_ilGetAlpha, "ilGetAlpha", (void*)&ilGetAlpha}, - {"ilModAlpha", "(I)V", (void*)&Java_org_lwjgl_devil_IL_ilModAlpha, "ilModAlpha", (void*)&ilModAlpha}, - {"ilSetAlpha", "(I)V", (void*)&Java_org_lwjgl_devil_IL_ilSetAlpha, "ilSetAlpha", (void*)&ilSetAlpha}, + {"ilGetAlpha", "(I)Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_devil_IL_ilGetAlpha, "ilGetAlpha", (void*)&ilGetAlpha}, + //{"ilModAlpha", "(I)V", (void*)&Java_org_lwjgl_devil_IL_ilModAlpha, "ilModAlpha", (void*)&ilModAlpha}, + //{"ilSetAlpha", "(I)V", (void*)&Java_org_lwjgl_devil_IL_ilSetAlpha, "ilSetAlpha", (void*)&ilSetAlpha}, {"ilGetBoolean", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilGetBoolean, "ilGetBoolean", (void*)&ilGetBoolean}, - {"ilGetData", "()[B", (void*)&Java_org_lwjgl_devil_IL_ilGetData, "ilGetData", (void*)&ilGetData}, + {"ilGetData", "()Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_devil_IL_ilGetData, "ilGetData", (void*)&ilGetData}, {"ilGetError", "()I", (void*)&Java_org_lwjgl_devil_IL_ilGetError, "ilGetError", (void*)&ilGetError}, {"ilGetInteger", "(I)I", (void*)&Java_org_lwjgl_devil_IL_ilGetInteger, "ilGetInteger", (void*)&ilGetInteger}, {"ilGetLumpPos", "()I", (void*)&Java_org_lwjgl_devil_IL_ilGetLumpPos, "ilGetLumpPos", (void*)&ilGetLumpPos}, - {"ilGetPalette", "()[B", (void*)&Java_org_lwjgl_devil_IL_ilGetPalette, "ilGetPalette", (void*)&ilGetPalette}, + {"ilGetPalette", "()Ljava/nio/ByteBuffer;", (void*)&Java_org_lwjgl_devil_IL_ilGetPalette, "ilGetPalette", (void*)&ilGetPalette}, {"ilGetString", "(I)Ljava/lang/String;", (void*)&Java_org_lwjgl_devil_IL_ilGetString, "ilGetString", (void*)&ilGetString}, {"ilHint", "(II)V", (void*)&Java_org_lwjgl_devil_IL_ilHint, "ilHint", (void*)&ilHint}, {"ilInit", "()V", (void*)&Java_org_lwjgl_devil_IL_ilInit, "ilInit", (void*)&ilInit}, @@ -781,7 +957,7 @@ {"ilSave", "(ILjava/lang/String;)Z", (void*)&Java_org_lwjgl_devil_IL_ilSave, "ilSave", (void*)&ilSave}, {"ilSaveImage", "(Ljava/lang/String;)Z", (void*)&Java_org_lwjgl_devil_IL_ilSaveImage, "ilSaveImage", (void*)&ilSaveImage}, {"nilSaveL", "(ILjava/nio/ByteBuffer;II)I", (void*)&Java_org_lwjgl_devil_IL_nilSaveL, "ilSaveL", (void*)&ilSaveL}, - {"ilSavePal", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilSavePal, "ilSavePal", (void*)&ilSavePal}, + {"ilSavePal", "(Ljava/lang/String;)Z", (void*)&Java_org_lwjgl_devil_IL_ilSavePal, "ilSavePal", (void*)&ilSavePal}, {"nilSetData", "(Ljava/nio/ByteBuffer;I)Z", (void*)&Java_org_lwjgl_devil_IL_nilSetData, "ilSetData", (void*)&ilSetData}, {"ilSetDuration", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilSetDuration, "ilSetDuration", (void*)&ilSetDuration}, {"ilSetInteger", "(II)V", (void*)&Java_org_lwjgl_devil_IL_ilSetInteger, "ilSetInteger", (void*)&ilSetInteger}, @@ -791,14 +967,9 @@ {"nilTexImage", "(IIIBIILjava/nio/ByteBuffer;I)Z", (void*)&Java_org_lwjgl_devil_IL_nilTexImage, "ilTexImage", (void*)&ilTexImage}, {"ilTypeFunc", "(I)Z", (void*)&Java_org_lwjgl_devil_IL_ilTypeFunc, "ilTypeFunc", (void*)&ilTypeFunc}, {"ilLoadData", "(Ljava/lang/String;IIIB)Z", (void*)&Java_org_lwjgl_devil_IL_ilLoadData, "ilLoadData", (void*)&ilLoadData}, - {"ilLoadDataL", "(Ljava/nio/ByteBuffer;IIIIIB)Z", (void*)&Java_org_lwjgl_devil_IL_nilLoadDataL, "ilLoadDataL", (void*)&ilLoadDataL}, + {"nilLoadDataL", "(Ljava/nio/ByteBuffer;IIIIIB)Z", (void*)&Java_org_lwjgl_devil_IL_nilLoadDataL, "ilLoadDataL", (void*)&ilLoadDataL}, {"ilSaveData", "(Ljava/lang/String;)Z", (void*)&Java_org_lwjgl_devil_IL_ilSaveData, "ilSaveData", (void*)&ilSaveData} }; int num_functions = NUMFUNCTIONS(functions); extil_InitializeClass(env, clazz, num_functions, functions); -*/ -} - -#ifdef __cplusplus } -#endif Index: extil.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/extil.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- extil.c 12 Dec 2004 10:13:54 -0000 1.3 +++ extil.c 25 Mar 2005 01:07:26 -0000 1.4 @@ -1,67 +1,115 @@ #include "extil.h" -/* turn off the warning for the borland compiler*/ -#ifdef __BORLANDC__ -#pragma warn -8064 -#pragma warn -8065 -#endif /* __BORLANDC__ */ - +/* Handle to devil Library */ #ifdef _WIN32 -HMODULE devILhandle = NULL; +static HMODULE devILhandle; +#endif +#ifdef _X11 +static void* devILhandle; +#endif +#ifdef _MACOSX +#include <mach-o/dyld.h> +#include <stdlib.h> +#include <string.h> +static const struct mach_header* devILhandle; #endif -/* getProcAddress */ - -void *extil_GetProcAddress(const char *name) { +/** + * Retrieves a function pointer from the devil library + * @param function Name of function to retrieve + */ +static void *NativeGetFunctionPointer(const char *function) { #ifdef _WIN32 - void *t = GetProcAddress(devILhandle, name); - - - if (t == NULL) { - printfDebug("Could not locate symbol %s\n", name); - } - - - return t; + return GetProcAddress(devILhandle, function); +#endif +#ifdef _X11 + return dlsym(devILhandle, function); +#endif +#ifdef _MACOSX + char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); + if (mac_symbol_name == NULL) + return NULL; + mac_symbol_name[0] = '_'; + strcpy(&(mac_symbol_name[1]), function); + NSSymbol symbol = NSLookupSymbolInImage(devILhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); + free(mac_symbol_name); + if (symbol == NULL) + return NULL; + return NSAddressOfSymbol(symbol); #endif } +/** + * Retrieves a pointer to the named function + * + * @param function Name of function + * @return pointer to named function, or NULL if not found + */ +static void* extil_GetProcAddress(const char* function) { + void *p = NativeGetFunctionPointer(function); + if (p == NULL) { + printfDebug("Could not locate symbol %s\n", function); + } + return p; +} + +/** + * Initializes all functions for class + */ void extil_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) { ext_InitializeClass(env, clazz, &extil_GetProcAddress, num_functions, functions); } +/** + * Opens the native library + */ +bool extil_Open(JNIEnv *env, jobjectArray ilPaths) { + jsize pathcount = (*env)->GetArrayLength(env, ilPaths); + int i; + jstring path; + char *path_str; -bool extil_InitializeFunctions(int num_functions, ExtFunction *functions) { - return ext_InitializeFunctions(&extil_GetProcAddress, num_functions, functions); -} - + printfDebug("Found %d devil paths\n", (int)pathcount); + for(i=0;i<pathcount;i++) { + path = (jstring) (*env)->GetObjectArrayElement(env, ilPaths, i); + path_str = GetStringNativeChars(env, path); + printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 -bool extil_Open(JNIEnv *env) { - bool result = true; - - if (devILhandle == NULL) { - // load the dynamic libraries for DevIL - devILhandle = LoadLibrary("DevIL.dll"); - if (devILhandle == NULL) { - printf("\r\nfailed to load DevIL"); - result = false; - } - } + devILhandle = LoadLibrary(path_str); +#endif +#ifdef _X11 + devILhandle = dlopen(path_str, RTLD_LAZY); +#endif +#ifdef _MACOSX + devILhandle = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); +#endif + if (devILhandle != NULL) { + printfDebug("Found devil at '%s'\n", path_str); + } - return result; + free(path_str); + if (devILhandle != NULL) { + return true; + } + } + throwException(env, "Could not load devil library."); + return false; } -#endif /* WIN32 */ +/** + * Closes the native library + */ void extil_Close(void) { #ifdef _WIN32 - FreeLibrary(devILhandle); - devILhandle = NULL; + FreeLibrary(devILhandle); #endif -} - -/* turn on the warning for the borland compiler*/ -#ifdef __BORLANDC__ -#pragma warn .8064 -#pragma warn .8065 -#endif /* __BORLANDC__ */ - +#ifdef _X11 + if (devILhandle != NULL) { + dlclose(devILhandle); + } +#endif +#ifdef _MACOSX + // Cannot remove the image +#endif + devILhandle = NULL; +} \ No newline at end of file --- NEW FILE: extilut.h --- #ifndef __EXTILUT_H__ #define __EXTILUT_H__ #include "devil-common.h" extern bool extilut_Open(JNIEnv *env, jobjectArray ilPaths); extern void extilut_Close(void); extern void extilut_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions); #endif --- NEW FILE: extilu.c --- #include "extilu.h" /* Handle to ilu Library */ #ifdef _WIN32 static HMODULE devILUhandle; #endif #ifdef _X11 static void* devILUhandle; #endif #ifdef _MACOSX #include <mach-o/dyld.h> #include <stdlib.h> #include <string.h> static const struct mach_header* devILUhandle; #endif /** * Retrieves a function pointer from the ilu library * @param function Name of function to retrieve */ static void *NativeGetFunctionPointer(const char *function) { #ifdef _WIN32 return GetProcAddress(devILUhandle, function); #endif #ifdef _X11 return dlsym(devILUhandle, function); #endif #ifdef _MACOSX char *mac_symbol_name = (char *)malloc((strlen(function) + 2)*sizeof(char)); if (mac_symbol_name == NULL) return NULL; mac_symbol_name[0] = '_'; strcpy(&(mac_symbol_name[1]), function); NSSymbol symbol = NSLookupSymbolInImage(devILUhandle, mac_symbol_name, NSLOOKUPSYMBOLINIMAGE_OPTION_RETURN_ON_ERROR); free(mac_symbol_name); if (symbol == NULL) return NULL; return NSAddressOfSymbol(symbol); #endif } /** * Retrieves a pointer to the named function * * @param function Name of function * @return pointer to named function, or NULL if not found */ static void* extilu_GetProcAddress(const char* function) { void *p = NativeGetFunctionPointer(function); if (p == NULL) { printfDebug("Could not locate symbol %s\n", function); } return p; } /** * Initializes all functions for class */ void extilu_InitializeClass(JNIEnv *env, jclass clazz, int num_functions, JavaMethodAndExtFunction *functions) { ext_InitializeClass(env, clazz, &extilu_GetProcAddress, num_functions, functions); } /** * Opens the native library */ bool extilu_Open(JNIEnv *env, jobjectArray ilPaths) { jsize pathcount = (*env)->GetArrayLength(env, ilPaths); int i; jstring path; char *path_str; printfDebug("Found %d ilu paths\n", (int)pathcount); for(i=0;i<pathcount;i++) { path = (jstring) (*env)->GetObjectArrayElement(env, ilPaths, i); path_str = GetStringNativeChars(env, path); printfDebug("Testing '%s'\n", path_str); #ifdef _WIN32 devILUhandle = LoadLibrary(path_str); #endif #ifdef _X11 devILUhandle = dlopen(path_str, RTLD_LAZY); #endif #ifdef _MACOSX devILUhandle = NSAddImage(path_str, NSADDIMAGE_OPTION_RETURN_ON_ERROR); #endif if (devILUhandle != NULL) { printfDebug("Found ilu at '%s'\n", path_str); } free(path_str); if (devILUhandle != NULL) { return true; } } throwException(env, "Could not load ilu library."); return false; } /** * Closes the native library */ void extilu_Close(void) { #ifdef _WIN32 FreeLibrary(devILUhandle); #endif #ifdef _X11 if (devILUhandle != NULL) { dlclose(devILUhandle); } #endif #ifdef _MACOSX // Cannot remove the image #endif devILUhandle = NULL; } Index: org_lwjgl_devil_ILU.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/devil/org_lwjgl_devil_ILU.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- org_lwjgl_devil_ILU.c 9 Feb 2005 10:57:33 -0000 1.3 +++ org_lwjgl_devil_ILU.c 25 Mar 2005 01:07:27 -0000 1.4 @@ -1,4 +1,94 @@ -#include "extil.h" +#include "extilu.h" + +typedef ILboolean (ILAPIENTRY *iluAlienifyPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluBlurAvgPROC) (ILuint Iter); +typedef ILboolean (ILAPIENTRY *iluBlurGaussianPROC) (ILuint Iter); +typedef ILboolean (ILAPIENTRY *iluBuildMipmapsPROC) (ILvoid); +typedef ILuint (ILAPIENTRY *iluColoursUsedPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluCompareImagePROC) (ILuint Comp); +typedef ILboolean (ILAPIENTRY *iluContrastPROC) (ILfloat Contrast); +typedef ILboolean (ILAPIENTRY *iluCropPROC) (ILuint XOff, ILuint YOff, ILuint ZOff, ILuint Width, ILuint Height, ILuint Depth); +typedef ILvoid (ILAPIENTRY *iluDeleteImagePROC) (ILuint Id); +typedef ILboolean (ILAPIENTRY *iluEdgeDetectEPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluEdgeDetectPPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluEdgeDetectSPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluEmbossPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluEnlargeCanvasPROC) (ILuint Width, ILuint Height, ILuint Depth); +typedef ILboolean (ILAPIENTRY *iluEnlargeImagePROC) (ILfloat XDim, ILfloat YDim, ILfloat ZDim); +typedef ILboolean (ILAPIENTRY *iluEqualizePROC) (ILvoid); +typedef const ILstring (ILAPIENTRY *iluErrorStringPROC) (ILenum Error); +typedef ILboolean (ILAPIENTRY *iluFlipImagePROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluGammaCorrectPROC) (ILfloat Gamma); +typedef ILuint (ILAPIENTRY *iluGenImagePROC) (ILvoid); +typedef ILvoid (ILAPIENTRY *iluGetImageInfoPROC) (ILinfo *Info); +typedef ILint (ILAPIENTRY *iluGetIntegerPROC) (ILenum Mode); +typedef ILvoid (ILAPIENTRY *iluGetIntegervPROC) (ILenum Mode, ILint *Param); +typedef const ILstring (ILAPIENTRY *iluGetStringPROC) (ILenum StringName); +typedef ILvoid (ILAPIENTRY *iluImageParameterPROC) (ILenum PName, ILenum Param); +typedef ILvoid (ILAPIENTRY *iluInitPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluInvertAlphaPROC) (ILvoid); +typedef ILuint (ILAPIENTRY *iluLoadImagePROC) (const ILstring FileName); +typedef ILboolean (ILAPIENTRY *iluMirrorPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluNegativePROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluNoisifyPROC) (ILclampf Tolerance); +typedef ILboolean (ILAPIENTRY *iluPixelizePROC) (ILuint PixSize); +typedef ILvoid (ILAPIENTRY *iluRegionfvPROC) (ILpointf *Points, ILuint n); +typedef ILvoid (ILAPIENTRY *iluRegionivPROC) (ILpointi *Points, ILuint n); +typedef ILboolean (ILAPIENTRY *iluReplaceColourPROC) (ILubyte Red, ILubyte Green, ILubyte Blue, ILfloat Tolerance); +typedef ILboolean (ILAPIENTRY *iluRotatePROC) (ILfloat Angle); +typedef ILboolean (ILAPIENTRY *iluRotate3DPROC) (ILfloat x, ILfloat y, ILfloat z, ILfloat Angle); +typedef ILboolean (ILAPIENTRY *iluSaturate1fPROC) (ILfloat Saturation); +typedef ILboolean (ILAPIENTRY *iluSaturate4fPROC) (ILfloat r, ILfloat g, ILfloat b, ILfloat Saturation); +typedef ILboolean (ILAPIENTRY *iluScalePROC) (ILuint Width, ILuint Height, ILuint Depth); +typedef ILboolean (ILAPIENTRY *iluScaleColoursPROC) (ILfloat r, ILfloat g, ILfloat b); +typedef ILboolean (ILAPIENTRY *iluSharpenPROC) (ILfloat Factor, ILuint Iter); +typedef ILboolean (ILAPIENTRY *iluSwapColoursPROC) (ILvoid); +typedef ILboolean (ILAPIENTRY *iluWavePROC) (ILfloat Angle); + +static iluAlienifyPROC iluAlienify; +static iluBlurAvgPROC iluBlurAvg; +static iluBlurGaussianPROC iluBlurGaussian; +static iluBuildMipmapsPROC iluBuildMipmaps; +static iluColoursUsedPROC iluColoursUsed; +static iluCompareImagePROC iluCompareImage; +static iluContrastPROC iluContrast; +static iluCropPROC iluCrop; +static iluDeleteImagePROC iluDeleteImage; +static iluEdgeDetectEPROC iluEdgeDetectE; +static iluEdgeDetectPPROC iluEdgeDetectP; +static iluEdgeDetectSPROC iluEdgeDetectS; +static iluEmbossPROC iluEmboss; +static iluEnlargeCanvasPROC iluEnlargeCanvas; +static iluEnlargeImagePROC iluEnlargeImage; +static iluEqualizePROC iluEqualize; +static iluErrorStringPROC iluErrorString; +static iluFlipImagePROC iluFlipImage; +static iluGammaCorrectPROC iluGammaCorrect; +static iluGenImagePROC iluGenImage; +static iluGetImageInfoPROC iluGetImageInfo; +static iluGetIntegerPROC iluGetInteger; +static iluGetIntegervPROC iluGetIntegerv; +static iluGetStringPROC iluGetString; +static iluImageParameterPROC iluImageParameter; +static iluInitPROC iluInit; +static iluInvertAlphaPROC iluInvertAlpha; +static iluLoadImagePROC iluLoadImage; +static iluMirrorPROC iluMirror; +static iluNegativePROC iluNegative; +static iluNoisifyPROC iluNoisify; +static iluPixelizePROC iluPixelize; +static iluRegionfvPROC iluRegionfv; +static iluRegionivPROC iluRegioniv; +static iluReplaceColourPROC iluReplaceColour; +static iluRotatePROC iluRotate; +static iluRotate3DPROC iluRotate3D; +static iluSaturate1fPROC iluSaturate1f; +static iluSaturate4fPROC iluSaturate4f; +static iluScalePROC iluScale; +static iluScaleColoursPROC iluScaleColours; +static iluSharpenPROC iluSharpen; +static iluSwapColoursPROC iluSwapColours; +static iluWavePROC iluWave; /* * Class: org_lwjgl_devil_ILU @@ -260,9 +350,9 @@ * Method: iluGetIntegerv * Signature: (ILjava/nio/IntBuffer;)V */ -JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluGetIntegerv(JNIEnv *env, jclass clazz, jint mode, jobject param_buffer, jint param_offset) { +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_niluGetIntegerv(JNIEnv *env, jclass clazz, jint mode, jobject param_buffer, jint param_offset) { ILbyte *lists = (ILbyte *) safeGetBufferAddress(env, param_buffer) + param_offset; - ilGenImages((ILsizei)mode, (ILuint *)lists); + iluGetIntegerv((ILsizei)mode, (ILuint *)lists); } /* @@ -356,7 +446,7 @@ * Signature: ([Lorg/lwjgl/devil/ILpointf;I)V */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_iluRegionfv(JNIEnv *env, jclass clazz, jobjectArray points, jint n) { - jfieldID fieldId; + /*jfieldID fieldId; jmethodID methodId; jobject element; int i; @@ -392,7 +482,7 @@ } printf("\nHere 5"); - free(pointInfo); + free(pointInfo);*/ } /* @@ -409,6 +499,7 @@ * Signature: (BBBF)Z */ JNIEXPORT jboolean JNICALL Java_org_lwjgl_devil_ILU_iluReplaceColour(JNIEnv *env, jclass clazz, jbyte red, jbyte green, jbyte blue, jfloat tolerence) { + return false; } /* @@ -488,31 +579,65 @@ * Method: nCreate * Signature: ()V */ -JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_nCreate(JNIEnv *env, jclass clazz) { - /*if (!extilu_Open(env)) { +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_nCreate(JNIEnv *env, jclass clazz, jobjectArray iluPaths) { + if (!extilu_Open(env, iluPaths)) { throwException(env, "Failed to load ILU library"); return; - }*/ + } +} + +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_nDestroy(JNIEnv *env, jclass clazz) { + extilu_Close(); +} + +JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_resetNativeStubs(JNIEnv *env, jclass clazz, jclass ilu_class) { + (*env)->UnregisterNatives(env, ilu_class); } -#ifdef __cplusplus -extern "C" { -#endif -/* - * Class: org_lwjgl_devil_ILU - * Method: initNativeStubs - * Signature: ()V - */ JNIEXPORT void JNICALL Java_org_lwjgl_devil_ILU_initNativeStubs(JNIEnv *env, jclass clazz) { -/* JavaMethodAndExtFunction functions[] = { - {"iluAlienify", "()Z", (void*)&Java_org_lwjgl_devil_IL_iluAlienify, "iluAlienify", (void*)&iluAlienify}, + {"iluAlienify", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluAlienify, "iluAlienify", (void*)&iluAlienify}, + {"iluBlurAvg", "(I)Z", (void*)&Java_org_lwjgl_devil_ILU_iluBlurAvg, "iluBlurAvg", (void*)&iluBlurAvg}, + {"iluBlurGaussian", "(I)Z", (void*)&Java_org_lwjgl_devil_ILU_iluBlurGaussian, "iluBlurGaussian", (void*)&iluBlurGaussian}, + {"iluBuildMipmaps", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluBuildMipmaps, "iluBuildMipmaps", (void*)&iluBuildMipmaps}, + {"iluColoursUsed", "()I", (void*)&Java_org_lwjgl_devil_ILU_iluColoursUsed, "iluColoursUsed", (void*)&iluColoursUsed}, + {"iluCompareImage", "(I)Z", (void*)&Java_org_lwjgl_devil_ILU_iluCompareImage, "iluCompareImage", (void*)&iluCompareImage}, + {"iluContrast", "(F)Z", (void*)&Java_org_lwjgl_devil_ILU_iluContrast, "iluContrast", (void*)&iluContrast}, + {"iluCrop", "(IIIIII)Z", (void*)&Java_org_lwjgl_devil_ILU_iluCrop, "iluCrop", (void*)&iluCrop}, + {"iluDeleteImage", "(I)V", (void*)&Java_org_lwjgl_devil_ILU_iluDeleteImage, "iluDeleteImage", (void*)&iluDeleteImage}, + {"iluEdgeDetectE", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluEdgeDetectE, "iluEdgeDetectE", (void*)&iluEdgeDetectE}, + {"iluEdgeDetectP", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluEdgeDetectP, "iluEdgeDetectP", (void*)&iluEdgeDetectP}, + {"iluEdgeDetectS", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluEdgeDetectS, "iluEdgeDetectS", (void*)&iluEdgeDetectS}, + {"iluEmboss", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluEmboss, "iluEmboss", (void*)&iluEmboss}, + {"iluEnlargeCanvas", "(III)Z", (void*)&Java_org_lwjgl_devil_ILU_iluEnlargeCanvas, "iluEnlargeCanvas", (void*)&iluEnlargeCanvas}, + {"iluEnlargeImage", "(FFF)Z", (void*)&Java_org_lwjgl_devil_ILU_iluEnlargeImage, "iluEnlargeImage", (void*)&iluEnlargeImage}, + {"iluEqualize", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluEqualize, "iluEqualize", (void*)&iluEqualize}, + {"iluErrorString", "(I)Ljava/lang/String;", (void*)&Java_org_lwjgl_devil_ILU_iluErrorString, "iluErrorString", (void*)&iluErrorString}, + {"iluFlipImage", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluFlipImage, "iluFlipImage", (void*)&iluFlipImage}, + {"iluGammaCorrect", "(F)Z", (void*)&Java_org_lwjgl_devil_ILU_iluGammaCorrect, "iluGammaCorrect", (void*)&iluGammaCorrect}, + {"iluGenImage", "()I", (void*)&Java_org_lwjgl_devil_ILU_iluGenImage, "iluGenImage", (void*)&iluGenImage}, + {"iluGetImageInfo", "(Lorg/lwjgl/devil/ILinfo;)V", (void*)&Java_org_lwjgl_devil_ILU_iluGetImageInfo, "iluGetImageInfo", (void*)&iluGetImageInfo}, + {"iluGetInteger", "(I)I", (void*)&Java_org_lwjgl_devil_ILU_iluGetInteger, "iluGetInteger", (void*)&iluGetInteger}, + //{"niluGetIntegerv", "(ILjava/nio/IntBuffer;)V", (void*)&Java_org_lwjgl_devil_ILU_niluGetIntegerv, "iluGetIntegerv", (void*)&iluGetIntegerv}, + {"iluGetString", "(I)Ljava/lang/String;", (void*)&Java_org_lwjgl_devil_ILU_iluGetString, "iluGetString", (void*)&iluGetString}, + {"iluImageParameter", "(II)V", (void*)&Java_org_lwjgl_devil_ILU_iluImageParameter, "iluImageParameter", (void*)&iluImageParameter}, + {"iluInit", "()V", (void*)&Java_org_lwjgl_devil_ILU_iluInit, "iluInit", (void*)&iluInit}, + {"iluInvertAlpha", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluInvertAlpha, "iluInvertAlpha", (void*)&iluInvertAlpha}, + {"iluLoadImage", "(Ljava/lang/String;)I", (void*)&Java_org_lwjgl_devil_ILU_iluLoadImage, "iluLoadImage", (void*)&iluLoadImage}, + {"iluMirror", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluMirror, "iluMirror", (void*)&iluMirror}, + {"iluNegative", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluNegative, "iluNegative", (void*)&iluNegative}, + {"iluNoisify", "(F)Z", (void*)&Java_org_lwjgl_devil_ILU_iluNoisify, "iluNoisify", (void*)&iluNoisify}, + {"iluPixelize", "(I)Z", (void*)&Java_org_lwjgl_devil_ILU_iluPixelize, "iluPixelize", (void*)&iluPixelize}, + {"iluReplaceColour", "(BBBF)Z", (void*)&Java_org_lwjgl_devil_ILU_iluReplaceColour, "iluReplaceColour", (void*)&iluReplaceColour}, + {"iluRotate", "(F)Z", (void*)&Java_org_lwjgl_devil_ILU_iluRotate, "iluRotate", (void*)&iluRotate}, + {"iluSaturate1f", "(F)Z", (void*)&Java_org_lwjgl_devil_ILU_iluSaturate1f, "iluSaturate1f", (void*)&iluSaturate1f}, + {"iluSaturate4f", "(FFFF)Z", (void*)&Java_org_lwjgl_devil_ILU_iluSaturate4f, "iluSaturate4f", (void*)&iluSaturate4f}, + {"iluScale", "(III)Z", (void*)&Java_org_lwjgl_devil_ILU_iluScale, "iluScale", (void*)&iluScale}, + {"iluScaleColours", "(FFF)Z", (void*)&Java_org_lwjgl_devil_ILU_iluScaleColours, "iluScaleColours", (void*)&iluScaleColours}, + {"iluSharpen", "(FI)Z", (void*)&Java_org_lwjgl_devil_ILU_iluSharpen, "iluSharpen", (void*)&iluSharpen}, + {"iluSwapColours", "()Z", (void*)&Java_org_lwjgl_devil_ILU_iluSwapColours, "iluSwapColours", (void*)&iluSwapColours}, + {"iluWave", "(F)Z", (void*)&Java_org_lwjgl_devil_ILU_iluWave, "iluWave", (void*)&iluWave}, }; int num_functions = NUMFUNCTIONS(functions); - extil_InitializeClass(env, clazz, num_functions, functions); -*/ -} - -#ifdef __cplusplus + extilu_InitializeClass(env, clazz, num_functions, functions); } -#endif |
|
From: Elias N. <eli...@us...> - 2005-03-23 10:06:45
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv864/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: Minor fix(2) Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.30 retrieving revision 1.31 diff -u -d -r1.30 -r1.31 --- WindowCreationTest.java 23 Mar 2005 10:05:05 -0000 1.30 +++ WindowCreationTest.java 23 Mar 2005 10:06:17 -0000 1.31 @@ -280,7 +280,7 @@ "L:\t\tList selectable display modes\n" + "0-8:\t\tSelection of display modes\n" + "F:\t\tToggle fullscreen\n" + - "SHIFT-F:\t\tToggle fullscreen with Display.destroy()/create() cycle"); + "SHIFT-F:\tToggle fullscreen with Display.destroy()/create() cycle"); WindowCreationTest wct = new WindowCreationTest(); if (wct.initialize()) { |
|
From: Elias N. <eli...@us...> - 2005-03-23 10:05:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32676/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: Minor fix Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- WindowCreationTest.java 23 Mar 2005 09:56:22 -0000 1.29 +++ WindowCreationTest.java 23 Mar 2005 10:05:05 -0000 1.30 @@ -279,7 +279,7 @@ "ARROW Keys:\tMove window when in non-fullscreen mode\n" + "L:\t\tList selectable display modes\n" + "0-8:\t\tSelection of display modes\n" + - "F:\t\tToggle fullscreen" + + "F:\t\tToggle fullscreen\n" + "SHIFT-F:\t\tToggle fullscreen with Display.destroy()/create() cycle"); WindowCreationTest wct = new WindowCreationTest(); |
|
From: Elias N. <eli...@us...> - 2005-03-23 09:56:31
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27635/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: Added SHIFT-F in WindowCreationTest to do a complete fullscreen toggle Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- WindowCreationTest.java 21 Mar 2005 21:28:16 -0000 1.28 +++ WindowCreationTest.java 23 Mar 2005 09:56:22 -0000 1.29 @@ -218,7 +218,16 @@ // check for fullscreen if (Keyboard.getEventKey() == Keyboard.KEY_F) { try { - Display.setFullscreen(fullscreen = !fullscreen); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || + Keyboard.isKeyDown(Keyboard.KEY_RSHIFT)) { + System.out.println("Performing Display.destroy()/create() cycle"); + DisplayMode saved_mode = Display.getDisplayMode(); + Display.destroy(); + Display.setDisplayMode(saved_mode); + Display.setFullscreen(fullscreen = !fullscreen); + Display.create(); + } else + Display.setFullscreen(fullscreen = !fullscreen); } catch (LWJGLException lwjgle) { lwjgle.printStackTrace(); } @@ -270,7 +279,8 @@ "ARROW Keys:\tMove window when in non-fullscreen mode\n" + "L:\t\tList selectable display modes\n" + "0-8:\t\tSelection of display modes\n" + - "F:\t\tToggle fullscreen"); + "F:\t\tToggle fullscreen" + + "SHIFT-F:\t\tToggle fullscreen with Display.destroy()/create() cycle"); WindowCreationTest wct = new WindowCreationTest(); if (wct.initialize()) { |
|
From: Brian M. <ma...@us...> - 2005-03-23 06:44:12
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23475/src/java/org/lwjgl/test/opengl/awt Added Files: DemoBox.java Log Message: Work In Progress - demobox --- NEW FILE: DemoBox.java --- /* * Copyright (c) 2002-2005 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.opengl.awt; import java.awt.BorderLayout; import java.awt.Button; import java.awt.Frame; import java.awt.GridBagConstraints; import java.awt.GridBagLayout; import java.awt.Label; import java.awt.List; import java.awt.Panel; import java.awt.event.ActionEvent; import java.awt.event.ActionListener; import java.awt.event.ItemEvent; import java.awt.event.ItemListener; import java.awt.event.WindowAdapter; import java.awt.event.WindowEvent; import java.nio.FloatBuffer; import java.util.Enumeration; import java.util.Hashtable; import org.lwjgl.BufferUtils; import org.lwjgl.LWJGLException; import org.lwjgl.opengl.ARBTransposeMatrix; import org.lwjgl.opengl.AWTGLCanvas; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; import org.lwjgl.opengl.GLContext; /** * $Id$ * <p> * </p> * @version $Revision$ * @author Brian Matzon <br...@ma...> */ public class DemoBox extends Frame { /** GL canvas */ private DemoBoxGLCanvas demoCanvas; /** Demo selection panel */ private Panel selectionPanel; /** Hashtable of demos */ private Hashtable selectableDemos; /** * Creates a new demo box instance */ public DemoBox() { selectableDemos = new Hashtable(); selectableDemos.put("default", new NullDemoBox()); selectableDemos.put("clear_color", new ClearColorDemoBox()); selectableDemos.put("gears", new GearsDemoBox()); } /** * @return */ public boolean initialize() { setTitle("LWJGL - Demo Box"); setSize(640, 480); setLayout(new GridBagLayout()); // Setup selection panel // ================================= selectionPanel = new Panel(); selectionPanel.setLayout(new BorderLayout()); selectionPanel.add(new Label("Demo", Label.CENTER), BorderLayout.NORTH); Button fullScreen = new Button("Fullscreen"); fullScreen.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent event) { toggleFullscreen(); } }); selectionPanel.add(fullScreen, BorderLayout.SOUTH); final List demos = new List(); for (Enumeration e = selectableDemos.keys(); e.hasMoreElements();) { demos.add(e.nextElement().toString()); } selectionPanel.add(demos, BorderLayout.CENTER); demos.addItemListener(new ItemListener() { public void itemStateChanged(ItemEvent event) { demoSelected(event.getItemSelectable().getSelectedObjects()[0].toString()); } }); GridBagConstraints gbc = new GridBagConstraints(); gbc.gridx = 0; gbc.gridy = 0; gbc.fill = java.awt.GridBagConstraints.BOTH; gbc.weightx = 0.05; gbc.weighty = 1.0; add(selectionPanel, gbc); // --------------------------------- // setup demo canvas // ================================= try { demoCanvas = new DemoBoxGLCanvas(this); gbc = new GridBagConstraints(); gbc.gridx = 1; gbc.gridy = 0; gbc.fill = java.awt.GridBagConstraints.BOTH; gbc.weightx = 0.95; gbc.weighty = 1.0; add(demoCanvas, gbc); } catch (LWJGLException le) { le.printStackTrace(); return false; } // --------------------------------- addWindowListener(new WindowAdapter() { public void windowClosing(WindowEvent e) { demoCanvas.destroy(); dispose(); } }); //demos.select(0); //demoSelected(demos.getSelectedItem()); return true; } public void updateFPS(float fps) { if(fps != -1) { setTitle("LWJGL - Demo Box (FPS: " + fps + ")"); } else { setTitle("LWJGL - Demo Box"); } } /** * Enter fullscreen mode for this demo */ protected void toggleFullscreen() { System.out.println("Toggle Fullscreen"); } /** * Selected a demo * @param demo Name of demo that was selected */ protected void demoSelected(String demo) { System.out.println("Selecting demo: " + demo); demoCanvas.setActiveDemo((Demo) selectableDemos.get(demo)); } /** * @param args * @throws LWJGLException */ public static void main(String[] args) throws LWJGLException { DemoBox demo = new DemoBox(); demo.initialize(); demo.setVisible(true); } /** * Interface for a demo */ public interface Demo { public boolean isInitialized(); public boolean initialize(); public void render(); public void destroy(); } /** * */ private class DemoBoxGLCanvas extends AWTGLCanvas implements Runnable { /** Parent demo box */ DemoBox parent; /** Currently active demo */ Demo activeDemo; /** last active demo */ Demo lastActiveDemo; /** Render thread */ private Thread renderThread; public DemoBoxGLCanvas(DemoBox parent) throws LWJGLException { super(); this.parent = parent; } // FPS long startTime = 0; long fps = 0; protected void paintGL() { synchronized (this) { if (lastActiveDemo != null && lastActiveDemo != activeDemo) { lastActiveDemo.destroy(); lastActiveDemo = null; if (activeDemo != null) { activeDemo.initialize(); startTime = System.currentTimeMillis() + 5000; } else { parent.updateFPS(-1); } } if (activeDemo != null) { if(!activeDemo.isInitialized()) { activeDemo.initialize(); } activeDemo.render(); try { swapBuffers(); } catch (LWJGLException le) { le.printStackTrace(); } if (startTime > System.currentTimeMillis()) { fps++; } else { long timeUsed = 5000 + (startTime - System.currentTimeMillis()); startTime = System.currentTimeMillis() + 5000; parent.updateFPS((fps / (timeUsed / 1000f))); fps = 0; } } } } public void destroy() { setActiveDemo(null); renderThread = null; } public void setActiveDemo(Demo activeDemo) { synchronized (this) { // setting no current demo if (activeDemo == null) { lastActiveDemo = this.activeDemo; this.activeDemo = null; return; } // setting to new demo lastActiveDemo = this.activeDemo; this.activeDemo = activeDemo; } if (renderThread == null) { renderThread = new Thread(this); renderThread.setName("DemoBox-Renderer"); renderThread.start(); } } public DemoBoxGLCanvas() throws LWJGLException { super(); } public void run() { while (renderThread != null) { // check for change of demo synchronized (this) { // if no demo set, just sleep if (activeDemo == null) { sleep(1000); } else { // we have a demo! sleep(16); repaint(); } } } System.out.println("dead"); } private void sleep(long time) { try { Thread.sleep(time); } catch (InterruptedException inte) { } } } // Demo box demo // ======================================================== public class ClearColorDemoBox implements Demo { private boolean initialized; int direction = 1; float color; public boolean isInitialized() { return initialized; } public boolean initialize() { return initialized = true; } public void render() { GL11.glClearColor(color, color, color, 1f); GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); color += direction * .05f; if (color > 1f) { color = 1f; direction = -1 * direction; } else if (color < 0f) { direction = -1 * direction; color = 0f; } } public void destroy() { initialized = false; } } // -------------------------------------------------------- // Demo box demo // ======================================================== public class NullDemoBox implements Demo { private boolean initialized; public boolean isInitialized() { return initialized; } public boolean initialize() { GL11.glClearColor(0, 0, 0, 1f); return true; } public void render() { GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); } public void destroy() { initialized = false; } } // -------------------------------------------------------- // Demo box demo // ======================================================== public class GearsDemoBox implements Demo { private boolean initialized; private float view_rotx = 20.0f; private float view_roty = 30.0f; private float view_rotz = 0.0f; private int gear1; private int gear2; private int gear3; private float angle = 0.0f; public boolean isInitialized() { return initialized; } public boolean initialize() { // setup ogl FloatBuffer pos = BufferUtils.createFloatBuffer(4).put(new float[] { 5.0f, 5.0f, 10.0f, 0.0f}); FloatBuffer red = BufferUtils.createFloatBuffer(4).put(new float[] { 0.8f, 0.1f, 0.0f, 1.0f}); FloatBuffer green = BufferUtils.createFloatBuffer(4).put(new float[] { 0.0f, 0.8f, 0.2f, 1.0f}); FloatBuffer blue = BufferUtils.createFloatBuffer(4).put(new float[] { 0.2f, 0.2f, 1.0f, 1.0f}); pos.flip(); red.flip(); green.flip(); blue.flip(); GL11.glClearColor(0, 0, 0, 1f); GL11.glLight(GL11.GL_LIGHT0, GL11.GL_POSITION, pos); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_LIGHT0); GL11.glEnable(GL11.GL_DEPTH_TEST); /* make the gears */ gear1 = GL11.glGenLists(1); GL11.glNewList(gear1, GL11.GL_COMPILE); GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, red); gear(1.0f, 4.0f, 1.0f, 20, 0.7f); GL11.glEndList(); gear2 = GL11.glGenLists(1); GL11.glNewList(gear2, GL11.GL_COMPILE); GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, green); gear(0.5f, 2.0f, 2.0f, 10, 0.7f); GL11.glEndList(); gear3 = GL11.glGenLists(1); GL11.glNewList(gear3, GL11.GL_COMPILE); GL11.glMaterial(GL11.GL_FRONT, GL11.GL_AMBIENT_AND_DIFFUSE, blue); gear(1.3f, 2.0f, 0.5f, 10, 0.7f); GL11.glEndList(); GL11.glEnable(GL11.GL_NORMALIZE); GL11.glMatrixMode(GL11.GL_PROJECTION); System.err.println("GL_VENDOR: " + GL11.glGetString(GL11.GL_VENDOR)); System.err.println("GL_RENDERER: " + GL11.glGetString(GL11.GL_RENDERER)); System.err.println("GL_VERSION: " + GL11.glGetString(GL11.GL_VERSION)); System.err.println(); System.err.println("glLoadTransposeMatrixfARB() supported: " + GLContext.getCapabilities().GL_ARB_transpose_matrix); if (!GLContext.getCapabilities().GL_ARB_transpose_matrix) { // --- not using extensions GL11.glLoadIdentity(); } else { // --- using extensions final FloatBuffer identityTranspose = BufferUtils.createFloatBuffer(16).put( new float[] { 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}); identityTranspose.flip(); ARBTransposeMatrix.glLoadTransposeMatrixARB(identityTranspose); } float h = (float) 300 / (float) 300; GL11.glFrustum(-1.0f, 1.0f, -h, h, 5.0f, 60.0f); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glLoadIdentity(); GL11.glTranslatef(0.0f, 0.0f, -40.0f); return initialized = true; } public void render() { angle += 2.0f; GL11.glClear(GL11.GL_COLOR_BUFFER_BIT | GL11.GL_DEPTH_BUFFER_BIT); GL11.glPushMatrix(); GL11.glRotatef(view_rotx, 1.0f, 0.0f, 0.0f); GL11.glRotatef(view_roty, 0.0f, 1.0f, 0.0f); GL11.glRotatef(view_rotz, 0.0f, 0.0f, 1.0f); GL11.glPushMatrix(); GL11.glTranslatef(-3.0f, -2.0f, 0.0f); GL11.glRotatef(angle, 0.0f, 0.0f, 1.0f); GL11.glCallList(gear1); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(3.1f, -2.0f, 0.0f); GL11.glRotatef(-2.0f * angle - 9.0f, 0.0f, 0.0f, 1.0f); GL11.glCallList(gear2); GL11.glPopMatrix(); GL11.glPushMatrix(); GL11.glTranslatef(-3.1f, 4.2f, 0.0f); GL11.glRotatef(-2.0f * angle - 25.0f, 0.0f, 0.0f, 1.0f); GL11.glCallList(gear3); GL11.glPopMatrix(); GL11.glPopMatrix(); } /** * Draw a gear wheel. You'll probably want to call this function when * building a display list since we do a lot of trig here. * * @param inner_radius radius of hole at center * @param outer_radius radius at center of teeth * @param width width of gear * @param teeth number of teeth * @param tooth_depth depth of tooth */ private void gear(float inner_radius, float outer_radius, float width, int teeth, float tooth_depth) { int i; float r0, r1, r2; float angle, da; float u, v, len; r0 = inner_radius; r1 = outer_radius - tooth_depth / 2.0f; r2 = outer_radius + tooth_depth / 2.0f; da = 2.0f * (float) Math.PI / teeth / 4.0f; GL11.glShadeModel(GL11.GL_FLAT); GL11.glNormal3f(0.0f, 0.0f, 1.0f); /* draw front face */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); if (i < teeth) { GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f); } } GL11.glEnd(); /* draw front sides of teeth */ GL11.glBegin(GL11.GL_QUADS); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2.0f * da), r2 * (float) Math.sin(angle + 2.0f * da), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3.0f * da), r1 * (float) Math.sin(angle + 3.0f * da), width * 0.5f); } GL11.glEnd(); /* draw back face */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); } GL11.glEnd(); /* draw back sides of teeth */ GL11.glBegin(GL11.GL_QUADS); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); } GL11.glEnd(); /* draw outward faces of teeth */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i < teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle), r1 * (float) Math.sin(angle), -width * 0.5f); u = r2 * (float) Math.cos(angle + da) - r1 * (float) Math.cos(angle); v = r2 * (float) Math.sin(angle + da) - r1 * (float) Math.sin(angle); len = (float) Math.sqrt(u * u + v * v); u /= len; v /= len; GL11.glNormal3f(v, -u, 0.0f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + da), r2 * (float) Math.sin(angle + da), -width * 0.5f); GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), width * 0.5f); GL11.glVertex3f(r2 * (float) Math.cos(angle + 2 * da), r2 * (float) Math.sin(angle + 2 * da), -width * 0.5f); u = r1 * (float) Math.cos(angle + 3 * da) - r2 * (float) Math.cos(angle + 2 * da); v = r1 * (float) Math.sin(angle + 3 * da) - r2 * (float) Math.sin(angle + 2 * da); GL11.glNormal3f(v, -u, 0.0f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(angle + 3 * da), r1 * (float) Math.sin(angle + 3 * da), -width * 0.5f); GL11.glNormal3f((float) Math.cos(angle), (float) Math.sin(angle), 0.0f); } GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), width * 0.5f); GL11.glVertex3f(r1 * (float) Math.cos(0), r1 * (float) Math.sin(0), -width * 0.5f); GL11.glEnd(); GL11.glShadeModel(GL11.GL_SMOOTH); /* draw inside radius cylinder */ GL11.glBegin(GL11.GL_QUAD_STRIP); for (i = 0; i <= teeth; i++) { angle = i * 2.0f * (float) Math.PI / teeth; GL11.glNormal3f(-(float) Math.cos(angle), -(float) Math.sin(angle), 0.0f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), -width * 0.5f); GL11.glVertex3f(r0 * (float) Math.cos(angle), r0 * (float) Math.sin(angle), width * 0.5f); } GL11.glEnd(); } public void destroy() { GL11.glDeleteLists(gear1, 1); GL11.glDeleteLists(gear2, 1); GL11.glDeleteLists(gear3, 1); initialized = false; } } // -------------------------------------------------------- } |
|
From: Brian M. <ma...@us...> - 2005-03-22 22:03:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10094/src/java/org/lwjgl/test/opengl/awt Modified Files: AWTGears.java AWTTest.java Log Message: fixed license Index: AWTGears.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTGears.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- AWTGears.java 7 Mar 2005 16:17:25 -0000 1.2 +++ AWTGears.java 22 Mar 2005 22:02:48 -0000 1.3 @@ -1,6 +1,33 @@ -/* - * Copyright (c) 2004-2005 Covalent Software Ltd +/* + * Copyright (c) 2002-2005 LWJGL Project * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.opengl.awt; Index: AWTTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/awt/AWTTest.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- AWTTest.java 22 Feb 2005 13:35:09 -0000 1.3 +++ AWTTest.java 22 Mar 2005 22:02:49 -0000 1.4 @@ -1,6 +1,33 @@ -/* - * Copyright (c) 2004-2005 Covalent Software Ltd +/* + * Copyright (c) 2002-2005 LWJGL Project * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.test.opengl.awt; |
|
From: Brian M. <ma...@us...> - 2005-03-22 22:03:17
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10094/src/java/org/lwjgl/test/opengl Modified Files: Gears.java Log Message: fixed license Index: Gears.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/opengl/Gears.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- Gears.java 16 Feb 2005 12:58:40 -0000 1.3 +++ Gears.java 22 Mar 2005 22:02:50 -0000 1.4 @@ -1,6 +1,37 @@ /* - * 3-D gear wheels. This program is in the public domain. - * Brian Paul + * Copyright (c) 2002-2005 LWJGL Project + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are + * met: + * + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * * Neither the name of 'LWJGL' nor the names of + * its contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR + * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR + * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + */ + +/* + * 3-D gear wheels. Originally by Brian Paul */ package org.lwjgl.test.opengl; |
|
From: Elias N. <eli...@us...> - 2005-03-22 12:41:59
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28474/src/java/org/lwjgl/util/generator Added Files: CachedReference.java Log Message: Added missing file --- NEW FILE: CachedReference.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.util.generator; /** * $Id: CachedReference.java,v 1.1 2005/03/22 12:41:33 elias_naur Exp $ * * This annotation indicates that a buffer parameter is cached by * OpenGL. * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ import java.lang.annotation.Target; import java.lang.annotation.ElementType; @Target(ElementType.PARAMETER) public @interface CachedReference { } |
|
From: Elias N. <eli...@us...> - 2005-03-22 12:35:07
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/win32 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23646/src/native/win32 Modified Files: org_lwjgl_opengl_Display.c Log Message: Win32: Handle all Windows messages, and ignore those with inappropriate HWNDs Index: org_lwjgl_opengl_Display.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/win32/org_lwjgl_opengl_Display.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- org_lwjgl_opengl_Display.c 16 Mar 2005 10:58:58 -0000 1.18 +++ org_lwjgl_opengl_Display.c 22 Mar 2005 12:34:58 -0000 1.19 @@ -240,13 +240,14 @@ MSG msg; while (PeekMessage( &msg, // message information - display_hwnd, // handle to window + NULL, // handle to window 0, // first message 0, // last message PM_REMOVE // removal options )) { - DispatchMessage(&msg); + if (display_hwnd != NULL && msg.hwnd == display_hwnd) + DispatchMessage(&msg); }; } |
|
From: Brian M. <ma...@us...> - 2005-03-21 21:28:36
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22299/src/java/org/lwjgl/test Modified Files: WindowCreationTest.java Log Message: updated WindowCreationTest to allow more dynamic testing Index: WindowCreationTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/WindowCreationTest.java,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- WindowCreationTest.java 20 Feb 2005 11:24:18 -0000 1.27 +++ WindowCreationTest.java 21 Mar 2005 21:28:16 -0000 1.28 @@ -45,114 +45,271 @@ */ public class WindowCreationTest { - /** - * Main entry point - * - * @param args ignored params to app - */ - public static void main(String[] args) throws LWJGLException { - // get avaialble modes, and print out - DisplayMode[] modes = Display.getAvailableDisplayModes(); - System.out.println("Found " + modes.length + " display modes"); + /** Locatable modes */ + private DisplayMode[] located_modes; + + /** Fixed selectable modes */ + private DisplayMode[] fixed_modes = new DisplayMode[10]; + - int x = 100, y = 100; - boolean fullscreen = false; - System.out.println("Moving to 100, 100"); - Display.setLocation(x, y); - - // Create the actual window - try { - setDisplayMode(); - Display.create(); - } catch (Exception e) { - e.printStackTrace(); - System.out.println("Unable to create window!, exiting..."); - System.exit(-1); + /** Window position x */ + private int window_x = 0; + + /** Window position y */ + private int window_y = 0; + + /** Color being cleared to */ + private float color = 0f; + + /** Direction moving clearing color */ + private int direction = 1; + + /** Whether we're running */ + private boolean running = false; + + /** Whether we're in fullscreen mode */ + private boolean fullscreen = false; + + + + /** + * Initializes the test + * @return true if initialization was successfull + */ + public boolean initialize() { + try { + // get available modes, and print out + located_modes = Display.getAvailableDisplayModes(); + System.out.println("Found " + located_modes.length + " display modes"); + + // get 640x480, 800x600, 1024x768 modes + findFixedModes(); + + // create default windowed display 640*480 @ 100, 100 + setDefaultDisplayMode(); + + window_x = window_y = 100; + Display.setLocation(window_x, window_y); + + Display.create(); + return true; + } catch (LWJGLException le) { + le.printStackTrace(); } + return false; + } + + /** Locate fixed modes */ + private void findFixedModes() { + // get 640*480 modes + fixed_modes[0] = getDisplayMode(640, 480, 16, 60); + fixed_modes[1] = getDisplayMode(640, 480, 24, 75); + fixed_modes[2] = getDisplayMode(640, 480, 32, 75); - System.out.println("Window created"); - System.out.println("Width: " + Display.getDisplayMode().getWidth() + - ", Height: " + Display.getDisplayMode().getHeight() + - ", Bits per pixel: " + Display.getDisplayMode().getBitsPerPixel() + - ", Frequency: " + Display.getDisplayMode().getFrequency() + - ", Title: "+ Display.getTitle()); - - Display.setVSyncEnabled(true); - Display.setTitle("WindowCreationTest"); - float color = 0f; - int direction = 1; - // wait for user to close window - while(!Display.isCloseRequested()) { + // get 800*600*16*60 + fixed_modes[3] = getDisplayMode(800, 600, 16, 60); + fixed_modes[4] = getDisplayMode(800, 600, 24, 75); + fixed_modes[5] = getDisplayMode(800, 600, 32, 75); + + // get 1024*768*16*60 + fixed_modes[6] = getDisplayMode(1024, 768, 16, 60); + fixed_modes[7] = getDisplayMode(1024, 768, 24, 75); + fixed_modes[8] = getDisplayMode(1024, 768, 32, 75); + } + + /** + * Executes the test + */ + private void execute() { + running = true; + + // wait for user to close window + while (!Display.isCloseRequested() && running) { + + // handle input accordingly + handleInput(); + + // render something + render(); + + // update display as needed + Display.update(); + + // no need to run at full speed + try { + Thread.sleep(100); + } catch (Exception e) { + e.printStackTrace(); + } + } + } + + /** + * Destroys any resources used while running test + */ + public void destroy() { + // nuke window and get out + Display.destroy(); + } + + /** + * Handles the input + */ + private void handleInput() { + while (Keyboard.next()) { + + // we only want key down events + if (!Keyboard.getEventKeyState()) { + continue; + } + + // check for exit + if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { + running = false; + } + + // check for listing of modes + if (Keyboard.getEventKey() == Keyboard.KEY_L) { + for(int i=0;i<fixed_modes.length; i++) { + System.out.println("[" + i + "]: " + fixed_modes[i]); + } + } + + // check for display mode + // ================================ + if (Keyboard.getEventKey() == Keyboard.KEY_0) { setMode(0); } + if (Keyboard.getEventKey() == Keyboard.KEY_1) { setMode(1); } + if (Keyboard.getEventKey() == Keyboard.KEY_2) { setMode(2); } + if (Keyboard.getEventKey() == Keyboard.KEY_3) { setMode(3); } + if (Keyboard.getEventKey() == Keyboard.KEY_4) { setMode(4); } + if (Keyboard.getEventKey() == Keyboard.KEY_5) { setMode(5); } + if (Keyboard.getEventKey() == Keyboard.KEY_6) { setMode(6); } + if (Keyboard.getEventKey() == Keyboard.KEY_7) { setMode(7); } + if (Keyboard.getEventKey() == Keyboard.KEY_8) { setMode(8); } + // -------------------------------- + + // check for window move + // ================================ + if (Keyboard.getEventKey() == Keyboard.KEY_LEFT) { + if (!Display.isFullscreen()) { + Display.setLocation(window_x -= 10, window_y); + } + } + + if (Keyboard.getEventKey() == Keyboard.KEY_RIGHT) { + if (!Display.isFullscreen()) { + Display.setLocation(window_x += 10, window_y); + } + } + + if (Keyboard.getEventKey() == Keyboard.KEY_UP) { + if (!Display.isFullscreen()) { + Display.setLocation(window_x, window_y -= 10); + } + } + + if (Keyboard.getEventKey() == Keyboard.KEY_DOWN) { + if (!Display.isFullscreen()) { + Display.setLocation(window_x, window_y += 10); + } + } + // -------------------------------- + + // check for fullscreen + if (Keyboard.getEventKey() == Keyboard.KEY_F) { + try { + Display.setFullscreen(fullscreen = !fullscreen); + } catch (LWJGLException lwjgle) { + lwjgle.printStackTrace(); + } + } + } + } + + private void setMode(int mode) { + if(fixed_modes[mode] == null) { + System.out.println("Unable to set mode. Not valid: " + mode); + return; + } + + try { + Display.setDisplayMode(fixed_modes[mode]); + } catch (LWJGLException le) { + le.printStackTrace(); + System.out.println("Exception while setting mode: " + fixed_modes[mode]); + } + } + + /** + * + */ + private void render() { GL11.glClearColor(color, color, color, 1f); - GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); - color += direction*.05f; - if (color > 1f) { - color = 1f; - direction = -1*direction; - } else if (color < 0f) { - direction = -1*direction; - color = 0f; - } - Display.update(); - try { - Thread.sleep(100); - } catch (Exception e) { - e.printStackTrace(); - } - - if(Keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) { - break; - } - - if(Keyboard.isKeyDown(Keyboard.KEY_LEFT)) { - Display.setLocation(x -= 10, y); - } - - if(Keyboard.isKeyDown(Keyboard.KEY_RIGHT)) { - Display.setLocation(x += 10, y); - } - - if(Keyboard.isKeyDown(Keyboard.KEY_UP)) { - Display.setLocation(x, y -= 10); - } - - if(Keyboard.isKeyDown(Keyboard.KEY_DOWN)) { - Display.setLocation(x, y += 10); - } - - if(Keyboard.isKeyDown(Keyboard.KEY_F)) { - try { - Display.setFullscreen(fullscreen = !fullscreen); - } catch (LWJGLException lwjgle) { - lwjgle.printStackTrace(); - } - } - - } - - // nuke window and get out - Display.destroy(); + GL11.glClear(GL11.GL_COLOR_BUFFER_BIT); + + color += direction * .05f; + + if (color > 1f) { + color = 1f; + direction = -1 * direction; + } else if (color < 0f) { + direction = -1 * direction; + color = 0f; + } } - - /** - * Sets the display mode for fullscreen mode - */ - protected static boolean setDisplayMode() { - try { - // get modes - DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60); - org.lwjgl.util.Display.setDisplayMode(dm, new String[] { - "width=" + 640, - "height=" + 480, - "freq=" + 60, - "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel() - }); - return true; - } catch (Exception e) { - e.printStackTrace(); - } + /** + * Main entry point + * + * @param args ignored params to app + */ + public static void main(String[] args) throws LWJGLException { + + System.out.println("The following keys are available:\n" + + "ESCAPE:\t\tExit test\n" + + "ARROW Keys:\tMove window when in non-fullscreen mode\n" + + "L:\t\tList selectable display modes\n" + + "0-8:\t\tSelection of display modes\n" + + "F:\t\tToggle fullscreen"); + + WindowCreationTest wct = new WindowCreationTest(); + if (wct.initialize()) { + wct.execute(); + wct.destroy(); + } + } - return false; - } + /** + * Sets the display mode for fullscreen mode + */ + protected boolean setDefaultDisplayMode() { + try { + // get modes + DisplayMode[] dm = org.lwjgl.util.Display.getAvailableDisplayModes(640, 480, -1, -1, -1, -1, 60, 60); + + org.lwjgl.util.Display.setDisplayMode(dm, new String[] { "width=" + 640, "height=" + 480, "freq=" + 60, + "bpp=" + org.lwjgl.opengl.Display.getDisplayMode().getBitsPerPixel()}); + return true; + } catch (Exception e) { + e.printStackTrace(); + } + return false; + } + + /** + * Gets a specific display mode + */ + private DisplayMode getDisplayMode(int width, int height, int bpp, int freq) { + DisplayMode[] dm = null; + try { + dm = org.lwjgl.util.Display.getAvailableDisplayModes(width, height, width, height, bpp, bpp, freq, freq); + if(dm == null || dm.length == 0) { + System.out.println("Problem retrieving mode with " + width + "x" + height + "x" + bpp + "@" + freq); + } + } catch (LWJGLException le) { + le.printStackTrace(); + System.out.println("Problem retrieving mode with " + width + "x" + height + "x" + bpp + "@" + freq); + } + return (dm != null && dm.length != 0) ? dm[0] : null; + } } |
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23539/src/java/org/lwjgl/opengl Modified Files: ARBBufferObject.java ARBDrawBuffers.java ARBImaging.java ARBMatrixPalette.java ARBOcclusionQuery.java ARBPointParameters.java ARBProgram.java ARBShaderObjects.java ARBTextureCompression.java ARBTransposeMatrix.java ARBVertexBlend.java ARBVertexProgram.java ARBVertexShader.java ATIDrawBuffers.java ATIElementArray.java ATIEnvmapBumpmap.java ATIFragmentShader.java ATIMapObjectBuffer.java ATIVertexArrayObject.java ATIVertexAttribArrayObject.java ContextCapabilities.java EXTDrawRangeElements.java EXTFogCoord.java EXTFramebufferObject.java EXTMultiDrawArrays.java EXTPalettedTexture.java EXTPointParameters.java EXTSecondaryColor.java EXTVertexShader.java EXTVertexWeighting.java GL11.java GL12.java GL13.java GL14.java GL15.java GL20.java NVEvaluators.java NVFence.java NVFragmentProgram.java NVHalfFloat.java NVOcclusionQuery.java NVPixelDataRange.java NVPointSprite.java NVProgram.java NVRegisterCombiners.java NVRegisterCombiners2.java NVVertexArrayRange.java NVVertexProgram.java Added Files: GLChecks.java References.java ReferencesStack.java StateTracker.java Removed Files: BufferObjectTracker.java GLBufferChecks.java Log Message: Implemented strong references in glVertexPointer and friends Index: NVOcclusionQuery.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/NVOcclusionQuery.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- NVOcclusionQuery.java 16 Feb 2005 16:04:22 -0000 1.12 +++ NVOcclusionQuery.java 21 Mar 2005 08:27:42 -0000 1.13 @@ -20,17 +20,17 @@ static native void initNativeStubs() throws LWJGLException; public static void glGetOcclusionQueryNV(int id, int pname, IntBuffer params) { - BufferChecks.checkBuffer(params, 4); long function_pointer = GLContext.getCapabilities().NV_occlusion_query_glGetOcclusionQueryivNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, 4); nglGetOcclusionQueryivNV(id, pname, params, params.position(), function_pointer); } private static native void nglGetOcclusionQueryivNV(int id, int pname, IntBuffer params, int params_position, long function_pointer); public static void glGetOcclusionQueryuNV(int id, int pname, IntBuffer params) { - BufferChecks.checkBuffer(params, 4); long function_pointer = GLContext.getCapabilities().NV_occlusion_query_glGetOcclusionQueryuivNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(params, 4); nglGetOcclusionQueryuivNV(id, pname, params, params.position(), function_pointer); } private static native void nglGetOcclusionQueryuivNV(int id, int pname, IntBuffer params, int params_position, long function_pointer); @@ -58,17 +58,17 @@ private static native boolean nglIsOcclusionQueryNV(int id, long function_pointer); public static void glDeleteOcclusionQueriesNV(IntBuffer piIDs) { - BufferChecks.checkDirect(piIDs); long function_pointer = GLContext.getCapabilities().NV_occlusion_query_glDeleteOcclusionQueriesNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(piIDs); nglDeleteOcclusionQueriesNV((piIDs.remaining()), piIDs, piIDs.position(), function_pointer); } private static native void nglDeleteOcclusionQueriesNV(int n, IntBuffer piIDs, int piIDs_position, long function_pointer); public static void glGenOcclusionQueriesNV(IntBuffer piIDs) { - BufferChecks.checkDirect(piIDs); long function_pointer = GLContext.getCapabilities().NV_occlusion_query_glGenOcclusionQueriesNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(piIDs); nglGenOcclusionQueriesNV((piIDs.remaining()), piIDs, piIDs.position(), function_pointer); } private static native void nglGenOcclusionQueriesNV(int n, IntBuffer piIDs, int piIDs_position, long function_pointer); Index: ARBImaging.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ARBImaging.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- ARBImaging.java 16 Feb 2005 21:45:59 -0000 1.19 +++ ARBImaging.java 21 Mar 2005 08:27:39 -0000 1.20 @@ -89,776 +89,776 @@ static native void initNativeStubs() throws LWJGLException; public static void glGetSeparableFilter(int target, int format, int type, ByteBuffer row, ByteBuffer column, ByteBuffer span) { - GLBufferChecks.ensurePackPBOdisabled(); + long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetSeparableFilter_pointer; + BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensurePackPBOdisabled(); BufferChecks.checkDirect(row); BufferChecks.checkDirect(column); BufferChecks.checkDirect(span); - long function_pointer = GLContext.getCapabilities().ARB_imaging_glGetSeparableFilter_pointer; [...1347 lines suppressed...] nglColorTable(target, internalFormat, width, format, type, data, data.position(), function_pointer); } public static void glColorTable(int target, int internalFormat, int width, int format, int type, FloatBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkBuffer(data, 256); long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkBuffer(data, 256); nglColorTable(target, internalFormat, width, format, type, data, data.position() << 2, function_pointer); } private static native void nglColorTable(int target, int internalFormat, int width, int format, int type, Buffer data, int data_position, long function_pointer); public static void glColorTable(int target, int internalFormat, int width, int format, int type, int data_buffer_offset) { - GLBufferChecks.ensureUnpackPBOenabled(); long function_pointer = GLContext.getCapabilities().ARB_imaging_glColorTable_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOenabled(); nglColorTableBO(target, internalFormat, width, format, type, data_buffer_offset, function_pointer); } private static native void nglColorTableBO(int target, int internalFormat, int width, int format, int type, int data_buffer_offset, long function_pointer); Index: EXTVertexShader.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/EXTVertexShader.java,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- EXTVertexShader.java 16 Feb 2005 21:46:01 -0000 1.16 +++ EXTVertexShader.java 21 Mar 2005 08:27:41 -0000 1.17 @@ -124,49 +124,49 @@ static native void initNativeStubs() throws LWJGLException; public static void glGetLocalConstantFloatEXT(int id, int value, FloatBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetLocalConstantFloatvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetLocalConstantFloatvEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetLocalConstantFloatvEXT(int id, int value, FloatBuffer pbData, int pbData_position, long function_pointer); public static void glGetLocalConstantIntegerEXT(int id, int value, IntBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetLocalConstantIntegervEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetLocalConstantIntegervEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetLocalConstantIntegervEXT(int id, int value, IntBuffer pbData, int pbData_position, long function_pointer); public static void glGetLocalConstantBooleanEXT(int id, int value, ByteBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetLocalConstantBooleanvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetLocalConstantBooleanvEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetLocalConstantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_position, long function_pointer); public static void glGetInvariantFloatEXT(int id, int value, FloatBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetInvariantFloatvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetInvariantFloatvEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetInvariantFloatvEXT(int id, int value, FloatBuffer pbData, int pbData_position, long function_pointer); public static void glGetInvariantIntegerEXT(int id, int value, IntBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetInvariantIntegervEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetInvariantIntegervEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetInvariantIntegervEXT(int id, int value, IntBuffer pbData, int pbData_position, long function_pointer); public static void glGetInvariantBooleanEXT(int id, int value, ByteBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetInvariantBooleanvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetInvariantBooleanvEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetInvariantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_position, long function_pointer); @@ -180,25 +180,25 @@ private static native java.nio.ByteBuffer nglGetVariantPointervEXT(int id, int value, int result_size, long function_pointer); public static void glGetVariantFloatEXT(int id, int value, FloatBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetVariantFloatvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetVariantFloatvEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetVariantFloatvEXT(int id, int value, FloatBuffer pbData, int pbData_position, long function_pointer); public static void glGetVariantIntegerEXT(int id, int value, IntBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetVariantIntegervEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetVariantIntegervEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetVariantIntegervEXT(int id, int value, IntBuffer pbData, int pbData_position, long function_pointer); public static void glGetVariantBooleanEXT(int id, int value, ByteBuffer pbData) { - BufferChecks.checkBuffer(pbData, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glGetVariantBooleanvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pbData, 4); nglGetVariantBooleanvEXT(id, value, pbData, pbData.position(), function_pointer); } private static native void nglGetVariantBooleanvEXT(int id, int value, ByteBuffer pbData, int pbData_position, long function_pointer); @@ -266,146 +266,150 @@ private static native void nglEnableVariantClientStateEXT(int id, long function_pointer); public static void glVariantPointerEXT(int id, int stride, FloatBuffer pAddr) { - GLBufferChecks.ensureArrayVBOdisabled(); - BufferChecks.checkDirect(pAddr); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantPointerEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(pAddr); + GLChecks.getReferences().EXT_vertex_shader_glVariantPointerEXT_pAddr = pAddr; nglVariantPointerEXT(id, GL11.GL_FLOAT, stride, pAddr, pAddr.position() << 2, function_pointer); } public static void glVariantPointerEXT(int id, boolean unsigned, int stride, ByteBuffer pAddr) { - GLBufferChecks.ensureArrayVBOdisabled(); - BufferChecks.checkDirect(pAddr); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantPointerEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(pAddr); + GLChecks.getReferences().EXT_vertex_shader_glVariantPointerEXT_pAddr = pAddr; nglVariantPointerEXT(id, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, stride, pAddr, pAddr.position(), function_pointer); } public static void glVariantPointerEXT(int id, boolean unsigned, int stride, IntBuffer pAddr) { - GLBufferChecks.ensureArrayVBOdisabled(); - BufferChecks.checkDirect(pAddr); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantPointerEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(pAddr); + GLChecks.getReferences().EXT_vertex_shader_glVariantPointerEXT_pAddr = pAddr; nglVariantPointerEXT(id, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, stride, pAddr, pAddr.position() << 2, function_pointer); } public static void glVariantPointerEXT(int id, boolean unsigned, int stride, ShortBuffer pAddr) { - GLBufferChecks.ensureArrayVBOdisabled(); - BufferChecks.checkDirect(pAddr); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantPointerEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(pAddr); + GLChecks.getReferences().EXT_vertex_shader_glVariantPointerEXT_pAddr = pAddr; nglVariantPointerEXT(id, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, stride, pAddr, pAddr.position() << 1, function_pointer); } private static native void nglVariantPointerEXT(int id, int type, int stride, Buffer pAddr, int pAddr_position, long function_pointer); public static void glVariantPointerEXT(int id, int type, int stride, int pAddr_buffer_offset) { - GLBufferChecks.ensureArrayVBOenabled(); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantPointerEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOenabled(); nglVariantPointerEXTBO(id, type, stride, pAddr_buffer_offset, function_pointer); } private static native void nglVariantPointerEXTBO(int id, int type, int stride, int pAddr_buffer_offset, long function_pointer); public static void glVariantuEXT(int id, IntBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantuivEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglVariantuivEXT(id, pAddr, pAddr.position(), function_pointer); } private static native void nglVariantuivEXT(int id, IntBuffer pAddr, int pAddr_position, long function_pointer); public static void glVariantuEXT(int id, ShortBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantusvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglVariantusvEXT(id, pAddr, pAddr.position(), function_pointer); } private static native void nglVariantusvEXT(int id, ShortBuffer pAddr, int pAddr_position, long function_pointer); public static void glVariantuEXT(int id, ByteBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantubvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglVariantubvEXT(id, pAddr, pAddr.position(), function_pointer); } private static native void nglVariantubvEXT(int id, ByteBuffer pAddr, int pAddr_position, long function_pointer); public static void glVariantEXT(int id, FloatBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantfvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglVariantfvEXT(id, pAddr, pAddr.position(), function_pointer); } private static native void nglVariantfvEXT(int id, FloatBuffer pAddr, int pAddr_position, long function_pointer); public static void glVariantEXT(int id, IntBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantivEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglVariantivEXT(id, pAddr, pAddr.position(), function_pointer); } private static native void nglVariantivEXT(int id, IntBuffer pAddr, int pAddr_position, long function_pointer); public static void glVariantEXT(int id, ShortBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantsvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglVariantsvEXT(id, pAddr, pAddr.position(), function_pointer); } private static native void nglVariantsvEXT(int id, ShortBuffer pAddr, int pAddr_position, long function_pointer); public static void glVariantEXT(int id, ByteBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glVariantbvEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglVariantbvEXT(id, pAddr, pAddr.position(), function_pointer); } private static native void nglVariantbvEXT(int id, ByteBuffer pAddr, int pAddr_position, long function_pointer); public static void glSetLocalConstantEXT(int id, FloatBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetLocalConstantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetLocalConstantEXT(id, GL11.GL_FLOAT, pAddr, pAddr.position() << 2, function_pointer); } public static void glSetLocalConstantEXT(int id, boolean unsigned, ByteBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetLocalConstantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetLocalConstantEXT(id, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, pAddr, pAddr.position(), function_pointer); } public static void glSetLocalConstantEXT(int id, boolean unsigned, IntBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetLocalConstantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetLocalConstantEXT(id, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, pAddr, pAddr.position() << 2, function_pointer); } public static void glSetLocalConstantEXT(int id, boolean unsigned, ShortBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetLocalConstantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetLocalConstantEXT(id, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, pAddr, pAddr.position() << 1, function_pointer); } private static native void nglSetLocalConstantEXT(int id, int type, Buffer pAddr, int pAddr_position, long function_pointer); public static void glSetInvariantEXT(int id, FloatBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetInvariantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetInvariantEXT(id, GL11.GL_FLOAT, pAddr, pAddr.position() << 2, function_pointer); } public static void glSetInvariantEXT(int id, boolean unsigned, ByteBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetInvariantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetInvariantEXT(id, unsigned ? GL11.GL_UNSIGNED_BYTE : GL11.GL_BYTE, pAddr, pAddr.position(), function_pointer); } public static void glSetInvariantEXT(int id, boolean unsigned, IntBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetInvariantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetInvariantEXT(id, unsigned ? GL11.GL_UNSIGNED_INT : GL11.GL_INT, pAddr, pAddr.position() << 2, function_pointer); } public static void glSetInvariantEXT(int id, boolean unsigned, ShortBuffer pAddr) { - BufferChecks.checkBuffer(pAddr, 4); long function_pointer = GLContext.getCapabilities().EXT_vertex_shader_glSetInvariantEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(pAddr, 4); nglSetInvariantEXT(id, unsigned ? GL11.GL_UNSIGNED_SHORT : GL11.GL_SHORT, pAddr, pAddr.position() << 1, function_pointer); } private static native void nglSetInvariantEXT(int id, int type, Buffer pAddr, int pAddr_position, long function_pointer); Index: ATIEnvmapBumpmap.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ATIEnvmapBumpmap.java,v retrieving revision 1.11 retrieving revision 1.12 diff -u -d -r1.11 -r1.12 --- ATIEnvmapBumpmap.java 16 Feb 2005 16:04:20 -0000 1.11 +++ ATIEnvmapBumpmap.java 21 Mar 2005 08:27:40 -0000 1.12 @@ -22,33 +22,33 @@ static native void initNativeStubs() throws LWJGLException; public static void glGetTexBumpParameterATI(int pname, IntBuffer param) { - BufferChecks.checkBuffer(param, 4); long function_pointer = GLContext.getCapabilities().ATI_envmap_bumpmap_glGetTexBumpParameterivATI_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(param, 4); nglGetTexBumpParameterivATI(pname, param, param.position(), function_pointer); } private static native void nglGetTexBumpParameterivATI(int pname, IntBuffer param, int param_position, long function_pointer); public static void glGetTexBumpParameterATI(int pname, FloatBuffer param) { - BufferChecks.checkBuffer(param, 4); long function_pointer = GLContext.getCapabilities().ATI_envmap_bumpmap_glGetTexBumpParameterfvATI_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(param, 4); nglGetTexBumpParameterfvATI(pname, param, param.position(), function_pointer); } private static native void nglGetTexBumpParameterfvATI(int pname, FloatBuffer param, int param_position, long function_pointer); public static void glTexBumpParameterATI(int pname, IntBuffer param) { - BufferChecks.checkBuffer(param, 4); long function_pointer = GLContext.getCapabilities().ATI_envmap_bumpmap_glTexBumpParameterivATI_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(param, 4); nglTexBumpParameterivATI(pname, param, param.position(), function_pointer); } private static native void nglTexBumpParameterivATI(int pname, IntBuffer param, int param_position, long function_pointer); public static void glTexBumpParameterATI(int pname, FloatBuffer param) { - BufferChecks.checkBuffer(param, 4); long function_pointer = GLContext.getCapabilities().ATI_envmap_bumpmap_glTexBumpParameterfvATI_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(param, 4); nglTexBumpParameterfvATI(pname, param, param.position(), function_pointer); } private static native void nglTexBumpParameterfvATI(int pname, FloatBuffer param, int param_position, long function_pointer); Index: EXTVertexWeighting.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/EXTVertexWeighting.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- EXTVertexWeighting.java 16 Feb 2005 16:04:21 -0000 1.13 +++ EXTVertexWeighting.java 21 Mar 2005 08:27:41 -0000 1.14 @@ -27,17 +27,18 @@ static native void initNativeStubs() throws LWJGLException; public static void glVertexWeightPointerEXT(int size, int stride, FloatBuffer pPointer) { - GLBufferChecks.ensureArrayVBOdisabled(); - BufferChecks.checkDirect(pPointer); long function_pointer = GLContext.getCapabilities().EXT_vertex_weighting_glVertexWeightPointerEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOdisabled(); + BufferChecks.checkDirect(pPointer); + GLChecks.getReferences().EXT_vertex_weighting_glVertexWeightPointerEXT_pPointer = pPointer; nglVertexWeightPointerEXT(size, GL11.GL_FLOAT, stride, pPointer, pPointer.position() << 2, function_pointer); } private static native void nglVertexWeightPointerEXT(int size, int type, int stride, Buffer pPointer, int pPointer_position, long function_pointer); public static void glVertexWeightPointerEXT(int size, int type, int stride, int pPointer_buffer_offset) { - GLBufferChecks.ensureArrayVBOenabled(); long function_pointer = GLContext.getCapabilities().EXT_vertex_weighting_glVertexWeightPointerEXT_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureArrayVBOenabled(); nglVertexWeightPointerEXTBO(size, type, stride, pPointer_buffer_offset, function_pointer); } private static native void nglVertexWeightPointerEXTBO(int size, int type, int stride, int pPointer_buffer_offset, long function_pointer); Index: ARBShaderObjects.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/ARBShaderObjects.java,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- ARBShaderObjects.java 16 Feb 2005 16:04:20 -0000 1.15 +++ ARBShaderObjects.java 21 Mar 2005 08:27:40 -0000 1.16 @@ -50,39 +50,39 @@ static native void initNativeStubs() throws LWJGLException; public static void glGetShaderSourceARB(int obj, IntBuffer length, ByteBuffer source) { + long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetShaderSourceARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); if (length != null) BufferChecks.checkBuffer(length, 1); BufferChecks.checkDirect(source); - long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetShaderSourceARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); nglGetShaderSourceARB(obj, (source.remaining()), length, length != null ? length.position() : 0, source, source.position(), function_pointer); } private static native void nglGetShaderSourceARB(int obj, int maxLength, IntBuffer length, int length_position, ByteBuffer source, int source_position, long function_pointer); public static void glGetUniformARB(int programObj, int location, IntBuffer params) { - BufferChecks.checkDirect(params); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetUniformivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); nglGetUniformivARB(programObj, location, params, params.position(), function_pointer); } private static native void nglGetUniformivARB(int programObj, int location, IntBuffer params, int params_position, long function_pointer); public static void glGetUniformARB(int programObj, int location, FloatBuffer params) { - BufferChecks.checkDirect(params); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetUniformfvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); nglGetUniformfvARB(programObj, location, params, params.position(), function_pointer); } private static native void nglGetUniformfvARB(int programObj, int location, FloatBuffer params, int params_position, long function_pointer); public static void glGetActiveUniformARB(int programObj, int index, IntBuffer length, IntBuffer size, IntBuffer type, ByteBuffer name) { + long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetActiveUniformARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); if (length != null) BufferChecks.checkBuffer(length, 1); BufferChecks.checkBuffer(size, 1); BufferChecks.checkBuffer(type, 1); BufferChecks.checkDirect(name); - long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetActiveUniformARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); nglGetActiveUniformARB(programObj, index, (name.remaining()), length, length != null ? length.position() : 0, size, size.position(), type, type.position(), name, name.position(), function_pointer); } private static native void nglGetActiveUniformARB(int programObj, int index, int maxLength, IntBuffer length, int length_position, IntBuffer size, int size_position, IntBuffer type, int type_position, ByteBuffer name, int name_position, long function_pointer); @@ -94,135 +94,135 @@ * @return */ public static int glGetUniformLocationARB(int programObj, ByteBuffer name) { - BufferChecks.checkDirect(name); - BufferChecks.checkNullTerminated(name); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetUniformLocationARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(name); + BufferChecks.checkNullTerminated(name); int __result = nglGetUniformLocationARB(programObj, name, name.position(), function_pointer); return __result; } private static native int nglGetUniformLocationARB(int programObj, ByteBuffer name, int name_position, long function_pointer); public static void glGetAttachedObjectsARB(int containerObj, IntBuffer count, IntBuffer obj) { + long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetAttachedObjectsARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); if (count != null) BufferChecks.checkBuffer(count, 1); BufferChecks.checkDirect(obj); - long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetAttachedObjectsARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); nglGetAttachedObjectsARB(containerObj, (obj.remaining()), count, count != null ? count.position() : 0, obj, obj.position(), function_pointer); } private static native void nglGetAttachedObjectsARB(int containerObj, int maxCount, IntBuffer count, int count_position, IntBuffer obj, int obj_position, long function_pointer); public static void glGetInfoLogARB(int obj, IntBuffer length, ByteBuffer infoLog) { + long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetInfoLogARB_pointer; + BufferChecks.checkFunctionAddress(function_pointer); if (length != null) BufferChecks.checkBuffer(length, 1); BufferChecks.checkDirect(infoLog); - long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetInfoLogARB_pointer; - BufferChecks.checkFunctionAddress(function_pointer); nglGetInfoLogARB(obj, (infoLog.remaining()), length, length != null ? length.position() : 0, infoLog, infoLog.position(), function_pointer); } private static native void nglGetInfoLogARB(int obj, int maxLength, IntBuffer length, int length_position, ByteBuffer infoLog, int infoLog_position, long function_pointer); public static void glGetObjectParameterARB(int obj, int pname, IntBuffer params) { - BufferChecks.checkDirect(params); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetObjectParameterivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); nglGetObjectParameterivARB(obj, pname, params, params.position(), function_pointer); } private static native void nglGetObjectParameterivARB(int obj, int pname, IntBuffer params, int params_position, long function_pointer); public static void glGetObjectParameterARB(int obj, int pname, FloatBuffer params) { - BufferChecks.checkDirect(params); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glGetObjectParameterfvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); nglGetObjectParameterfvARB(obj, pname, params, params.position(), function_pointer); } private static native void nglGetObjectParameterfvARB(int obj, int pname, FloatBuffer params, int params_position, long function_pointer); public static void glUniformMatrix4ARB(int location, boolean transpose, FloatBuffer matrices) { - BufferChecks.checkDirect(matrices); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniformMatrix4fvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); nglUniformMatrix4fvARB(location, (matrices.remaining()) >> 4, transpose, matrices, matrices.position(), function_pointer); } private static native void nglUniformMatrix4fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); public static void glUniformMatrix3ARB(int location, boolean transpose, FloatBuffer matrices) { - BufferChecks.checkDirect(matrices); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniformMatrix3fvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); nglUniformMatrix3fvARB(location, (matrices.remaining()) / (3 * 3), transpose, matrices, matrices.position(), function_pointer); } private static native void nglUniformMatrix3fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); public static void glUniformMatrix2ARB(int location, boolean transpose, FloatBuffer matrices) { - BufferChecks.checkDirect(matrices); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniformMatrix2fvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(matrices); nglUniformMatrix2fvARB(location, (matrices.remaining()) >> 2, transpose, matrices, matrices.position(), function_pointer); } private static native void nglUniformMatrix2fvARB(int location, int count, boolean transpose, FloatBuffer matrices, int matrices_position, long function_pointer); public static void glUniform4ARB(int location, IntBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform4ivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform4ivARB(location, (values.remaining()) >> 2, values, values.position(), function_pointer); } private static native void nglUniform4ivARB(int location, int count, IntBuffer values, int values_position, long function_pointer); public static void glUniform3ARB(int location, IntBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform3ivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform3ivARB(location, (values.remaining()) / 3, values, values.position(), function_pointer); } private static native void nglUniform3ivARB(int location, int count, IntBuffer values, int values_position, long function_pointer); public static void glUniform2ARB(int location, IntBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform2ivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform2ivARB(location, (values.remaining()) >> 1, values, values.position(), function_pointer); } private static native void nglUniform2ivARB(int location, int count, IntBuffer values, int values_position, long function_pointer); public static void glUniform1ARB(int location, IntBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform1ivARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform1ivARB(location, (values.remaining()), values, values.position(), function_pointer); } private static native void nglUniform1ivARB(int location, int count, IntBuffer values, int values_position, long function_pointer); public static void glUniform4ARB(int location, FloatBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform4fvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform4fvARB(location, (values.remaining()) >> 2, values, values.position(), function_pointer); } private static native void nglUniform4fvARB(int location, int count, FloatBuffer values, int values_position, long function_pointer); public static void glUniform3ARB(int location, FloatBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform3fvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform3fvARB(location, (values.remaining()) / 3, values, values.position(), function_pointer); } private static native void nglUniform3fvARB(int location, int count, FloatBuffer values, int values_position, long function_pointer); public static void glUniform2ARB(int location, FloatBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform2fvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform2fvARB(location, (values.remaining()) >> 1, values, values.position(), function_pointer); } private static native void nglUniform2fvARB(int location, int count, FloatBuffer values, int values_position, long function_pointer); public static void glUniform1ARB(int location, FloatBuffer values) { - BufferChecks.checkDirect(values); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glUniform1fvARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(values); nglUniform1fvARB(location, (values.remaining()), values, values.position(), function_pointer); } private static native void nglUniform1fvARB(int location, int count, FloatBuffer values, int values_position, long function_pointer); @@ -334,9 +334,9 @@ * @param string */ public static void glShaderSourceARB(int shader, ByteBuffer string) { - BufferChecks.checkDirect(string); long function_pointer = GLContext.getCapabilities().ARB_shader_objects_glShaderSourceARB_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(string); nglShaderSourceARB(shader, 1, string, string.position(), (string.remaining()), function_pointer); } private static native void nglShaderSourceARB(int shader, int count, ByteBuffer string, int string_position, int length, long function_pointer); Index: NVFence.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/NVFence.java,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- NVFence.java 16 Feb 2005 16:04:21 -0000 1.12 +++ NVFence.java 21 Mar 2005 08:27:42 -0000 1.13 @@ -17,9 +17,9 @@ static native void initNativeStubs() throws LWJGLException; public static void glGetFenceivNV(int fence, int pname, IntBuffer piParams) { - BufferChecks.checkBuffer(piParams, 4); long function_pointer = GLContext.getCapabilities().NV_fence_glGetFenceivNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(piParams, 4); nglGetFenceivNV(fence, pname, piParams, piParams.position(), function_pointer); } private static native void nglGetFenceivNV(int fence, int pname, IntBuffer piParams, int piParams_position, long function_pointer); @@ -55,17 +55,17 @@ private static native void nglSetFenceNV(int fence, int condition, long function_pointer); public static void glDeleteFencesNV(IntBuffer piFences) { - BufferChecks.checkDirect(piFences); long function_pointer = GLContext.getCapabilities().NV_fence_glDeleteFencesNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(piFences); nglDeleteFencesNV((piFences.remaining()), piFences, piFences.position(), function_pointer); } private static native void nglDeleteFencesNV(int n, IntBuffer piFences, int piFences_position, long function_pointer); public static void glGenFencesNV(IntBuffer piFences) { - BufferChecks.checkDirect(piFences); long function_pointer = GLContext.getCapabilities().NV_fence_glGenFencesNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(piFences); nglGenFencesNV((piFences.remaining()), piFences, piFences.position(), function_pointer); } private static native void nglGenFencesNV(int n, IntBuffer piFences, int piFences_position, long function_pointer); Index: NVProgram.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/NVProgram.java,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- NVProgram.java 16 Feb 2005 16:04:22 -0000 1.13 +++ NVProgram.java 21 Mar 2005 08:27:42 -0000 1.14 @@ -17,20 +17,20 @@ static native void initNativeStubs() throws LWJGLException; public static void glRequestResidentProgramsNV(IntBuffer programIDs) { - BufferChecks.checkDirect(programIDs); long function_pointer = GLContext.getCapabilities().NV_program_glRequestResidentProgramsNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(programIDs); nglRequestResidentProgramsNV((programIDs.remaining()), programIDs, programIDs.position(), function_pointer); } private static native void nglRequestResidentProgramsNV(int n, IntBuffer programIDs, int programIDs_position, long function_pointer); public static boolean glAreProgramsResidentNV(IntBuffer programIDs, ByteBuffer programResidences) { - BufferChecks.checkDirect(programIDs); - BufferChecks.checkDirect(programResidences); if (programIDs.remaining() != programResidences.remaining()) throw new IllegalArgumentException("programIDs.remaining() != programResidences.remaining()"); long function_pointer = GLContext.getCapabilities().NV_program_glAreProgramsResidentNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(programIDs); + BufferChecks.checkDirect(programResidences); boolean __result = nglAreProgramsResidentNV((programIDs.remaining()), programIDs, programIDs.position(), programResidences, programResidences.position(), function_pointer); return __result; } @@ -45,33 +45,33 @@ private static native boolean nglIsProgramNV(int programID, long function_pointer); public static void glGetProgramStringNV(int programID, int parameterName, ByteBuffer paramString) { - BufferChecks.checkDirect(paramString); long function_pointer = GLContext.getCapabilities().NV_program_glGetProgramStringNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(paramString); nglGetProgramStringNV(programID, parameterName, paramString, paramString.position(), function_pointer); } private static native void nglGetProgramStringNV(int programID, int parameterName, Buffer paramString, int paramString_position, long function_pointer); public static void glGetProgramNV(int programID, int parameterName, IntBuffer params) { - BufferChecks.checkDirect(params); long function_pointer = GLContext.getCapabilities().NV_program_glGetProgramivNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(params); nglGetProgramivNV(programID, parameterName, params, params.position(), function_pointer); } private static native void nglGetProgramivNV(int programID, int parameterName, IntBuffer params, int params_position, long function_pointer); public static void glGenProgramsNV(IntBuffer programs) { - BufferChecks.checkDirect(programs); long function_pointer = GLContext.getCapabilities().NV_program_glGenProgramsNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(programs); nglGenProgramsNV((programs.remaining()), programs, programs.position(), function_pointer); } private static native void nglGenProgramsNV(int n, IntBuffer programs, int programs_position, long function_pointer); public static void glDeleteProgramsNV(IntBuffer programs) { - BufferChecks.checkDirect(programs); long function_pointer = GLContext.getCapabilities().NV_program_glDeleteProgramsNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(programs); nglDeleteProgramsNV((programs.remaining()), programs, programs.position(), function_pointer); } private static native void nglDeleteProgramsNV(int n, IntBuffer programs, int programs_position, long function_pointer); @@ -84,9 +84,9 @@ private static native void nglBindProgramNV(int target, int programID, long function_pointer); public static void glLoadProgramNV(int target, int programID, ByteBuffer string) { - BufferChecks.checkDirect(string); long function_pointer = GLContext.getCapabilities().NV_program_glLoadProgramNV_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkDirect(string); nglLoadProgramNV(target, programID, (string.remaining()), string, string.position(), function_pointer); } private static native void nglLoadProgramNV(int target, int programID, int length, Buffer string, int string_position, long function_pointer); Index: GL13.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/opengl/GL13.java,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- GL13.java 16 Feb 2005 21:46:02 -0000 1.19 +++ GL13.java 21 Mar 2005 08:27:41 -0000 1.20 @@ -117,17 +117,17 @@ private static native void nglSampleCoverage(float value, boolean invert, long function_pointer); public static void glMultTransposeMatrix(FloatBuffer m) { - BufferChecks.checkBuffer(m, 16); long function_pointer = GLContext.getCapabilities().GL13_glMultTransposeMatrixf_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(m, 16); nglMultTransposeMatrixf(m, m.position(), function_pointer); } private static native void nglMultTransposeMatrixf(FloatBuffer m, int m_position, long function_pointer); public static void glLoadTransposeMatrix(FloatBuffer m) { - BufferChecks.checkBuffer(m, 16); long function_pointer = GLContext.getCapabilities().GL13_glLoadTransposeMatrixf_pointer; BufferChecks.checkFunctionAddress(function_pointer); + BufferChecks.checkBuffer(m, 16); nglLoadTransposeMatrixf(m, m.position(), function_pointer); } private static native void nglLoadTransposeMatrixf(FloatBuffer m, int m_position, long function_pointer); @@ -161,253 +161,253 @@ private static native void nglMultiTexCoord1f(int target, float s, long function_pointer); public static void glGetCompressedTexImage(int target, int lod, ByteBuffer img) { - GLBufferChecks.ensurePackPBOdisabled(); - BufferChecks.checkDirect(img); long function_pointer = GLContext.getCapabilities().GL13_glGetCompressedTexImage_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensurePackPBOdisabled(); + BufferChecks.checkDirect(img); nglGetCompressedTexImage(target, lod, img, img.position(), function_pointer); } public static void glGetCompressedTexImage(int target, int lod, IntBuffer img) { - GLBufferChecks.ensurePackPBOdisabled(); - BufferChecks.checkDirect(img); long function_pointer = GLContext.getCapabilities().GL13_glGetCompressedTexImage_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensurePackPBOdisabled(); + BufferChecks.checkDirect(img); nglGetCompressedTexImage(target, lod, img, img.position() << 2, function_pointer); } public static void glGetCompressedTexImage(int target, int lod, ShortBuffer img) { - GLBufferChecks.ensurePackPBOdisabled(); - BufferChecks.checkDirect(img); long function_pointer = GLContext.getCapabilities().GL13_glGetCompressedTexImage_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensurePackPBOdisabled(); + BufferChecks.checkDirect(img); nglGetCompressedTexImage(target, lod, img, img.position() << 1, function_pointer); } private static native void nglGetCompressedTexImage(int target, int lod, Buffer img, int img_position, long function_pointer); public static void glGetCompressedTexImage(int target, int lod, int img_buffer_offset) { - GLBufferChecks.ensurePackPBOenabled(); long function_pointer = GLContext.getCapabilities().GL13_glGetCompressedTexImage_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensurePackPBOenabled(); nglGetCompressedTexImageBO(target, lod, img_buffer_offset, function_pointer); } private static native void nglGetCompressedTexImageBO(int target, int lod, int img_buffer_offset, long function_pointer); public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ByteBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage3D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position(), function_pointer); } public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, FloatBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage3D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2, function_pointer); } public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, IntBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage3D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 2, function_pointer); } public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, ShortBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage3D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage3D(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data, data.position() << 1, function_pointer); } private static native void nglCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, Buffer data, int data_position, long function_pointer); public static void glCompressedTexSubImage3D(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, int data_buffer_offset) { - GLBufferChecks.ensureUnpackPBOenabled(); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage3D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOenabled(); nglCompressedTexSubImage3DBO(target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data_buffer_offset, function_pointer); } private static native void nglCompressedTexSubImage3DBO(int target, int level, int xoffset, int yoffset, int zoffset, int width, int height, int depth, int format, int imageSize, int data_buffer_offset, long function_pointer); public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ByteBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position(), function_pointer); } public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, FloatBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2, function_pointer); } public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, IntBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 2, function_pointer); } public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, ShortBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage2D(target, level, xoffset, yoffset, width, height, format, imageSize, data, data.position() << 1, function_pointer); } private static native void nglCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, Buffer data, int data_position, long function_pointer); public static void glCompressedTexSubImage2D(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, int data_buffer_offset) { - GLBufferChecks.ensureUnpackPBOenabled(); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage2D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOenabled(); nglCompressedTexSubImage2DBO(target, level, xoffset, yoffset, width, height, format, imageSize, data_buffer_offset, function_pointer); } private static native void nglCompressedTexSubImage2DBO(int target, int level, int xoffset, int yoffset, int width, int height, int format, int imageSize, int data_buffer_offset, long function_pointer); public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ByteBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position(), function_pointer); } public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, FloatBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2, function_pointer); } public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, IntBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, data, data.position() << 2, function_pointer); } public static void glCompressedTexSubImage1D(int target, int level, int xoffset, int width, int format, int imageSize, ShortBuffer data) { - GLBufferChecks.ensureUnpackPBOdisabled(); - BufferChecks.checkDirect(data); long function_pointer = GLContext.getCapabilities().GL13_glCompressedTexSubImage1D_pointer; BufferChecks.checkFunctionAddress(function_pointer); + GLChecks.ensureUnpackPBOdisabled(); + BufferChecks.checkDirect(data); nglCompressedTexSubImage1D(target, level, xoffset, width, format, imageSize, d... [truncated message content] |
|
From: Elias N. <eli...@us...> - 2005-03-21 08:28:24
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23539/src/java/org/lwjgl/test/input Modified Files: MouseTest.java Log Message: Implemented strong references in glVertexPointer and friends Index: MouseTest.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/test/input/MouseTest.java,v retrieving revision 1.42 retrieving revision 1.43 diff -u -d -r1.42 -r1.43 --- MouseTest.java 7 Dec 2004 21:56:07 -0000 1.42 +++ MouseTest.java 21 Mar 2005 08:27:43 -0000 1.43 @@ -63,7 +63,7 @@ /** Height of window */ private static int WINDOW_HEIGHT = 640; - /** Triangle size (in ½) */ + /** Triangle size */ private Vector2f triangleSize = new Vector2f(120, 100); /** Triangle color */ |
|
From: Elias N. <eli...@us...> - 2005-03-21 08:28:23
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23539 Modified Files: build.xml Log Message: Implemented strong references in glVertexPointer and friends Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.72 retrieving revision 1.73 diff -u -d -r1.72 -r1.73 --- build.xml 16 Mar 2005 21:18:39 -0000 1.72 +++ build.xml 21 Mar 2005 08:27:38 -0000 1.73 @@ -206,7 +206,7 @@ </javac> </target> - <target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities" description="Generates java and native source"/> + <target name="generate-all" depends="generate-openal, generate-opengl, generate-opengl-capabilities, generate-opengl-references" description="Generates java and native source"/> <target name="generate-openal" depends="generators" description="Generates java and native source for AL"> <!-- Generate OpenAL --> @@ -350,6 +350,20 @@ </apply> </target> + <target name="generate-opengl-references" depends="generators" description="Generates java and native source for GL"> + <!-- Generate context capabilities --> + <apply executable="apt" parallel="true"> + <arg value="-nocompile"/> + <arg value="-factory"/> + <arg value="org.lwjgl.util.generator.ReferencesGeneratorProcessorFactory"/> + <arg value="-cp"/> + <arg path="${lwjgl.src}/java:${lwjgl.src.templates}:${lwjgl.bin}:${java.class.path}"/> + <arg value="-s"/> + <arg path="${lwjgl.src}/java"/> + <fileset dir="${lwjgl.src.templates}" includes="org/lwjgl/opengl/*.java"/> + </apply> + </target> + <target name="generate-opengl-capabilities" depends="generators" description="Generates java and native source for GL"> <!-- Generate context capabilities --> <apply executable="apt" parallel="true"> @@ -465,7 +479,7 @@ <include name="build.sh" /> </fileset> </apply> - <move file="${lwjgl.src.native}/.libs/liblwjgl.0.0.0" tofile="${lwjgl.lib}/liblwjgl.so" /> + <move file="${lwjgl.src.native}/linux/liblwjgl.so" tofile="${lwjgl.lib}/liblwjgl.so" /> </target> <!-- Compiles LWJGL on Mac OS X platforms --> |
|
From: Elias N. <eli...@us...> - 2005-03-21 08:27:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23539/src/java/org/lwjgl/util/generator Modified Files: ContextCapabilitiesGenerator.java ContextGeneratorProcessorFactory.java GeneratorVisitor.java JavaMethodsGenerator.java Utils.java Added Files: ReferencesGeneratorProcessorFactory.java Log Message: Implemented strong references in glVertexPointer and friends Index: ContextGeneratorProcessorFactory.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/ContextGeneratorProcessorFactory.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ContextGeneratorProcessorFactory.java 20 Feb 2005 19:28:32 -0000 1.1 +++ ContextGeneratorProcessorFactory.java 21 Mar 2005 08:27:43 -0000 1.2 @@ -54,8 +54,7 @@ /** * $Id$ * - * Generator tool for creating the java classes and native code - * from an annotated template java interface. + * Generator tool for creating the ContexCapabilities class * * @author elias_naur <eli...@us...> * @version $Revision$ Index: GeneratorVisitor.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/GeneratorVisitor.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- GeneratorVisitor.java 20 Feb 2005 19:28:31 -0000 1.1 +++ GeneratorVisitor.java 21 Mar 2005 08:27:43 -0000 1.2 @@ -138,6 +138,8 @@ throw new RuntimeException(param + " has no Check, Result nor Constant annotation and no other parameters has" + " an @AutoSize annotation on it in method " + method); } + if (param.getAnnotation(CachedReference.class) != null && param.getAnnotation(Result.class) != null) + throw new RuntimeException(param + " can't be annotated with both CachedReference and Result"); if (param.getAnnotation(BufferObject.class) != null && param.getAnnotation(Result.class) != null) throw new RuntimeException(param + " can't be annotated with both BufferObject and Result"); if (param.getAnnotation(Constant.class) != null) @@ -145,6 +147,8 @@ } else { if (param.getAnnotation(BufferObject.class) != null) throw new RuntimeException(param + " type is not a buffer, but annotated as a BufferObject"); + if (param.getAnnotation(CachedReference.class) != null) + throw new RuntimeException(param + " type is not a buffer, but annotated as a CachedReference"); } } } Index: Utils.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/Utils.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- Utils.java 20 Feb 2005 19:28:32 -0000 1.1 +++ Utils.java 21 Mar 2005 08:27:44 -0000 1.2 @@ -51,6 +51,7 @@ public static final String TYPEDEF_POSTFIX = "PROC"; public static final String FUNCTION_POINTER_VAR_NAME = "function_pointer"; public static final String FUNCTION_POINTER_POSTFIX = "_pointer"; + public static final String CHECKS_CLASS_NAME = "GLChecks"; public static final String CONTEXT_CAPS_CLASS_NAME = "ContextCapabilities"; public static final String STUB_INITIALIZER_NAME = "initNativeStubs"; public static final String BUFFER_OBJECT_METHOD_POSTFIX = "BO"; @@ -92,6 +93,10 @@ return annotation_list; } + public static String getReferenceName(InterfaceDeclaration interface_decl, MethodDeclaration method, ParameterDeclaration param) { + return interface_decl.getSimpleName() + "_" + method.getSimpleName() + "_" + param.getSimpleName(); + } + public static boolean isAddressableType(TypeMirror type) { return isAddressableType(getJavaType(type)); } Index: ContextCapabilitiesGenerator.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/ContextCapabilitiesGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- ContextCapabilitiesGenerator.java 20 Feb 2005 19:28:32 -0000 1.1 +++ ContextCapabilitiesGenerator.java 21 Mar 2005 08:27:43 -0000 1.2 @@ -64,7 +64,7 @@ public static void generateClassPrologue(PrintWriter writer, boolean context_specific) { writer.println("public class " + Utils.CONTEXT_CAPS_CLASS_NAME + " {"); - writer.println("\tfinal BufferObjectTracker tracker;"); + writer.println("\tfinal StateTracker tracker;"); writer.println(); if (!context_specific) { writer.println("\tprivate static boolean " + STUBS_LOADED_NAME + " = false;"); @@ -74,7 +74,7 @@ public static void generateInitializerPrologue(PrintWriter writer) { writer.println("\t" + Utils.CONTEXT_CAPS_CLASS_NAME + "() throws LWJGLException {"); writer.println("\t\tSet " + CACHED_EXTS_VAR_NAME + " = " + ALL_INIT_METHOD_NAME + "();"); - writer.println("\t\ttracker = new BufferObjectTracker();"); + writer.println("\t\ttracker = new StateTracker();"); } private static String translateFieldName(String interface_name) { --- NEW FILE: ReferencesGeneratorProcessorFactory.java --- /* * Copyright (c) 2002-2004 LWJGL Project * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are * met: * * * Redistributions of source code must retain the above copyright * notice, this list of conditions and the following disclaimer. * * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. * * * Neither the name of 'LWJGL' nor the names of * its contributors may be used to endorse or promote products derived * from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ package org.lwjgl.util.generator; import com.sun.mirror.apt.*; import com.sun.mirror.declaration.*; import com.sun.mirror.type.*; import com.sun.mirror.util.*; import java.util.Collection; import java.util.Collections; import java.util.Set; import java.util.Iterator; import java.util.Map; import java.util.Arrays; import java.io.PrintWriter; import java.io.IOException; import java.io.File; import static java.util.Collections.*; import static com.sun.mirror.util.DeclarationVisitors.*; /** * $Id: ReferencesGeneratorProcessorFactory.java,v 1.1 2005/03/21 08:27:43 elias_naur Exp $ * * Generator tool for creating the References class * * @author elias_naur <eli...@us...> * @version $Revision: 1.1 $ */ public class ReferencesGeneratorProcessorFactory implements AnnotationProcessorFactory, RoundCompleteListener { private final static String REFERENCES_CLASS_NAME = "References"; private final static String REFERENCES_PARAMETER_NAME = "references"; private static boolean first_round = true; // Process any set of annotations private static final Collection<String> supportedAnnotations = unmodifiableCollection(Arrays.asList("*")); public Collection<String> supportedAnnotationTypes() { return supportedAnnotations; } public Collection<String> supportedOptions() { return emptyList(); } public void roundComplete(RoundCompleteEvent event) { first_round = false; } public AnnotationProcessor getProcessorFor(Set<AnnotationTypeDeclaration> atds, AnnotationProcessorEnvironment env) { // Only process the initial types, not the generated ones if (first_round) { env.addListener(this); return new GeneratorProcessor(env); } else return AnnotationProcessors.NO_OP; } private static class GeneratorProcessor implements AnnotationProcessor { private final AnnotationProcessorEnvironment env; GeneratorProcessor(AnnotationProcessorEnvironment env) { this.env = env; } public void process() { try { generateReferencesSource(); } catch (IOException e) { throw new RuntimeException(e); } } private static void generateCopiesFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) { for (ParameterDeclaration param : method.getParameters()) { CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class); if (cached_reference_annotation != null) { Class nio_type = Utils.getNIOBufferType(param.getType()); String reference_name = Utils.getReferenceName(interface_decl, method, param); writer.print("\t\tthis." + reference_name + " = "); writer.println(REFERENCES_PARAMETER_NAME + "." + reference_name + ";"); } } } private static void generateCopiesFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) { for (MethodDeclaration method : interface_decl.getMethods()) { generateCopiesFromParameters(writer, interface_decl, method); } } private static void generateReferencesFromParameters(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method) { for (ParameterDeclaration param : method.getParameters()) { CachedReference cached_reference_annotation = param.getAnnotation(CachedReference.class); if (cached_reference_annotation != null) { Class nio_type = Utils.getNIOBufferType(param.getType()); if (nio_type == null) throw new RuntimeException(param + " in method " + method + " in " + interface_decl + " is annotated with " + cached_reference_annotation.annotationType().getSimpleName() + " but the parameter is not a NIO buffer"); writer.print("\t" + nio_type.getName() + " " + Utils.getReferenceName(interface_decl, method, param)); writer.println(";"); } } } private static void generateReferencesFromMethods(PrintWriter writer, InterfaceDeclaration interface_decl) { for (MethodDeclaration method : interface_decl.getMethods()) { generateReferencesFromParameters(writer, interface_decl, method); } } private void generateReferencesSource() throws IOException { PrintWriter writer = env.getFiler().createSourceFile("org.lwjgl.opengl." + REFERENCES_CLASS_NAME); writer.println("/* MACHINE GENERATED FILE, DO NOT EDIT */"); writer.println(); writer.println("package org.lwjgl.opengl;"); writer.println(); writer.println("class " + REFERENCES_CLASS_NAME + " {"); DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class); Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations()); for (TypeDeclaration typedecl : interface_decls) { InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl; generateReferencesFromMethods(writer, interface_decl); } writer.println(); writer.println("\tvoid copy(" + REFERENCES_CLASS_NAME + " " + REFERENCES_PARAMETER_NAME + ") {"); for (TypeDeclaration typedecl : interface_decls) { InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl; generateCopiesFromMethods(writer, interface_decl); } writer.println("\t}"); writer.println("}"); writer.close(); } } } Index: JavaMethodsGenerator.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- JavaMethodsGenerator.java 20 Feb 2005 19:28:32 -0000 1.1 +++ JavaMethodsGenerator.java 21 Mar 2005 08:27:43 -0000 1.2 @@ -153,7 +153,7 @@ private static void printBufferObjectCheck(PrintWriter writer, BufferKind kind, Mode mode) { String bo_check_method_name = kind.toString(); - writer.print("\t\tGLBufferChecks.ensure" + bo_check_method_name); + writer.print("\t\t" + Utils.CHECKS_CLASS_NAME + ".ensure" + bo_check_method_name); if (mode == Mode.BUFFEROBJECT) writer.print("enabled"); else @@ -184,8 +184,6 @@ generateParametersJava(writer, method, typeinfos_instance, false, mode); TypeMirror result_type = Utils.getMethodReturnType(method); writer.println(") {"); - printBufferObjectChecks(writer, method, mode); - printParameterChecks(writer, method, mode); Code code_annotation = method.getAnnotation(Code.class); if (code_annotation != null) writer.println(code_annotation.value()); @@ -195,6 +193,9 @@ writer.print("\t\tBufferChecks.checkFunctionAddress("); writer.println(Utils.FUNCTION_POINTER_VAR_NAME + ");"); } + printBufferObjectChecks(writer, method, mode); + printParameterChecks(writer, method, mode); + printParameterCaching(writer, interface_decl, method, mode); writer.print("\t\t"); boolean has_result = !result_type.equals(env.getTypeUtils().getVoidType()); if (has_result) { @@ -391,6 +392,20 @@ return first_parameter; } + private static void printParameterCaching(PrintWriter writer, InterfaceDeclaration interface_decl, MethodDeclaration method, Mode mode) { + for (ParameterDeclaration param : method.getParameters()) { + Class java_type = Utils.getJavaType(param.getType()); + if (Buffer.class.isAssignableFrom(java_type) && + param.getAnnotation(CachedReference.class) != null && + (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) && + param.getAnnotation(Result.class) == null) { + writer.print("\t\t" + Utils.CHECKS_CLASS_NAME + ".getReferences()."); + writer.print(Utils.getReferenceName(interface_decl, method, param) + " = "); + writer.println(param.getSimpleName() + ";"); + } + } + } + private static void printParameterChecks(PrintWriter writer, MethodDeclaration method, Mode mode) { for (ParameterDeclaration param : method.getParameters()) { Class java_type = Utils.getJavaType(param.getType()); |
|
From: Elias N. <eli...@us...> - 2005-03-21 08:27:58
|
Update of /cvsroot/java-game-lib/LWJGL/src/native In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23539/src/native Modified Files: build.sh Log Message: Implemented strong references in glVertexPointer and friends Index: build.sh =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/build.sh,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- build.sh 21 Jul 2004 09:25:53 -0000 1.6 +++ build.sh 21 Mar 2005 08:27:44 -0000 1.7 @@ -1,6 +1,4 @@ #!/bin/bash -./autogen.sh -./configure +cd linux make -strip .libs/liblwjgl.0.0.0 |
Update of /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23539/src/templates/org/lwjgl/opengl Modified Files: ARB_buffer_object.java ARB_imaging.java ARB_matrix_palette.java ARB_vertex_blend.java ARB_vertex_program.java ATI_element_array.java EXT_fog_coord.java EXT_paletted_texture.java EXT_secondary_color.java EXT_vertex_shader.java EXT_vertex_weighting.java GL11.java GL12.java GL14.java GL15.java GL20.java NV_vertex_program.java Log Message: Implemented strong references in glVertexPointer and friends Index: ARB_buffer_object.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- ARB_buffer_object.java 20 Feb 2005 20:53:49 -0000 1.4 +++ ARB_buffer_object.java 21 Mar 2005 08:27:44 -0000 1.5 @@ -66,9 +66,9 @@ int GL_BUFFER_MAPPED_ARB = 0x88BC; int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; - @Code( " BufferObjectTracker.bindBuffer(target, buffer);") + @Code( " StateTracker.bindBuffer(target, buffer);") void glBindBufferARB(@GLenum int target, @GLuint int buffer); - @Code( " BufferObjectTracker.deleteBuffers(buffers);") + @Code( " StateTracker.deleteBuffers(buffers);") void glDeleteBuffersARB(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers); void glGenBuffersARB(@AutoSize("buffers") int n, @GLuint IntBuffer buffers); boolean glIsBufferARB(@GLuint int buffer); Index: ATI_element_array.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/ATI_element_array.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ATI_element_array.java 20 Feb 2005 20:53:49 -0000 1.3 +++ ATI_element_array.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -41,6 +41,7 @@ int GL_ELEMENT_ARRAY_POINTER_ATI = 0x876A; void glElementPointerATI(@AutoType("pPointer") @GLenum int type, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const Index: GL15.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/GL15.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GL15.java 20 Feb 2005 20:53:49 -0000 1.3 +++ GL15.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -72,9 +72,9 @@ int GL_BUFFER_MAPPED = 0x88BC; int GL_BUFFER_MAP_POINTER = 0x88BD; - @Code( " BufferObjectTracker.bindBuffer(target, buffer);") + @Code( " StateTracker.bindBuffer(target, buffer);") void glBindBuffer(@GLenum int target, @GLuint int buffer); - @Code( " BufferObjectTracker.deleteBuffers(buffers);") + @Code( " StateTracker.deleteBuffers(buffers);") void glDeleteBuffers(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers); void glGenBuffers(@AutoSize("buffers") @GLsizei int n, @GLuint IntBuffer buffers); Index: GL20.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/GL20.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- GL20.java 11 Mar 2005 16:16:27 -0000 1.4 +++ GL20.java 21 Mar 2005 08:27:45 -0000 1.5 @@ -272,6 +272,7 @@ void glVertexAttrib4Nub(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w); void glVertexAttribPointer(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const Index: EXT_paletted_texture.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/EXT_paletted_texture.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EXT_paletted_texture.java 20 Feb 2005 20:53:49 -0000 1.3 +++ EXT_paletted_texture.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -66,7 +66,7 @@ int GL_TEXTURE_INDEX_SIZE_EXT = 0x80ED; void glColorTableEXT(@GLenum int target, @GLenum int internalFormat, @GLsizei int width, @GLenum int format, @GLenum int type, - @Check("GLBufferChecks.calculateImageStorage(data, format, type, width, 1, 1)") + @Check("GLChecks.calculateImageStorage(data, format, type, width, 1, 1)") @Const @GLbyte @GLshort @@ -75,7 +75,7 @@ Buffer data); void glColorSubTableEXT(@GLenum int target, @GLsizei int start, @GLsizei int count, @GLenum int format, @GLenum int type, - @Check("GLBufferChecks.calculateImageStorage(data, format, type, count, 1, 1)") + @Check("GLChecks.calculateImageStorage(data, format, type, count, 1, 1)") @Const @GLbyte @GLshort Index: ARB_matrix_palette.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ARB_matrix_palette.java 20 Feb 2005 20:53:49 -0000 1.3 +++ ARB_matrix_palette.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -53,6 +53,7 @@ void glCurrentPaletteMatrixARB(int index); void glMatrixIndexPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @GLubyte Index: GL14.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/GL14.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GL14.java 20 Feb 2005 20:53:49 -0000 1.3 +++ GL14.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -93,6 +93,7 @@ void glFogCoordf(float coord); void glFogCoordPointer(@AutoType("data") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const Index: EXT_vertex_weighting.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EXT_vertex_weighting.java 20 Feb 2005 20:53:49 -0000 1.3 +++ EXT_vertex_weighting.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -53,6 +53,7 @@ void glVertexWeightfEXT(float weight); void glVertexWeightPointerEXT(@GLsizei int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const Index: EXT_secondary_color.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EXT_secondary_color.java 20 Feb 2005 20:53:49 -0000 1.3 +++ EXT_secondary_color.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -51,6 +51,7 @@ void glSecondaryColor3ubEXT(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue); void glSecondaryColorPointerEXT(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @GLbyte Index: EXT_vertex_shader.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EXT_vertex_shader.java 20 Feb 2005 20:53:49 -0000 1.3 +++ EXT_vertex_shader.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -216,6 +216,7 @@ void glVariantuivEXT(@GLuint int id, @Check("4") @GLuint IntBuffer pAddr); void glVariantPointerEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type, @GLuint int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @GLbyte Index: ARB_vertex_program.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ARB_vertex_program.java 20 Feb 2005 20:53:49 -0000 1.3 +++ ARB_vertex_program.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -106,6 +106,7 @@ void glVertexAttrib4NubARB(@GLuint int index, @GLubyte byte x, @GLubyte byte y, @GLubyte byte z, @GLubyte byte w); void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const Index: GL11.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/GL11.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GL11.java 20 Feb 2005 20:53:49 -0000 1.3 +++ GL11.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -754,6 +754,7 @@ void glCopyPixels(int x, int y, int width, int height, int type); void glColorPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride, + @CachedReference @Check @BufferObject(BufferKind.ArrayVBO) @Const @@ -785,11 +786,17 @@ void glDisableClientState(@GLenum int cap); void glEnable(@GLenum int cap); void glDisable(@GLenum int cap); - void glEdgeFlagPointer(int stride, @BufferObject(BufferKind.ArrayVBO) @Check @Const @GLbyte Buffer pointer); + void glEdgeFlagPointer(int stride, + @CachedReference + @BufferObject(BufferKind.ArrayVBO) + @Check + @Const + @GLbyte + Buffer pointer); void glEdgeFlag(boolean flag); void glDrawPixels(@GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type, - @Check("GLBufferChecks.calculateImageStorage(pixels, format, type, width, height, 1)") + @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)") @BufferObject(BufferKind.UnpackPBO) @Const @GLbyte @@ -898,7 +905,7 @@ void glGetTexImage(@GLenum int target, int level, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.PackPBO) - @Check("GLBufferChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)") + @Check("GLChecks.calculateImageStorage(pixels, format, type, 1, 1, 1)") @GLbyte @GLshort @GLint @@ -988,6 +995,7 @@ void glOrtho(double left, double right, double bottom, double top, double zNear, double zFar); void glNormalPointer(@AutoType("pointer") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const @@ -1007,7 +1015,7 @@ void glShadeModel(@GLenum int mode); - void glSelectBuffer(@AutoSize("buffer") @GLsizei int size, @GLuint IntBuffer buffer); + void glSelectBuffer(@AutoSize("buffer") @GLsizei int size, @CachedReference @GLuint IntBuffer buffer); void glScissor(int x, int y, @GLsizei int width, @GLsizei int height); void glScalef(float x, float y, float z); @@ -1018,7 +1026,7 @@ void glReadPixels(int x, int y, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.PackPBO) - @Check("GLBufferChecks.calculateImageStorage(pixels, format, type, width, height, 1)") + @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)") @GLbyte @GLshort @GLint @@ -1036,10 +1044,10 @@ void glPushMatrix(); void glPopMatrix(); - @Code( " BufferObjectTracker.pushAttrib(mask);") + @Code( " StateTracker.pushAttrib(mask);") void glPushClientAttrib(@GLbitfield int mask); - @Code( " BufferObjectTracker.popAttrib();") + @Code( " StateTracker.popAttrib();") void glPopClientAttrib(); void glPushAttrib(@GLbitfield int mask); @@ -1047,6 +1055,7 @@ void glStencilFunc(@GLenum int func, int ref, @GLuint int mask); void glVertexPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const @@ -1064,7 +1073,7 @@ void glTexImage1D(@GLenum int target, int level, int internalformat, @GLsizei int width, int border, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check(value="GLBufferChecks.calculateTexImage1DStorage(pixels, format, type, width, border)", canBeNull=true) + @Check(value="GLChecks.calculateTexImage1DStorage(pixels, format, type, width, border)", canBeNull=true) @Const @GLbyte @GLshort @@ -1074,7 +1083,7 @@ void glTexImage2D(@GLenum int target, int level, int internalformat, int width, int height, int border, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check(value="GLBufferChecks.calculateTexImage2DStorage(pixels, format, type, width, height, border)", canBeNull=true) + @Check(value="GLChecks.calculateTexImage2DStorage(pixels, format, type, width, height, border)", canBeNull=true) @Const @GLbyte @GLshort @@ -1083,7 +1092,7 @@ Buffer pixels); void glTexSubImage1D(@GLenum int target, int level, int xoffset, @GLsizei int width, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check("GLBufferChecks.calculateImageStorage(pixels, format, type, width, 1, 1)") + @Check("GLChecks.calculateImageStorage(pixels, format, type, width, 1, 1)") @Const @GLbyte @GLshort @@ -1092,7 +1101,7 @@ Buffer pixels); void glTexSubImage2D(@GLenum int target, int level, int xoffset, int yoffset, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check("GLBufferChecks.calculateImageStorage(pixels, format, type, width, height, 1)") + @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, 1)") @Const @GLbyte @GLshort @@ -1128,7 +1137,12 @@ void glTexEnviv(@GLenum int target, @GLenum int pname, @Check("4") @Const IntBuffer params); void glTexCoordPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride, - @BufferObject(BufferKind.ArrayVBO) @Check @Const @GLfloat Buffer pointer); + @CachedReference + @BufferObject(BufferKind.ArrayVBO) + @Check + @Const + @GLfloat + Buffer pointer); void glTexCoord1f(float s); void glTexCoord2f(float s, float t); Index: ARB_imaging.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/ARB_imaging.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ARB_imaging.java 20 Feb 2005 20:53:49 -0000 1.3 +++ ARB_imaging.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -203,7 +203,7 @@ void glConvolutionFilter1D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check("GLBufferChecks.calculateImageStorage(image, format, type, width, 1, 1)") + @Check("GLChecks.calculateImageStorage(image, format, type, width, 1, 1)") @GLbyte @GLshort @GLint @@ -212,7 +212,7 @@ void glConvolutionFilter2D(@GLenum int target, @GLenum int internalformat, @GLsizei int width, @GLsizei int height, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check("GLBufferChecks.calculateImageStorage(image, format, type, width, height, 1)") + @Check("GLChecks.calculateImageStorage(image, format, type, width, height, 1)") @GLbyte @GLshort @GLint Index: NV_vertex_program.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- NV_vertex_program.java 20 Feb 2005 20:53:49 -0000 1.3 +++ NV_vertex_program.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -220,6 +220,7 @@ void glTrackMatrixNV(@GLenum int target, @GLuint int address, @GLenum int matrix, @GLenum int transform); void glVertexAttribPointerNV(@GLuint int index, int size, @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const Index: GL12.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/GL12.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- GL12.java 20 Feb 2005 20:53:49 -0000 1.3 +++ GL12.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -99,7 +99,7 @@ void glTexImage3D(@GLenum int target, int level, int internalFormat, @GLsizei int width, @GLsizei int height, @GLsizei int depth, int border, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check(value="GLBufferChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth, border)", canBeNull=true) + @Check(value="GLChecks.calculateTexImage3DStorage(pixels, format, type, width, height, depth, border)", canBeNull=true) @Const @GLbyte @GLshort @@ -109,7 +109,7 @@ void glTexSubImage3D(@GLenum int target, int level, int xoffset, int yoffset, int zoffset, @GLsizei int width, @GLsizei int height, @GLsizei int depth, @GLenum int format, @GLenum int type, @BufferObject(BufferKind.UnpackPBO) - @Check("GLBufferChecks.calculateImageStorage(pixels, format, type, width, height, depth)") + @Check("GLChecks.calculateImageStorage(pixels, format, type, width, height, depth)") @Const @GLbyte @GLshort Index: EXT_fog_coord.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/EXT_fog_coord.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- EXT_fog_coord.java 20 Feb 2005 20:53:49 -0000 1.3 +++ EXT_fog_coord.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -48,6 +48,7 @@ void glFogCoordfEXT(float coord); void glFogCoordPointerEXT(@AutoType("data") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const Index: ARB_vertex_blend.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- ARB_vertex_blend.java 20 Feb 2005 20:53:49 -0000 1.3 +++ ARB_vertex_blend.java 21 Mar 2005 08:27:45 -0000 1.4 @@ -100,6 +100,7 @@ void glWeightuivARB(@AutoSize("pWeights") int size, @GLuint IntBuffer pWeights); void glWeightPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride, + @CachedReference @BufferObject(BufferKind.ArrayVBO) @Check @Const |
|
From: Brian M. <ma...@us...> - 2005-03-16 21:19:28
|
Update of /cvsroot/java-game-lib/LWJGL In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27724 Modified Files: build.xml Log Message: updated version string to 96 Index: build.xml =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/build.xml,v retrieving revision 1.71 retrieving revision 1.72 diff -u -d -r1.71 -r1.72 --- build.xml 16 Mar 2005 21:13:29 -0000 1.71 +++ build.xml 16 Mar 2005 21:18:39 -0000 1.72 @@ -13,7 +13,7 @@ <property name="lwjgl.docs" value="./doc" /> <property name="lwjgl.temp" value="./temp" /> <property name="lwjgl.res" value="./res" /> - <property name="lwjgl.version" value="0.95" /> + <property name="lwjgl.version" value="0.96" /> <!-- ================================================================== --> <!-- Filesets used for targets --> |
|
From: Brian M. <ma...@us...> - 2005-03-16 21:18:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27724/src/native/common/fmod3 Modified Files: org_lwjgl_fmod3_FMOD.c Log Message: updated version string to 96 Index: org_lwjgl_fmod3_FMOD.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/fmod3/org_lwjgl_fmod3_FMOD.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- org_lwjgl_fmod3_FMOD.c 25 Jan 2005 06:31:35 -0000 1.8 +++ org_lwjgl_fmod3_FMOD.c 16 Mar 2005 21:18:41 -0000 1.9 @@ -33,7 +33,7 @@ #include "org_lwjgl_fmod3_FMOD.h" #include "extfmod3.h" -static const char* VERSION = "0.95"; +static const char* VERSION = "0.96"; /** * Concatenate two strings |
|
From: Brian M. <ma...@us...> - 2005-03-16 21:18:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/native/common In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27724/src/native/common Modified Files: common_tools.c Log Message: updated version string to 96 Index: common_tools.c =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/native/common/common_tools.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- common_tools.c 21 Feb 2005 14:46:43 -0000 1.20 +++ common_tools.c 16 Mar 2005 21:18:41 -0000 1.21 @@ -48,7 +48,7 @@ #include "org_lwjgl_DefaultSysImplementation.h" static bool debug = false; -static const char* VERSION = "0.95"; +static const char* VERSION = "0.96"; static JavaVM *jvm; void initAttribList(attrib_list_t *list) { |
|
From: Brian M. <ma...@us...> - 2005-03-16 21:18:51
|
Update of /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3 In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27724/src/java/org/lwjgl/fmod3 Modified Files: FMOD.java Log Message: updated version string to 96 Index: FMOD.java =================================================================== RCS file: /cvsroot/java-game-lib/LWJGL/src/java/org/lwjgl/fmod3/FMOD.java,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- FMOD.java 25 Jan 2005 06:31:34 -0000 1.8 +++ FMOD.java 16 Mar 2005 21:18:40 -0000 1.9 @@ -200,7 +200,7 @@ private static String FMOD_OSX_LIBRARY_NAME = "fmod"; /** Version of FMOD */ - public static final String VERSION = "0.95"; + public static final String VERSION = "0.96"; static { initialize(); |