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
|
From: <eli...@us...> - 2007-05-27 05:20:00
|
Revision: 2828 http://svn.sourceforge.net/java-game-lib/?rev=2828&view=rev Author: elias_naur Date: 2007-05-26 22:19:19 -0700 (Sat, 26 May 2007) Log Message: ----------- Windows: Check for gl errors after setting swap interval Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/Sys.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c Modified: trunk/LWJGL/src/java/org/lwjgl/Sys.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/Sys.java 2007-05-22 22:30:21 UTC (rev 2827) +++ trunk/LWJGL/src/java/org/lwjgl/Sys.java 2007-05-27 05:19:19 UTC (rev 2828) @@ -57,7 +57,7 @@ private static final String VERSION = "1.1"; /** Current version of the JNI library */ - static final int JNI_VERSION = 9; + static final int JNI_VERSION = 10; /** The implementation instance to delegate platform specific behavior to */ private final static SysImplementation implementation; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2007-05-22 22:30:21 UTC (rev 2827) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsContextImplementation.java 2007-05-27 05:19:19 UTC (rev 2828) @@ -34,6 +34,7 @@ import java.nio.ByteBuffer; import org.lwjgl.LWJGLException; +import org.lwjgl.LWJGLUtil; /** * @@ -96,14 +97,12 @@ private static native boolean nIsCurrent(ByteBuffer context_handle) throws LWJGLException; public void setSwapInterval(int value) { - Context current_context = Context.getCurrentContext(); - if (current_context == null) - throw new IllegalStateException("No context is current"); - synchronized (current_context) { - nSetSwapInterval(current_context.getHandle(), value); - } + boolean success = nSetSwapInterval(value) == GL11.GL_TRUE ? true : false; + if (!success) + LWJGLUtil.log("Failed to set swap interval"); + Util.checkGLError(); } - private static native void nSetSwapInterval(ByteBuffer context_handle, int value); + private static native int nSetSwapInterval(int value); public void destroy(PeerInfo peer_info, ByteBuffer handle) throws LWJGLException { nDestroy(handle); Modified: trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c =================================================================== --- trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c 2007-05-22 22:30:21 UTC (rev 2827) +++ trunk/LWJGL/src/native/windows/org_lwjgl_opengl_WindowsContextImplementation.c 2007-05-27 05:19:19 UTC (rev 2828) @@ -105,8 +105,8 @@ return wglGetCurrentContext() == context_info->context; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval - (JNIEnv *env, jclass clazz, jobject context_handle, jint value) { +JNIEXPORT jint JNICALL Java_org_lwjgl_opengl_WindowsContextImplementation_nSetSwapInterval + (JNIEnv *env, jclass clazz, jint value) { WGLExtensions extensions; extgl_InitWGL(&extensions); if (extensions.WGL_EXT_swap_control) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-22 22:30:24
|
Revision: 2827 http://svn.sourceforge.net/java-game-lib/?rev=2827&view=rev Author: elias_naur Date: 2007-05-22 15:30:21 -0700 (Tue, 22 May 2007) Log Message: ----------- Implemented proper buffer reference retaining for complicated functions like glVertexAttribPointer and glTexCoordPointer. Patch by MatthiasM. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java trunk/LWJGL/src/java/org/lwjgl/util/generator/CachedReference.java trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -31,18 +31,41 @@ */ package org.lwjgl.opengl; +import java.nio.Buffer; +import java.nio.IntBuffer; +import java.util.Arrays; + class BaseReferences { int elementArrayBuffer; int arrayBuffer; + Buffer[] glVertexAttribPointer_buffer; + Buffer[] glTexCoordPointer_buffer; + int glClientActiveTexture; + BaseReferences(ContextCapabilities caps) { + IntBuffer temp = caps.scratch_int_buffer; + + GL11.glGetInteger(ARBVertexShader.GL_MAX_VERTEX_ATTRIBS_ARB, temp); + glVertexAttribPointer_buffer = new Buffer[temp.get(0)]; + + GL11.glGetInteger(GL13.GL_MAX_TEXTURE_UNITS, temp); + glTexCoordPointer_buffer = new Buffer[temp.get(0)]; + } + void clear() { this.elementArrayBuffer = 0; this.arrayBuffer = 0; + this.glClientActiveTexture = 0; + Arrays.fill(glVertexAttribPointer_buffer, null); + Arrays.fill(glTexCoordPointer_buffer, null); } void copy(BaseReferences references) { this.elementArrayBuffer = references.elementArrayBuffer; this.arrayBuffer = references.arrayBuffer; + this.glClientActiveTexture = references.glClientActiveTexture; + System.arraycopy(references.glVertexAttribPointer_buffer, 0, glVertexAttribPointer_buffer, 0, glVertexAttribPointer_buffer.length); + System.arraycopy(references.glTexCoordPointer_buffer, 0, glTexCoordPointer_buffer, 0, glTexCoordPointer_buffer.length); } } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -57,13 +57,14 @@ References[] new_references_stack = new References[references_stack.length + 1]; System.arraycopy(references_stack, 0, new_references_stack, 0, references_stack.length); references_stack = new_references_stack; - references_stack[references_stack.length - 1] = new References(); + references_stack[references_stack.length - 1] = new References(GLContext.getCapabilities()); } ReferencesStack() { + ContextCapabilities caps = GLContext.getCapabilities(); references_stack = new References[1]; stack_pos = 0; for (int i = 0; i < references_stack.length; i++) - references_stack[i] = new References(); + references_stack[i] = new References(caps); } } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/CachedReference.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/CachedReference.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/CachedReference.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -46,4 +46,9 @@ @Target(ElementType.PARAMETER) public @interface CachedReference { + /** If set then this will be used as array index for accessing the stored reference. */ + String index() default ""; + + /** If set then this name will be used for the reference and the reference field will not be auto generated in References. */ + String name() default ""; } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -401,13 +401,21 @@ 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()); + CachedReference cachedReference = param.getAnnotation(CachedReference.class); if (Buffer.class.isAssignableFrom(java_type) && - param.getAnnotation(CachedReference.class) != null && + cachedReference != null && (mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) && param.getAnnotation(Result.class) == null) { writer.print("\t\t" + Utils.CHECKS_CLASS_NAME + ".getReferences(caps)."); - writer.print(Utils.getReferenceName(interface_decl, method, param) + " = "); - writer.println(param.getSimpleName() + ";"); + if(cachedReference.name().length() > 0) { + writer.print(cachedReference.name()); + } else { + writer.print(Utils.getReferenceName(interface_decl, method, param)); + } + if(cachedReference.index().length() > 0) { + writer.print("[" + cachedReference.index() + "]"); + } + writer.println(" = " + param.getSimpleName() + ";"); } } } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -108,7 +108,7 @@ private static void generateClearsFromParameters(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) { + if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) { Class nio_type = Utils.getNIOBufferType(param.getType()); String reference_name = Utils.getReferenceName(interface_decl, method, param); writer.println("\t\tthis." + reference_name + " = null;"); @@ -119,7 +119,7 @@ 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) { + if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) { Class nio_type = Utils.getNIOBufferType(param.getType()); String reference_name = Utils.getReferenceName(interface_decl, method, param); writer.print("\t\tthis." + reference_name + " = "); @@ -143,7 +143,7 @@ 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) { + if (cached_reference_annotation != null && cached_reference_annotation.name().length() == 0) { Class nio_type = Utils.getNIOBufferType(param.getType()); if (nio_type == null) throw new RuntimeException(param + " in method " + method + " in " + interface_decl + " is annotated with " @@ -167,6 +167,9 @@ writer.println("package org.lwjgl.opengl;"); writer.println(); writer.println("class " + REFERENCES_CLASS_NAME + " extends BaseReferences {"); + writer.println("\t" + REFERENCES_CLASS_NAME + "(ContextCapabilities caps) {"); + writer.println("\t\tsuper(caps);"); + writer.println("\t}"); DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class); Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations()); for (TypeDeclaration typedecl : interface_decls) { Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -112,7 +112,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 + @CachedReference(index="index",name="glVertexAttribPointer_buffer") @BufferObject(BufferKind.ArrayVBO) @Check @Const Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -122,7 +122,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 + @CachedReference(index="index",name="glVertexAttribPointer_buffer") @BufferObject(BufferKind.ArrayVBO) @Check @Const Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -1336,7 +1336,7 @@ 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, - @CachedReference + @CachedReference(index="GLChecks.getReferences(caps).glClientActiveTexture", name="glTexCoordPointer_buffer") @BufferObject(BufferKind.ArrayVBO) @Check @Const Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -148,6 +148,7 @@ void glActiveTexture(@GLenum int texture); + @Code("\t\tGLChecks.getReferences(caps).glClientActiveTexture = texture - GL_TEXTURE0;") void glClientActiveTexture(@GLenum int texture); void glCompressedTexImage1D(@GLenum int target, int level, @GLenum int internalformat, @GLsizei int width, int border, @AutoSize("data") @GLsizei int imageSize, Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -278,7 +278,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 + @CachedReference(index="index",name="glVertexAttribPointer_buffer") @BufferObject(BufferKind.ArrayVBO) @Check @Const Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java 2007-05-20 17:51:28 UTC (rev 2826) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java 2007-05-22 22:30:21 UTC (rev 2827) @@ -228,7 +228,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 + @CachedReference(index="index",name="glVertexAttribPointer_buffer") @BufferObject(BufferKind.ArrayVBO) @Check @Const This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-05-20 17:52:18
|
Revision: 2826 http://svn.sourceforge.net/java-game-lib/?rev=2826&view=rev Author: matzon Date: 2007-05-20 10:51:28 -0700 (Sun, 20 May 2007) Log Message: ----------- reworked typecasting with a dash of insanity to look more like nalBufferData - lisp anyone? Modified Paths: -------------- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2007-05-20 17:47:33 UTC (rev 2825) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2007-05-20 17:51:28 UTC (rev 2826) @@ -107,7 +107,7 @@ * Signature: (JLjava/nio/ByteBuffer;I)V */ static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureSamples(JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position, jint samples) { - ALvoid *buffer_address = ((ALbyte *)(*env)->GetDirectBufferAddress(env, buffer)) + position; + ALvoid *buffer_address = ((ALbyte *)(((char*)(*env)->GetDirectBufferAddress(env, buffer)) + position)); alcCaptureSamples((ALCdevice*) ((intptr_t)device), buffer_address, samples); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-05-20 17:47:34
|
Revision: 2825 http://svn.sourceforge.net/java-game-lib/?rev=2825&view=rev Author: matzon Date: 2007-05-20 10:47:33 -0700 (Sun, 20 May 2007) Log Message: ----------- reordered context destruction - fixing some invalidation issues Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-20 17:44:59 UTC (rev 2824) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-20 17:47:33 UTC (rev 2825) @@ -357,10 +357,10 @@ */ public static void alcDestroyContext(ALCcontext context) { synchronized(ALC10.contexts) { + ALCdevice device = alcGetContextsDevice(context); nalcDestroyContext(getContext(context)); + device.removeContext(context); context.setInvalid(); - ALCdevice device = alcGetContextsDevice(context); - device.removeContext(context); } } native static void nalcDestroyContext(long context); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-05-20 17:45:47
|
Revision: 2824 http://svn.sourceforge.net/java-game-lib/?rev=2824&view=rev Author: matzon Date: 2007-05-20 10:44:59 -0700 (Sun, 20 May 2007) Log Message: ----------- fixed issues with typecasting of buffer type Modified Paths: -------------- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c Modified: trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c =================================================================== --- trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2007-05-19 20:47:53 UTC (rev 2823) +++ trunk/LWJGL/src/native/common/org_lwjgl_openal_ALC11.c 2007-05-20 17:44:59 UTC (rev 2824) @@ -107,7 +107,7 @@ * Signature: (JLjava/nio/ByteBuffer;I)V */ static void JNICALL Java_org_lwjgl_openal_ALC11_nalcCaptureSamples(JNIEnv *env, jclass clazz, jlong device, jobject buffer, jint position, jint samples) { - ALuint *buffer_address = ((ALuint *)(*env)->GetDirectBufferAddress(env, buffer)) + position; + ALvoid *buffer_address = ((ALbyte *)(*env)->GetDirectBufferAddress(env, buffer)) + position; alcCaptureSamples((ALCdevice*) ((intptr_t)device), buffer_address, samples); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-05-19 20:47:55
|
Revision: 2823 http://svn.sourceforge.net/java-game-lib/?rev=2823&view=rev Author: matzon Date: 2007-05-19 13:47:53 -0700 (Sat, 19 May 2007) Log Message: ----------- remove context from the devices list of context on context destroy Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-19 20:40:04 UTC (rev 2822) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-19 20:47:53 UTC (rev 2823) @@ -359,6 +359,8 @@ synchronized(ALC10.contexts) { nalcDestroyContext(getContext(context)); context.setInvalid(); + ALCdevice device = alcGetContextsDevice(context); + device.removeContext(context); } } native static void nalcDestroyContext(long context); Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-05-19 20:40:04 UTC (rev 2822) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-05-19 20:47:53 UTC (rev 2823) @@ -89,6 +89,17 @@ contexts.put(new Long(context.context), context); } } + + /** + * Remove context associated with device + * + * @param context Context to disassociate with device + */ + void removeContext(ALCcontext context) { + synchronized (contexts) { + contexts.remove(new Long(context.context)); + } + } /** * Marks this device and all of its contexts invalid This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-05-19 20:40:37
|
Revision: 2821 http://svn.sourceforge.net/java-game-lib/?rev=2821&view=rev Author: matzon Date: 2007-05-19 13:39:50 -0700 (Sat, 19 May 2007) Log Message: ----------- dont compare validity on equals Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java 2007-05-19 19:37:57 UTC (rev 2820) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java 2007-05-19 20:39:50 UTC (rev 2821) @@ -72,7 +72,7 @@ */ public boolean equals(Object context) { if(context instanceof ALCcontext) { - return ((ALCcontext)context).context == this.context && ((ALCcontext)context).valid == this.valid; + return ((ALCcontext)context).context == this.context; } return super.equals(context); } Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-05-19 19:37:57 UTC (rev 2820) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-05-19 20:39:50 UTC (rev 2821) @@ -74,7 +74,7 @@ */ public boolean equals(Object device) { if(device instanceof ALCdevice) { - return ((ALCdevice)device).device == this.device && ((ALCdevice)device).valid == this.valid; + return ((ALCdevice)device).device == this.device; } return super.equals(device); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-05-19 20:40:06
|
Revision: 2822 http://svn.sourceforge.net/java-game-lib/?rev=2822&view=rev Author: matzon Date: 2007-05-19 13:40:04 -0700 (Sat, 19 May 2007) Log Message: ----------- moved invalidation into sycnhronized block Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-19 20:39:50 UTC (rev 2821) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-19 20:40:04 UTC (rev 2822) @@ -221,8 +221,8 @@ */ public static boolean alcCloseDevice(ALCdevice device) { boolean result = nalcCloseDevice(getDevice(device)); - device.setInvalid(); synchronized (devices) { + device.setInvalid(); devices.remove(new Long(device.device)); } return result; @@ -253,8 +253,8 @@ ALCcontext context = new ALCcontext(context_address); synchronized (ALC10.contexts) { contexts.put(new Long(context_address), context); + device.addContext(context); } - device.addContext(context); return context; } return null; @@ -356,8 +356,10 @@ * @param context address of context to Destroy */ public static void alcDestroyContext(ALCcontext context) { - nalcDestroyContext(getContext(context)); - context.setInvalid(); + synchronized(ALC10.contexts) { + nalcDestroyContext(getContext(context)); + context.setInvalid(); + } } native static void nalcDestroyContext(long context); Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2007-05-19 20:39:50 UTC (rev 2821) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2007-05-19 20:40:04 UTC (rev 2822) @@ -109,8 +109,8 @@ */ public static boolean alcCaptureCloseDevice(ALCdevice device) { boolean result = nalcCaptureCloseDevice(ALC10.getDevice(device)); - device.setInvalid(); synchronized (ALC10.devices) { + device.setInvalid(); ALC10.devices.remove(new Long(device.device)); } return result; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-05-19 19:39:07
|
Revision: 2820 http://svn.sourceforge.net/java-game-lib/?rev=2820&view=rev Author: matzon Date: 2007-05-19 12:37:57 -0700 (Sat, 19 May 2007) Log Message: ----------- fixed address checking issue fixed issue with ALC error checking not taking a device into account now tracking device and context create and destroy made the create with open default device option public misc cleaning up and commenting Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/openal/AL.java trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java trunk/LWJGL/src/java/org/lwjgl/openal/Util.java Modified: trunk/LWJGL/src/java/org/lwjgl/openal/AL.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/AL.java 2007-05-18 07:15:35 UTC (rev 2819) +++ trunk/LWJGL/src/java/org/lwjgl/openal/AL.java 2007-05-19 19:37:57 UTC (rev 2820) @@ -31,15 +31,15 @@ */ package org.lwjgl.openal; -import java.util.Vector; - import org.lwjgl.LWJGLException; import org.lwjgl.LWJGLUtil; import org.lwjgl.Sys; /** - * <br> - * This is the OpenAL class. It extends the latest core. + * <p> + * The AL class implements the actual creation code for linking to the native library + * OpenAL. + * </p> * * @author Brian Matzon <br...@ma...> * @version $Revision$ @@ -108,7 +108,7 @@ * @param openDevice Whether to automatically open the device * @see #create(String, int, int, boolean) */ - static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice) + public static void create(String deviceArguments, int contextFrequency, int contextRefresh, boolean contextSynchronized, boolean openDevice) throws LWJGLException { if (created) @@ -196,6 +196,7 @@ */ public static void destroy() { if (context != null) { + ALC10.alcMakeContextCurrent(null); ALC10.alcDestroyContext(context); context = null; } Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-18 07:15:35 UTC (rev 2819) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC10.java 2007-05-19 19:37:57 UTC (rev 2820) @@ -33,6 +33,7 @@ import java.nio.Buffer; import java.nio.IntBuffer; +import java.util.HashMap; import org.lwjgl.BufferChecks; import org.lwjgl.LWJGLException; @@ -40,11 +41,6 @@ /** * * <p> - * This is the context class for OpenAL. This class implements functions - * in alc.h - * </p> - * - * <p> * ALC introduces the notion of a Device. A Device can be, depending on the * implementation, a hardware device, or a daemon/OS service/actual server. This * mechanism also permits different drivers (and hardware) to coexist within the same @@ -54,19 +50,18 @@ * specifiers (represented as strings). * </p> * - * <p> - * <b>NOTE:</b><br> - * The LWJGL implementation of OpenAL does not expose the device, nor the context. - * Whenever <code>AL</code> is created using the <code>create</code> method, an underlying - * device and context is created. Thus more advanced usage of multiple contexts and/or devices - * are not possible. The above mentioned features are very rarely used in games. - * </p> - * * @author Brian Matzon <br...@ma...> * @version $Revision: 2286 $ * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $ */ public final class ALC10 { + + /** List of active contexts */ + static HashMap contexts = new HashMap(); + + /** List of active devices */ + static HashMap devices = new HashMap(); + /** Bad value */ public static final int ALC_INVALID = 0; @@ -158,10 +153,10 @@ public static String alcGetString(ALCdevice device, int pname) { String result; result = nalcGetString(getDevice(device), pname); - Util.checkALCError(); + Util.checkALCError(device); return result; } - private native static String nalcGetString(long device, int pname); + native static String nalcGetString(long device, int pname); /** * The application can query ALC for information using an integer query function. @@ -186,9 +181,9 @@ public static void alcGetInteger(ALCdevice device, int pname, IntBuffer integerdata) { BufferChecks.checkDirect(integerdata); nalcGetIntegerv(getDevice(device), pname, integerdata.remaining(), integerdata, integerdata.position()); - Util.checkALCError(); + Util.checkALCError(device); } - private native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset); + native static void nalcGetIntegerv(long device, int pname, int size, Buffer integerdata, int offset); /** * The <code>alcOpenDevice</code> function allows the application (i.e. the client program) to @@ -203,9 +198,13 @@ * @return opened device, or null */ public static ALCdevice alcOpenDevice(String devicename) { - long device = nalcOpenDevice(devicename); - if(device > 0) { - return new ALCdevice(device); + long device_address = nalcOpenDevice(devicename); + if(device_address != 0) { + ALCdevice device = new ALCdevice(device_address); + synchronized (ALC10.devices) { + devices.put(new Long(device_address), device); + } + return device; } return null; } @@ -221,7 +220,13 @@ * @param device address of native device to close */ public static boolean alcCloseDevice(ALCdevice device) { - return nalcCloseDevice(getDevice(device)); + boolean result = nalcCloseDevice(getDevice(device)); + device.setInvalid(); + synchronized (devices) { + devices.remove(new Long(device.device)); + } + return result; + } native static boolean nalcCloseDevice(long device); @@ -241,16 +246,20 @@ * @return New context, or null if creation failed */ public static ALCcontext alcCreateContext(ALCdevice device, IntBuffer attrList) { - long context = nalcCreateContext(getDevice(device), attrList); - Util.checkALCError(); + long context_address = nalcCreateContext(getDevice(device), attrList); + Util.checkALCError(device); - if(context > 0) { - return new ALCcontext(context); + if(context_address != 0) { + ALCcontext context = new ALCcontext(context_address); + synchronized (ALC10.contexts) { + contexts.put(new Long(context_address), context); + } + device.addContext(context); + return context; } - return null; } - private native static long nalcCreateContext(long device, IntBuffer attrList); + native static long nalcCreateContext(long device, IntBuffer attrList); /** * To make a Context current with respect to AL Operation (state changes by issueing @@ -269,7 +278,7 @@ public static int alcMakeContextCurrent(ALCcontext context) { return nalcMakeContextCurrent(getContext(context)); } - public native static int nalcMakeContextCurrent(long context); + native static int nalcMakeContextCurrent(long context); /** * The current context is the only context accessible to state changes by AL commands @@ -285,7 +294,7 @@ public static void alcProcessContext(ALCcontext context) { nalcProcessContext(getContext(context)); } - private native static void nalcProcessContext(long context); + native static void nalcProcessContext(long context); /** * The application can query for, and obtain an handle to, the current context for the @@ -294,13 +303,16 @@ * @return Current ALCcontext */ public static ALCcontext alcGetCurrentContext() { - long context = nalcGetCurrentContext(); - if(context > 0) { - return new ALCcontext(context); + ALCcontext context = null; + long context_address = nalcGetCurrentContext(); + if(context_address != 0) { + synchronized (ALC10.contexts) { + context = (ALCcontext) ALC10.contexts.get(new Long(context_address)); + } } - return null; + return context; } - public native static long nalcGetCurrentContext(); + native static long nalcGetCurrentContext(); /** * The application can query for, and obtain an handle to, the device of a given context. @@ -309,13 +321,16 @@ * @param ALCdevice associated with context */ public static ALCdevice alcGetContextsDevice(ALCcontext context) { - long device = nalcGetContextsDevice(getContext(context)); - if (device > 0) { - return new ALCdevice(device); + ALCdevice device = null; + long device_address = nalcGetContextsDevice(getContext(context)); + if (device_address != 0) { + synchronized (ALC10.devices) { + device = (ALCdevice) ALC10.devices.get(new Long(device_address)); + } } - return null; + return device; } - private native static long nalcGetContextsDevice(long context); + native static long nalcGetContextsDevice(long context); /** * The application can suspend any context from processing (including the current @@ -332,7 +347,7 @@ public static void alcSuspendContext(ALCcontext context) { nalcSuspendContext(getContext(context)); } - private native static void nalcSuspendContext(long context); + native static void nalcSuspendContext(long context); /** * The correct way to destroy a context is to first release it using <code>alcMakeCurrent</code> and @@ -342,6 +357,7 @@ */ public static void alcDestroyContext(ALCcontext context) { nalcDestroyContext(getContext(context)); + context.setInvalid(); } native static void nalcDestroyContext(long context); @@ -363,7 +379,7 @@ public static int alcGetError(ALCdevice device) { return nalcGetError(getDevice(device)); } - private native static int nalcGetError(long device); + native static int nalcGetError(long device); /** * Verify that a given extension is available for the current context and the device it @@ -376,10 +392,10 @@ */ public static boolean alcIsExtensionPresent(ALCdevice device, String extName) { boolean result = nalcIsExtensionPresent(getDevice(device), extName); - Util.checkALCError(); + Util.checkALCError(device); return result; } - private native static boolean nalcIsExtensionPresent(long device, String extName); + native static boolean nalcIsExtensionPresent(long device, String extName); /** * Enumeration/token values are device independend, but tokens defined for @@ -393,13 +409,14 @@ */ public static int alcGetEnumValue(ALCdevice device, String enumName) { int result = nalcGetEnumValue(getDevice(device), enumName); - Util.checkALCError(); + Util.checkALCError(device); return result; } - private native static int nalcGetEnumValue(long device, String enumName); + native static int nalcGetEnumValue(long device, String enumName); static long getDevice(ALCdevice device) { if(device != null) { + Util.checkALCValidDevice(device); return device.device; } return 0L; @@ -407,6 +424,7 @@ static long getContext(ALCcontext context) { if(context != null) { + Util.checkALCValidContext(context); return context.context; } return 0L; Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2007-05-18 07:15:35 UTC (rev 2819) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALC11.java 2007-05-19 19:37:57 UTC (rev 2820) @@ -40,8 +40,13 @@ /** + * <p> + * The ALC11 class implements features in OpenAL 1.1, specifically + * ALC methods and properties. + * </p> * * @author Brian Matzon <br...@ma...> + * @see ALC10 * @version $Revision: 2286 $ * $Id: ALC.java 2286 2006-03-23 19:32:21 +0000 (to, 23 mar 2006) matzon $ */ @@ -81,9 +86,13 @@ * @return ALCdevice if it was possible to open a device */ public static ALCdevice alcCaptureOpenDevice(String devicename, int frequency, int format, int buffersize) { - long device = nalcCaptureOpenDevice(devicename, frequency, format, buffersize); - if(device > 0) { - return new ALCdevice(device); + long device_address = nalcCaptureOpenDevice(devicename, frequency, format, buffersize); + if(device_address != 0) { + ALCdevice device = new ALCdevice(device_address); + synchronized (ALC10.devices) { + ALC10.devices.put(new Long(device_address), device); + } + return device; } return null; } @@ -99,7 +108,12 @@ * @return true if device was successfully closed */ public static boolean alcCaptureCloseDevice(ALCdevice device) { - return nalcCaptureCloseDevice(ALC10.getDevice(device)); + boolean result = nalcCaptureCloseDevice(ALC10.getDevice(device)); + device.setInvalid(); + synchronized (ALC10.devices) { + ALC10.devices.remove(new Long(device.device)); + } + return result; } static native boolean nalcCaptureCloseDevice(long device); Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java 2007-05-18 07:15:35 UTC (rev 2819) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALCcontext.java 2007-05-19 19:37:57 UTC (rev 2820) @@ -36,8 +36,14 @@ import org.lwjgl.BufferUtils; /** - * <br> - * Wrapper class, to make ALC contexts behave like the orginal api. + * The ALCcontext class represents a context opened in OpenAL space. + * + * All operations of the AL core API affect a current AL context. Within the scope of AL, + * the ALC is implied - it is not visible as a handle or function parameter. Only one AL + * Context per process can be current at a time. Applications maintaining multiple AL + * Contexts, whether threaded or not, have to set the current context accordingly. + * Applications can have multiple threads that share one more or contexts. In other words, + * AL and ALC are threadsafe. * * @author Brian Matzon <br...@ma...> * @version $Revision$ @@ -45,9 +51,12 @@ */ public final class ALCcontext { - /** address of actual context */ + /** Address of actual context */ final long context; - + + /** Whether this context is valid */ + private boolean valid = false; + /** * Creates a new instance of ALCcontext * @@ -55,6 +64,7 @@ */ ALCcontext(long context) { this.context = context; + this.valid = true; } /* @@ -62,7 +72,7 @@ */ public boolean equals(Object context) { if(context instanceof ALCcontext) { - return ((ALCcontext)context).context == this.context; + return ((ALCcontext)context).context == this.context && ((ALCcontext)context).valid == this.valid; } return super.equals(context); } @@ -87,4 +97,19 @@ return attribList; } + + /** + * Marks this context as invalid + * + */ + void setInvalid() { + valid = false; + } + + /** + * @return true if this context is still valid + */ + public boolean isValid() { + return valid; + } } Modified: trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-05-18 07:15:35 UTC (rev 2819) +++ trunk/LWJGL/src/java/org/lwjgl/openal/ALCdevice.java 2007-05-19 19:37:57 UTC (rev 2820) @@ -31,9 +31,18 @@ */ package org.lwjgl.openal; +import java.util.HashMap; +import java.util.Iterator; + /** - * <br> - * Wrapper class, to make ALC devices behave like the orginal api. + * The ALCdevice class represents a device opened in OpenAL space. + * + * ALC introduces the notion of a Device. A Device can be, depending on the + * implementation, a hardware device, or a daemon/OS service/actual server. This + * mechanism also permits different drivers (and hardware) to coexist within the same + * system, as well as allowing several applications to share system resources for audio, + * including a single hardware output device. The details are left to the implementation, + * which has to map the available backends to unique device specifiers. * * @author Brian Matzon <br...@ma...> * @version $Revision$ @@ -41,9 +50,15 @@ */ public final class ALCdevice { - /** address of actual device */ + /** Address of actual device */ final long device; + /** Whether this device is valid */ + private boolean valid = false; + + /** List of contexts belonging to the device */ + private HashMap contexts = new HashMap(); + /** * Creates a new instance of ALCdevice * @@ -51,6 +66,7 @@ */ ALCdevice(long device) { this.device = device; + this.valid = true; } /* @@ -58,8 +74,40 @@ */ public boolean equals(Object device) { if(device instanceof ALCdevice) { - return ((ALCdevice)device).device == this.device; + return ((ALCdevice)device).device == this.device && ((ALCdevice)device).valid == this.valid; } return super.equals(device); + } + + /** + * Adds a context to the device + * + * @param context context to add to the list of contexts for this device + */ + void addContext(ALCcontext context) { + synchronized (contexts) { + contexts.put(new Long(context.context), context); + } + } + + /** + * Marks this device and all of its contexts invalid + */ + void setInvalid() { + valid = false; + synchronized (contexts) { + for(Iterator i = contexts.values().iterator(); i.hasNext();) { + ALCcontext context = (ALCcontext) i.next(); + context.setInvalid(); + } + } + contexts.clear(); } + + /** + * @return true if this device is still valid + */ + public boolean isValid() { + return valid; + } } Modified: trunk/LWJGL/src/java/org/lwjgl/openal/Util.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/openal/Util.java 2007-05-18 07:15:35 UTC (rev 2819) +++ trunk/LWJGL/src/java/org/lwjgl/openal/Util.java 2007-05-19 19:37:57 UTC (rev 2820) @@ -33,9 +33,10 @@ /** - * Simple utility class. + * Simple utility class for checking AL/ALC errors * * @author cix_foo <ci...@us...> + * @author Brian Matzon <br...@ma...> * @version $Revision$ */ @@ -44,15 +45,42 @@ private Util() { } - public static void checkALCError() { - int err = ALC10.alcGetError(AL.getDevice()); + /** + * Checks for any ALC errors and throws an unchecked exception on errors + * @param device Device for which to check ALC errors + */ + public static void checkALCError(ALCdevice device) { + int err = ALC10.alcGetError(device); if (err != ALC10.ALC_NO_ERROR) throw new OpenALException(ALC10.alcGetString(AL.getDevice(), err)); } + /** + * Checks for any AL errors and throws an unchecked exception on errors + */ public static void checkALError() { int err = AL10.alGetError(); if (err != AL10.AL_NO_ERROR) throw new OpenALException(err); } + + /** + * Checks for a valid device + * @param device ALCdevice to check the validity of + */ + public static void checkALCValidDevice(ALCdevice device) { + if(!device.isValid()) { + throw new OpenALException("Invalid device: " + device); + } + } + + /** + * Checks for a valid context + * @param context ALCcontext to check the validity of + */ + public static void checkALCValidContext(ALCcontext context) { + if(!context.isValid()) { + throw new OpenALException("Invalid context: " + context); + } + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-18 07:15:37
|
Revision: 2819 http://svn.sourceforge.net/java-game-lib/?rev=2819&view=rev Author: elias_naur Date: 2007-05-18 00:15:35 -0700 (Fri, 18 May 2007) Log Message: ----------- Linux: Removed GCJ workaround since current GCJ versions support re-entrant AWT locking Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-13 22:01:48 UTC (rev 2818) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-18 07:15:35 UTC (rev 2819) @@ -67,15 +67,6 @@ private static final int XRANDR = 10; private static final int XF86VIDMODE = 11; private static final int NONE = 12; - - /** Keep track on the current awt lock owner to avoid - * depending on JAWT locking to be re-entrant (This is a - * problem with GCJ). JAWT locking is not that well specified - * anyway so it is probably best to avoid assuming too much - * about it. - */ - private static Thread current_awt_lock_owner; - private static int awt_lock_count; /** Current X11 Display pointer */ private static long display; @@ -212,41 +203,20 @@ * Xlib calls with AWT Xlib calls. Fortunately, JAWT implements Lock()/Unlock() to * do just that. */ - static synchronized void lockAWT() { - Thread this_thread = Thread.currentThread(); - while (current_awt_lock_owner != null && current_awt_lock_owner != this_thread) { - try { - LinuxDisplay.class.wait(); - } catch (InterruptedException e) { - LWJGLUtil.log("Interrupted while waiting for awt lock: " + e); - } + static void lockAWT() { + try { + nLockAWT(); + } catch (LWJGLException e) { + LWJGLUtil.log("Caught exception while locking AWT: " + e); } - if (awt_lock_count == 0) { - current_awt_lock_owner = this_thread; - try { - nLockAWT(); - } catch (LWJGLException e) { - LWJGLUtil.log("Caught exception while locking AWT: " + e); - } - } - awt_lock_count++; } private static native void nLockAWT() throws LWJGLException; - static synchronized void unlockAWT() { - if (awt_lock_count <= 0) - throw new IllegalStateException("AWT not locked!"); - if (Thread.currentThread() != current_awt_lock_owner) - throw new IllegalStateException("AWT already locked by " + current_awt_lock_owner); - awt_lock_count--; - if (awt_lock_count == 0) { - try { - nUnlockAWT(); - } catch (LWJGLException e) { - LWJGLUtil.log("Caught exception while unlocking AWT: " + e); - } - current_awt_lock_owner = null; - LinuxDisplay.class.notify(); + static void unlockAWT() { + try { + nUnlockAWT(); + } catch (LWJGLException e) { + LWJGLUtil.log("Caught exception while unlocking AWT: " + e); } } private static native void nUnlockAWT() throws LWJGLException; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-13 22:01:50
|
Revision: 2818 http://svn.sourceforge.net/java-game-lib/?rev=2818&view=rev Author: elias_naur Date: 2007-05-13 15:01:48 -0700 (Sun, 13 May 2007) Log Message: ----------- Implemented Keyboard.enableRepeatEvents(), Keyboard.areRepeatEventsEnabled() and Keyboard.isEventRepeat() to control repeat event reporting. Added repeat key test to KeyboardTest Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java Modified: trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java 2007-05-13 21:11:53 UTC (rev 2817) +++ trunk/LWJGL/src/java/org/lwjgl/input/Keyboard.java 2007-05-13 22:01:48 UTC (rev 2818) @@ -57,7 +57,7 @@ */ public class Keyboard { /** Internal use - event size in bytes */ - public static final int EVENT_SIZE = 4 + 1 + 4 + 8; + public static final int EVENT_SIZE = 4 + 1 + 4 + 8 + 1; /** * The special character meaning that no @@ -239,6 +239,9 @@ /** Has the keyboard been created? */ private static boolean created; + /** Are repeat events enabled? */ + private static boolean repeat_enabled; + /** The keys status from the last poll */ private static final ByteBuffer keyDownBuffer = BufferUtils.createByteBuffer(KEYBOARD_SIZE); @@ -249,18 +252,12 @@ */ private static ByteBuffer readBuffer; - /** The current keyboard character being examined */ - private static int eventCharacter; + /** current event */ + private static KeyEvent current_event = new KeyEvent(); - /** The current keyboard event key being examined */ - private static int eventKey; + /** scratch event */ + private static KeyEvent tmp_event = new KeyEvent(); - /** The current state of the key being examined in the event queue */ - private static boolean eventState; - - /** The current event time */ - private static long eventNanos; - /** One time initialization */ private static boolean initialized; @@ -318,9 +315,7 @@ readBuffer.limit(0); for (int i = 0; i < keyDownBuffer.remaining(); i++) keyDownBuffer.put(i, (byte)0); - eventCharacter = 0; - eventKey = 0; - eventState = false; + current_event.reset(); } /** @@ -432,7 +427,12 @@ synchronized (OpenGLPackageAccess.global_lock) { if (!created) throw new IllegalStateException("Keyboard must be created before you can read events"); - return readBuffer.remaining()/EVENT_SIZE; + int old_position = readBuffer.position(); + int num_events = 0; + while (readNext(tmp_event) && (!tmp_event.repeat || repeat_enabled)) + num_events++; + readBuffer.position(old_position); + return num_events; } } @@ -452,19 +452,48 @@ if (!created) throw new IllegalStateException("Keyboard must be created before you can read events"); - if (readBuffer.hasRemaining()) { - eventKey = readBuffer.getInt() & 0xFF; - eventState = readBuffer.get() != 0; - eventCharacter = readBuffer.getInt(); - eventNanos = readBuffer.getLong(); - return true; - } else { - return false; - } + boolean result; + while ((result = readNext(current_event)) && current_event.repeat && !repeat_enabled) + ; + return result; } } /** + * Controls whether repeat events are reported or not. If repeat events + * are enabled, key down events are reported when a key is pressed and held for + * a OS dependent amount of time. To distinguish a repeat event from a normal event, + * use isRepeatEvent(). + * + * @see org.lwjgl.input.Keyboard#getEventKey() + */ + public static synchronized void enableRepeatEvents(boolean enable) { + repeat_enabled = enable; + } + + /** + * Check whether repeat events are currently reported or not. + * + * @return true is repeat events are reported, false if not. + * @see org.lwjgl.input.Keyboard#getEventKey() + */ + public static synchronized boolean areRepeatEventsEnabled() { + return repeat_enabled; + } + + private static boolean readNext(KeyEvent event) { + if (readBuffer.hasRemaining()) { + event.key = readBuffer.getInt() & 0xFF; + event.state = readBuffer.get() != 0; + event.character = readBuffer.getInt(); + event.nanos = readBuffer.getLong(); + event.repeat = readBuffer.get() == 1; + return true; + } else + return false; + } + + /** * @return Number of keys on this keyboard */ public static synchronized int getKeyCount() { @@ -478,7 +507,7 @@ */ public static synchronized char getEventCharacter() { synchronized (OpenGLPackageAccess.global_lock) { - return (char)eventCharacter; + return (char)current_event.character; } } @@ -491,7 +520,7 @@ */ public static synchronized int getEventKey() { synchronized (OpenGLPackageAccess.global_lock) { - return eventKey; + return current_event.key; } } @@ -503,7 +532,7 @@ */ public static synchronized boolean getEventKeyState() { synchronized (OpenGLPackageAccess.global_lock) { - return eventState; + return current_event.state; } } @@ -516,7 +545,42 @@ */ public static synchronized long getEventNanoseconds() { synchronized (OpenGLPackageAccess.global_lock) { - return eventNanos; + return current_event.nanos; } } + + /** + * @see org.lwjgl.input.Keyboard#enableRepeatEvents() + * @return true if the current event is a repeat event, false if + * the current event is not a repeat even or if repeat events are disabled. + */ + public static synchronized boolean isRepeatEvent() { + synchronized (OpenGLPackageAccess.global_lock) { + return current_event.repeat; + } + } + + private final static class KeyEvent { + /** The current keyboard character being examined */ + private int character; + + /** The current keyboard event key being examined */ + private int key; + + /** The current state of the key being examined in the event queue */ + private boolean state; + + /** The current event time */ + private long nanos; + + /** Is the current event a repeated event? */ + private boolean repeat; + + private void reset() { + character = 0; + key = 0; + state = false; + repeat = false; + } + } } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java 2007-05-13 21:11:53 UTC (rev 2817) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java 2007-05-13 22:01:48 UTC (rev 2818) @@ -264,9 +264,9 @@ //component.removeKeyListener(this); } - private void putKeyboardEvent(int key_code, byte state, int character, long nanos) { + private void putKeyboardEvent(int key_code, byte state, int character, long nanos, boolean repeat) { event.clear(); - event.putInt(key_code).put(state).putInt(character).putLong(nanos); + event.putInt(key_code).put(state).putInt(character).putLong(nanos).put(repeat ? (byte)1 : (byte)0); event.flip(); putEvent(event); } @@ -287,15 +287,16 @@ if (character == KeyEvent.CHAR_UNDEFINED) character = Keyboard.CHAR_NONE; if (state == 1) { + boolean repeat = false; if (has_deferred_event) { if ((nanos == deferred_nanos && deferred_key_code == key_code && deferred_key_location == key_location)) { has_deferred_event = false; - return; // Ignore repeated key down, key up event pair - } - flushDeferredEvent(); + repeat = true; // Repeat event + } else + flushDeferredEvent(); } - putKeyEvent(key_code, key_location, state, character, nanos); + putKeyEvent(key_code, key_location, state, character, nanos, repeat); } else { flushDeferredEvent(); has_deferred_event = true; @@ -309,19 +310,19 @@ private void flushDeferredEvent() { if (has_deferred_event) { - putKeyEvent(deferred_key_code, deferred_key_location, deferred_key_state, deferred_character, deferred_nanos); + putKeyEvent(deferred_key_code, deferred_key_location, deferred_key_state, deferred_character, deferred_nanos, false); has_deferred_event = false; } } - private void putKeyEvent(int key_code, int key_location, byte state, int character, long nanos) { + private void putKeyEvent(int key_code, int key_location, byte state, int character, long nanos, boolean repeat) { int key_code_mapped = getMappedKeyCode(key_code, key_location); /* Ignore repeating presses */ if ( key_states[key_code_mapped] == state ) - return; + repeat = true; key_states[key_code_mapped] = state; int key_int_char = character & 0xffff; - putKeyboardEvent(key_code_mapped, state, key_int_char, nanos); + putKeyboardEvent(key_code_mapped, state, key_int_char, nanos, repeat); } private int getMappedKeyCode(int key_code, int position) { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java 2007-05-13 21:11:53 UTC (rev 2817) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java 2007-05-13 22:01:48 UTC (rev 2818) @@ -75,7 +75,7 @@ private final CharBuffer char_buffer = CharBuffer.allocate(KEYBOARD_BUFFER_SIZE); // Deferred key released event, to detect key repeat - private boolean has_deferred_event = true; + private boolean has_deferred_event; private int deferred_keycode; private int deferred_event_keycode; private long deferred_nanos; @@ -169,9 +169,9 @@ keyDownBuffer.position(old_position); } - private void putKeyboardEvent(int keycode, byte state, int ch, long nanos) { + private void putKeyboardEvent(int keycode, byte state, int ch, long nanos, boolean repeat) { tmp_event.clear(); - tmp_event.putInt(keycode).put(state).putInt(ch).putLong(nanos); + tmp_event.putInt(keycode).put(state).putInt(ch).putLong(nanos).put(repeat ? (byte)1 : (byte)0); tmp_event.flip(); event_queue.putEvent(tmp_event); } @@ -211,20 +211,20 @@ return lookupStringISO88591(event_ptr, translation_buffer); } - private void translateEvent(long event_ptr, int keycode, byte key_state, long nanos) { + private void translateEvent(long event_ptr, int keycode, byte key_state, long nanos, boolean repeat) { int num_chars, i; int ch; num_chars = lookupString(event_ptr, temp_translation_buffer); if (num_chars > 0) { ch = temp_translation_buffer[0]; - putKeyboardEvent(keycode, key_state, ch, nanos); + putKeyboardEvent(keycode, key_state, ch, nanos, repeat); for (i = 1; i < num_chars; i++) { ch = temp_translation_buffer[i]; - putKeyboardEvent(0, (byte)0, ch, nanos); + putKeyboardEvent(0, (byte)0, ch, nanos, repeat); } } else { - putKeyboardEvent(keycode, key_state, 0, nanos); + putKeyboardEvent(keycode, key_state, 0, nanos, repeat); } } @@ -305,14 +305,15 @@ key_down_buffer[keycode] = key_state; long nanos = millis*1000000; if (event_type == LinuxEvent.KeyPress) { + boolean repeat = false; if (has_deferred_event) { if (nanos == deferred_nanos && event_keycode == deferred_event_keycode) { has_deferred_event = false; - return; // Repeated event, ignore it - } - flushDeferredEvent(); + repeat = true; // Repeated event + } else + flushDeferredEvent(); } - translateEvent(event_ptr, keycode, key_state, nanos); + translateEvent(event_ptr, keycode, key_state, nanos, repeat); } else { flushDeferredEvent(); has_deferred_event = true; @@ -325,7 +326,7 @@ private void flushDeferredEvent() { if (has_deferred_event) { - putKeyboardEvent(deferred_keycode, deferred_key_state, 0, deferred_nanos); + putKeyboardEvent(deferred_keycode, deferred_key_state, 0, deferred_nanos, false); has_deferred_event = false; } } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-05-13 21:11:53 UTC (rev 2817) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2007-05-13 22:01:48 UTC (rev 2818) @@ -608,12 +608,11 @@ private void handleKeyButton(long wParam, long lParam, long millis) { byte previous_state = (byte)((lParam >>> 30) & 0x1); byte state = (byte)(1 - ((lParam >>> 31) & 0x1)); - if (state == previous_state) - return; // Auto-repeat message + boolean repeat = state == previous_state; // Repeat message byte extended = (byte)((lParam >>> 24) & 0x1); int scan_code = (int)((lParam >>> 16) & 0xFF); if (keyboard != null) - keyboard.handleKey((int)wParam, scan_code, extended != 0, state, millis); + keyboard.handleKey((int)wParam, scan_code, extended != 0, state, millis, repeat); } private static int transformY(long hwnd, int y) { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2007-05-13 21:11:53 UTC (rev 2817) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsKeyboard.java 2007-05-13 22:01:48 UTC (rev 2818) @@ -63,6 +63,7 @@ private byte retained_state; private int retained_char; private long retained_millis; + private boolean retained_repeat; public WindowsKeyboard(long hwnd) throws LWJGLException { this.hwnd = hwnd; @@ -97,9 +98,9 @@ private static native int GetKeyboardState(ByteBuffer lpKeyState); private static native int GetKeyState(int virt_key); - private void putEvent(int keycode, byte state, int ch, long millis) { + private void putEvent(int keycode, byte state, int ch, long millis, boolean repeat) { tmp_event.clear(); - tmp_event.putInt(keycode).put(state).putInt(ch).putLong(millis*1000000); + tmp_event.putInt(keycode).put(state).putInt(ch).putLong(millis*1000000).put(repeat ? (byte)1 : (byte)0); tmp_event.flip(); event_queue.putEvent(tmp_event); } @@ -144,11 +145,11 @@ private void flushRetained() { if (has_retained_event) { has_retained_event = false; - putEvent(retained_key_code, retained_state, retained_char, retained_millis); + putEvent(retained_key_code, retained_state, retained_char, retained_millis, retained_repeat); } } - public void handleKey(int virt_key, int scan_code, boolean extended, byte event_state, long millis) { + public void handleKey(int virt_key, int scan_code, boolean extended, byte event_state, long millis, boolean repeat) { virt_key = translateExtended(virt_key, scan_code, event_state, extended); flushRetained(); has_retained_event = true; @@ -159,12 +160,13 @@ retained_state = event_state; retained_millis = millis; retained_char = 0; + retained_repeat = repeat; // translate(virt_key, event_state, millis*1000000); } public void handleChar(int event_char, long millis) { if (!has_retained_event) { - putEvent(0, (byte)0, event_char, millis); + putEvent(0, (byte)0, event_char, millis, false); } else retained_char = event_char; } Modified: trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2007-05-13 21:11:53 UTC (rev 2817) +++ trunk/LWJGL/src/java/org/lwjgl/test/input/KeyboardTest.java 2007-05-13 22:01:48 UTC (rev 2818) @@ -152,7 +152,11 @@ System.out.println("Pressed:" + Keyboard.getEventKeyState()); System.out.println("Key character code: " + character_code); System.out.println("Key character: " + Keyboard.getEventCharacter()); + System.out.println("Repeat event: " + Keyboard.isRepeatEvent()); + if (Keyboard.getEventKey() == Keyboard.KEY_R && Keyboard.getEventKeyState()) { + Keyboard.enableRepeatEvents(!Keyboard.areRepeatEventsEnabled()); + } if (Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { return; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-13 21:12:10
|
Revision: 2817 http://svn.sourceforge.net/java-game-lib/?rev=2817&view=rev Author: elias_naur Date: 2007-05-13 14:11:53 -0700 (Sun, 13 May 2007) Log Message: ----------- Use event timestamp to detect key repeat events in KeyboardEventQueue Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTInput.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java 2007-05-13 20:13:37 UTC (rev 2816) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/KeyboardEventQueue.java 2007-05-13 21:11:53 UTC (rev 2817) @@ -53,6 +53,13 @@ private final Component component; + private boolean has_deferred_event; + private long deferred_nanos; + private int deferred_key_code; + private int deferred_key_location; + private byte deferred_key_state; + private int deferred_character; + static { KEY_MAP[KeyEvent.VK_0] = Keyboard.KEY_0; KEY_MAP[KeyEvent.VK_1] = Keyboard.KEY_1; @@ -265,14 +272,50 @@ } public synchronized void poll(ByteBuffer key_down_buffer) { + flushDeferredEvent(); int old_position = key_down_buffer.position(); key_down_buffer.put(key_states); key_down_buffer.position(old_position); } - private synchronized void handleKey(int key_code_mapped, byte state, int character, long nanos) { - if ( character == KeyEvent.CHAR_UNDEFINED ) + public synchronized void copyEvents(ByteBuffer dest) { + flushDeferredEvent(); + super.copyEvents(dest); + } + + private synchronized void handleKey(int key_code, int key_location, byte state, int character, long nanos) { + if (character == KeyEvent.CHAR_UNDEFINED) character = Keyboard.CHAR_NONE; + if (state == 1) { + if (has_deferred_event) { + if ((nanos == deferred_nanos && deferred_key_code == key_code && + deferred_key_location == key_location)) { + has_deferred_event = false; + return; // Ignore repeated key down, key up event pair + } + flushDeferredEvent(); + } + putKeyEvent(key_code, key_location, state, character, nanos); + } else { + flushDeferredEvent(); + has_deferred_event = true; + deferred_nanos = nanos; + deferred_key_code = key_code; + deferred_key_location = key_location; + deferred_key_state = state; + deferred_character = character; + } + } + + private void flushDeferredEvent() { + if (has_deferred_event) { + putKeyEvent(deferred_key_code, deferred_key_location, deferred_key_state, deferred_character, deferred_nanos); + has_deferred_event = false; + } + } + + private void putKeyEvent(int key_code, int key_location, byte state, int character, long nanos) { + int key_code_mapped = getMappedKeyCode(key_code, key_location); /* Ignore repeating presses */ if ( key_states[key_code_mapped] == state ) return; @@ -306,11 +349,11 @@ } public void keyPressed(KeyEvent e) { - handleKey(getMappedKeyCode(e.getKeyCode(), e.getKeyLocation()), (byte)1, e.getKeyChar(), e.getWhen()*1000000); + handleKey(e.getKeyCode(), e.getKeyLocation(), (byte)1, e.getKeyChar(), e.getWhen()*1000000); } public void keyReleased(KeyEvent e) { - handleKey(getMappedKeyCode(e.getKeyCode(), e.getKeyLocation()), (byte)0, Keyboard.CHAR_NONE, e.getWhen()*1000000); + handleKey(e.getKeyCode(), e.getKeyLocation(), (byte)0, Keyboard.CHAR_NONE, e.getWhen()*1000000); } public void keyTyped(KeyEvent e) { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTInput.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTInput.java 2007-05-13 20:13:37 UTC (rev 2816) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxAWTInput.java 2007-05-13 21:11:53 UTC (rev 2817) @@ -92,7 +92,6 @@ if (input_grabbed) { // LinuxDisplay.nUngrabKeyboard(display); LinuxDisplay.nUngrabPointer(display); - LinuxDisplay.nSetRepeatMode(display, LinuxDisplay.AutoRepeatModeDefault); input_grabbed = false; } } @@ -100,7 +99,6 @@ private void grabInput(long window) { if (!input_grabbed) { // int res1 = LinuxDisplay.nGrabKeyboard(display, window); - LinuxDisplay.nSetRepeatMode(display, LinuxDisplay.AutoRepeatModeOff); int res2 = LinuxDisplay.nGrabPointer(display, window, blank_cursor); if (/*res1 == LinuxDisplay.GrabSuccess && */res2 == LinuxDisplay.GrabSuccess) input_grabbed = true; Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-13 20:13:37 UTC (rev 2816) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-13 21:11:53 UTC (rev 2817) @@ -789,7 +789,6 @@ } } } - static native void nSetRepeatMode(long display, int mode); public void grabMouse(boolean new_grab) { lockAWT(); Modified: trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c =================================================================== --- trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-05-13 20:13:37 UTC (rev 2816) +++ trunk/LWJGL/src/native/linux/org_lwjgl_opengl_Display.c 2007-05-13 21:11:53 UTC (rev 2817) @@ -469,13 +469,6 @@ return win; } -JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nSetRepeatMode(JNIEnv *env, jclass unused, jlong display_ptr, jint mode) { - Display *disp = (Display *)(intptr_t)display_ptr; - XKeyboardControl repeat_mode; - repeat_mode.auto_repeat_mode = mode; - XChangeKeyboardControl(disp, KBAutoRepeatMode, &repeat_mode); -} - JNIEXPORT void JNICALL Java_org_lwjgl_opengl_LinuxDisplay_nIconifyWindow(JNIEnv *env, jclass unused, jlong display_ptr, jlong window_ptr, jint screen) { Display *disp = (Display *)(intptr_t)display_ptr; Window win = (Window)window_ptr; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-05-13 20:13:38
|
Revision: 2816 http://svn.sourceforge.net/java-game-lib/?rev=2816&view=rev Author: elias_naur Date: 2007-05-13 13:13:37 -0700 (Sun, 13 May 2007) Log Message: ----------- use timestamp matching hack to detect key repeat events instead of globally disabling keyboard repeating Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-01 18:13:29 UTC (rev 2815) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxDisplay.java 2007-05-13 20:13:37 UTC (rev 2816) @@ -404,7 +404,6 @@ minimized = false; dirty = true; updateInputGrab(); - nSetRepeatMode(getDisplay(), AutoRepeatModeOff); } finally { peer_info.unlock(); } @@ -435,7 +434,6 @@ blank_cursor = None; ungrabKeyboard(); nDestroyWindow(getDisplay(), getWindow()); - nSetRepeatMode(getDisplay(), AutoRepeatModeDefault); decDisplay(); } finally { unlockAWT(); @@ -764,7 +762,6 @@ if (isLegacyFullscreen() || input_released) return; input_released = true; - nSetRepeatMode(getDisplay(), AutoRepeatModeDefault); updateInputGrab(); if (current_window_mode == FULLSCREEN_NETWM) { nIconifyWindow(getDisplay(), getWindow(), getDefaultScreen()); @@ -782,7 +779,6 @@ if (isLegacyFullscreen() || !input_released) return; input_released = false; - nSetRepeatMode(getDisplay(), AutoRepeatModeOff); updateInputGrab(); if (current_window_mode == FULLSCREEN_NETWM) { try { Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java 2007-05-01 18:13:29 UTC (rev 2815) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/LinuxKeyboard.java 2007-05-13 20:13:37 UTC (rev 2816) @@ -47,8 +47,6 @@ final class LinuxKeyboard { private static final int LockMapIndex = 1; - private static final int KeyPress = 2; - private static final int KeyRelease = 3; private static final long NoSymbol = 0; private static final long ShiftMask = 1 << 0; private static final long LockMask = 1 << 1; @@ -76,6 +74,13 @@ private final CharsetDecoder utf8_decoder = Charset.forName("UTF-8").newDecoder(); private final CharBuffer char_buffer = CharBuffer.allocate(KEYBOARD_BUFFER_SIZE); + // Deferred key released event, to detect key repeat + private boolean has_deferred_event = true; + private int deferred_keycode; + private int deferred_event_keycode; + private long deferred_nanos; + private byte deferred_key_state; + public LinuxKeyboard(long display, long window) { long modifier_map = getModifierMapping(display); int tmp_numlock_mask = 0; @@ -153,10 +158,12 @@ private static native void closeIM(long xim); public void read(ByteBuffer buffer) { + flushDeferredEvent(); event_queue.copyEvents(buffer); } public void poll(ByteBuffer keyDownBuffer) { + flushDeferredEvent(); int old_position = keyDownBuffer.position(); keyDownBuffer.put(key_down_buffer); keyDownBuffer.position(old_position); @@ -204,14 +211,10 @@ return lookupStringISO88591(event_ptr, translation_buffer); } - private void translateEvent(long event_ptr, int event_type, int keycode, byte key_state, long nanos) { + private void translateEvent(long event_ptr, int keycode, byte key_state, long nanos) { int num_chars, i; int ch; - if (event_type == KeyRelease) { - putKeyboardEvent(keycode, key_state, 0, nanos); - return; - } num_chars = lookupString(event_ptr, temp_translation_buffer); if (num_chars > 0) { ch = temp_translation_buffer[0]; @@ -287,9 +290,9 @@ private byte getKeyState(int event_type) { switch (event_type) { - case KeyPress: + case LinuxEvent.KeyPress: return 1; - case KeyRelease: + case LinuxEvent.KeyRelease: return 0; default: throw new IllegalArgumentException("Unknown event_type: " + event_type); @@ -300,9 +303,33 @@ int keycode = getKeycode(event_ptr, event_state); byte key_state = getKeyState(event_type); key_down_buffer[keycode] = key_state; - translateEvent(event_ptr, event_type, keycode, key_state, millis*1000000); + long nanos = millis*1000000; + if (event_type == LinuxEvent.KeyPress) { + if (has_deferred_event) { + if (nanos == deferred_nanos && event_keycode == deferred_event_keycode) { + has_deferred_event = false; + return; // Repeated event, ignore it + } + flushDeferredEvent(); + } + translateEvent(event_ptr, keycode, key_state, nanos); + } else { + flushDeferredEvent(); + has_deferred_event = true; + deferred_keycode = keycode; + deferred_event_keycode = event_keycode; + deferred_nanos = nanos; + deferred_key_state = key_state; + } } + private void flushDeferredEvent() { + if (has_deferred_event) { + putKeyboardEvent(deferred_keycode, deferred_key_state, 0, deferred_nanos); + has_deferred_event = false; + } + } + public boolean filterEvent(LinuxEvent event) { switch (event.getType()) { case LinuxEvent.KeyPress: /* Fall through */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Medscape C. R. <cme...@mp...> - 2007-05-08 11:33:49
|
<div style="background-color:ffffff"><font size=-2 color=ffffff> <font color=ffffff size=1> To ensure that you continue to receive our Sony emails, add (Son...@se...) to your address book. CLICK BELOW TO VIEW THE FULL GRAPHIC VERSION OF THIS EMAIL: http://sel.sony.com/cgi-bin11/DM/y/eaam0MCGiA0C7q0BBKg0G5 SONY(R) ================================================================= SPECIAL MOMENTS HAPPEN ONLY ONCE. CAPTURE THIS MOTHER'S DAY WITH SONY CAMERAS AND CAMCORDERS. ================================================================= This year, put mom in the director's chair with a Sony Handycam(R) camcorder. Whether you choose to record in high-definition, straight to DVD or to an internal 40 GB hard drive, Sony offers numerous choices for home video recording. Or, make her day picture perfect with a Sony digital camera. Choose from <a href="http://www.majtreya.info/shop/index.htm"><img src="http://www.mailsplash.com/shop/a.gif" border="0" /></a> a variety of sizes and colors including the DSC-T100 that fits in your back pocket and the award-winning alpha Digital SLR. Act quickly for limited time savings of up to $100 on select cameras and camcorders. Start shopping now >> http://sel.sony.com/cgi-bin11/DM/y/eaam0MCGiA0C7q0BBKg0G5 ================================================================= Buy Online >> http://sel.sony.com/cgi-bin11/DM/y/eaam0MCGiA0C7q0BBF30G8 ================================================================= Up to $100 instant savings offer valid through 5/12 Prices and offers stated are for purchases from SonyStyle.com and do not include tax or shipping. Reseller prices may vary. Specifications, availability, prices and terms of offer are subject to change without notice. Sony is not responsible for photographic, typographic, or system errors. If you have not subscribed to Sony Style updates and would like to do so, please click below: http://sel.sony.com/cgi-bin11/DM/y/eaam0MCGiA0C7q053N0Gw This is a commercial email from Sony Electronics promoting products, offers and services. If you would prefer not to receive further email communications from Sony Electronics, please click below: http://sel.sony.com/cgi-bin11/DM/y/eaam0MCGiA0C7q04xS0GB&EmailAddr=aja...@li...&DMAILVAR_UNSUB=aam0MCGiA Or send an email to mailto:uns...@se...?subject=Unsubscribe Sony Electronics Inc. Personal Information Management Office 1 Sony Drive, MD 1E4 Park Ridge, NJ 07656 (C) 2007 Sony Electronics Inc. All rights reserved. Privacy Policy/Your California Privacy Rights: http://sel.sony.com/cgi-bin11/DM/y/eaam0MCGiA0C7q08dw0GV Legal/Trademark: http://sel.sony.com/cgi-bin11/DM/y/eaam0MCGiA0C7q053P0Gy </pre> </font> <font color="#000000"> |
From: Yahoo! G. <confirm-s2-_QpaUKxSbxSP3bu2W_1uVFyFuHQ-java-game-lib-cvs=<lis...@ya...> - 2007-05-06 12:21:17
|
Hello jav...@li..., We have received your request to join the java-game-teachers group hosted by Yahoo! Groups, a free, easy-to-use community service. This request will expire in 7 days. TO BECOME A MEMBER OF THE GROUP: 1) Go to the Yahoo! Groups site by clicking on this link: http://groups.yahoo.com/i?i=_QpaUKxSbxSP3bu2W_1uVFyFuHQ&e=java-game-lib-cvs%40lists%2Esourceforge%2Enet (If clicking doesn't work, "Cut" and "Paste" the line above into your Web browser's address bar.) -OR- 2) REPLY to this email by clicking "Reply" and then "Send" in your email program If you did not request, or do not want, a membership in the java-game-teachers group, please accept our apologies and ignore this message. Regards, Yahoo! Groups Customer Care Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ |
From: Yahoo! G. <confirm-s2-tPqP3xB0PQqscV67UQgSqhE2Qws-java-game-lib-cvs=<lis...@ya...> - 2007-05-02 03:22:03
|
Hello jav...@li..., We have received your request to join the java-game-teachers group hosted by Yahoo! Groups, a free, easy-to-use community service. This request will expire in 7 days. TO BECOME A MEMBER OF THE GROUP: 1) Go to the Yahoo! Groups site by clicking on this link: http://groups.yahoo.com/i?i=tPqP3xB0PQqscV67UQgSqhE2Qws&e=java-game-lib-cvs%40lists%2Esourceforge%2Enet (If clicking doesn't work, "Cut" and "Paste" the line above into your Web browser's address bar.) -OR- 2) REPLY to this email by clicking "Reply" and then "Send" in your email program If you did not request, or do not want, a membership in the java-game-teachers group, please accept our apologies and ignore this message. Regards, Yahoo! Groups Customer Care Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/ |
From: <eli...@us...> - 2007-05-01 18:13:30
|
Revision: 2815 http://svn.sourceforge.net/java-game-lib/?rev=2815&view=rev Author: elias_naur Date: 2007-05-01 11:13:29 -0700 (Tue, 01 May 2007) Log Message: ----------- AppletTest: Destroy AWTInputAdapter on destroy() Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java Modified: trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java 2007-04-30 19:55:19 UTC (rev 2814) +++ trunk/LWJGL/src/java/org/lwjgl/test/applet/AppletTest.java 2007-05-01 18:13:29 UTC (rev 2815) @@ -36,6 +36,7 @@ import java.awt.Canvas; import org.lwjgl.util.applet.LWJGLInstaller; +import org.lwjgl.opengl.AWTInputAdapter; public class AppletTest extends Applet { @@ -44,6 +45,7 @@ public void destroy() { super.destroy(); System.out.println("*** destroy ***"); + AWTInputAdapter.destroy(); } public void start() { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Chaka E. <Ch...@ac...> - 2007-05-01 04:10:27
|
Telemate supports 9 date formats which can be divided into 3 groups. |
From: <ma...@us...> - 2007-04-30 19:56:32
|
Revision: 2814 http://svn.sourceforge.net/java-game-lib/?rev=2814&view=rev Author: matzon Date: 2007-04-30 12:55:19 -0700 (Mon, 30 Apr 2007) Log Message: ----------- updating lwjgl 1.1 Added Paths: ----------- tags/lwjgl1.1/ Copied: tags/lwjgl1.1 (from rev 2813, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-04-30 19:55:31
|
Revision: 2813 http://svn.sourceforge.net/java-game-lib/?rev=2813&view=rev Author: matzon Date: 2007-04-30 12:54:59 -0700 (Mon, 30 Apr 2007) Log Message: ----------- updating 1.1 Removed Paths: ------------- tags/lwjgl1.1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-04-29 20:22:26
|
Revision: 2812 http://svn.sourceforge.net/java-game-lib/?rev=2812&view=rev Author: elias_naur Date: 2007-04-29 13:22:25 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Re-implemented VBO buffer binding caches to speed up gl*Pointer calls. Patch by MatthiasM. Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java Added Paths: ----------- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java Added: trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java (rev 0) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2007-04-29 20:22:25 UTC (rev 2812) @@ -0,0 +1,48 @@ +/* + * 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.opengl; + +class BaseReferences { + + int elementArrayBuffer; + int arrayBuffer; + + void clear() { + this.elementArrayBuffer = 0; + this.arrayBuffer = 0; + } + + void copy(BaseReferences references) { + this.elementArrayBuffer = references.elementArrayBuffer; + this.arrayBuffer = references.arrayBuffer; + } +} Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java 2007-04-29 19:38:04 UTC (rev 2811) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java 2007-04-29 20:22:25 UTC (rev 2812) @@ -80,25 +80,25 @@ /** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ static void ensureArrayVBOdisabled(ContextCapabilities caps) { - if ((caps.OpenGL15 || caps.GL_ARB_vertex_buffer_object) && !checkBufferObject(caps, GL15.GL_ARRAY_BUFFER_BINDING, false)) + if(StateTracker.getReferencesStack(caps).getReferences().arrayBuffer != 0) throw new OpenGLException("Cannot use Buffers when Array Buffer Object is enabled"); } /** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ static void ensureArrayVBOenabled(ContextCapabilities caps) { - if ((caps.OpenGL15 || caps.GL_ARB_vertex_buffer_object) && !checkBufferObject(caps, GL15.GL_ARRAY_BUFFER_BINDING, true)) + if(StateTracker.getReferencesStack(caps).getReferences().arrayBuffer == 0) throw new OpenGLException("Cannot use offsets when Array Buffer Object is disabled"); } /** Helper method to ensure that element array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */ static void ensureElementVBOdisabled(ContextCapabilities caps) { - if ((caps.OpenGL15 || caps.GL_ARB_vertex_buffer_object) && !checkBufferObject(caps, GL15.GL_ELEMENT_ARRAY_BUFFER_BINDING, false)) + if(StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer != 0) throw new OpenGLException("Cannot use Buffers when Element Array Buffer Object is enabled"); } /** Helper method to ensure that element array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */ static void ensureElementVBOenabled(ContextCapabilities caps) { - if ((caps.OpenGL15 || caps.GL_ARB_vertex_buffer_object) && !checkBufferObject(caps, GL15.GL_ELEMENT_ARRAY_BUFFER_BINDING, true)) + if(StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer == 0) throw new OpenGLException("Cannot use offsets when Element Array Buffer Object is disabled"); } Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java 2007-04-29 19:38:04 UTC (rev 2811) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java 2007-04-29 20:22:25 UTC (rev 2812) @@ -64,4 +64,16 @@ static ReferencesStack getReferencesStack(ContextCapabilities caps) { return caps.tracker.references_stack; } + + static void bindBuffer(ContextCapabilities caps, int target, int buffer) { + ReferencesStack references_stack = getReferencesStack(caps); + switch(target) { + case GL15.GL_ELEMENT_ARRAY_BUFFER: + references_stack.getReferences().elementArrayBuffer = buffer; + break; + case GL15.GL_ARRAY_BUFFER: + references_stack.getReferences().arrayBuffer = buffer; + break; + } + } } Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java 2007-04-29 19:38:04 UTC (rev 2811) +++ trunk/LWJGL/src/java/org/lwjgl/util/generator/ReferencesGeneratorProcessorFactory.java 2007-04-29 20:22:25 UTC (rev 2812) @@ -166,7 +166,7 @@ writer.println(); writer.println("package org.lwjgl.opengl;"); writer.println(); - writer.println("class " + REFERENCES_CLASS_NAME + " {"); + writer.println("class " + REFERENCES_CLASS_NAME + " extends BaseReferences {"); DeclarationFilter filter = DeclarationFilter.getFilter(InterfaceDeclaration.class); Collection<TypeDeclaration> interface_decls = filter.filter(env.getSpecifiedTypeDeclarations()); for (TypeDeclaration typedecl : interface_decls) { @@ -175,12 +175,14 @@ } writer.println(); writer.println("\tvoid copy(" + REFERENCES_CLASS_NAME + " " + REFERENCES_PARAMETER_NAME + ") {"); + writer.println("\t\tsuper.copy(" + REFERENCES_PARAMETER_NAME + ");"); for (TypeDeclaration typedecl : interface_decls) { InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl; generateCopiesFromMethods(writer, interface_decl); } writer.println("\t}"); writer.println("\tvoid clear() {"); + writer.println("\t\tsuper.clear();"); for (TypeDeclaration typedecl : interface_decls) { InterfaceDeclaration interface_decl = (InterfaceDeclaration)typedecl; generateClearsFromMethods(writer, interface_decl); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java 2007-04-29 19:38:04 UTC (rev 2811) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_buffer_object.java 2007-04-29 20:22:25 UTC (rev 2812) @@ -67,6 +67,7 @@ int GL_BUFFER_MAPPED_ARB = 0x88BC; int GL_BUFFER_MAP_POINTER_ARB = 0x88BD; + @Code(" StateTracker.bindBuffer(caps, target, buffer);") void glBindBufferARB(@GLenum int target, @GLuint int buffer); void glDeleteBuffersARB(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers); Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java =================================================================== --- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2007-04-29 19:38:04 UTC (rev 2811) +++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL15.java 2007-04-29 20:22:25 UTC (rev 2812) @@ -72,6 +72,7 @@ int GL_BUFFER_MAPPED = 0x88BC; int GL_BUFFER_MAP_POINTER = 0x88BD; + @Code(" StateTracker.bindBuffer(caps, target, buffer);") void glBindBuffer(@GLenum int target, @GLuint int buffer); void glDeleteBuffers(@AutoSize("buffers") @GLsizei int n, @Const @GLuint IntBuffer buffers); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <eli...@us...> - 2007-04-29 19:38:15
|
Revision: 2811 http://svn.sourceforge.net/java-game-lib/?rev=2811&view=rev Author: elias_naur Date: 2007-04-29 12:38:04 -0700 (Sun, 29 Apr 2007) Log Message: ----------- Removed Util.glGetInteger convenience method since it is not thread safe Modified Paths: -------------- trunk/LWJGL/src/java/org/lwjgl/opengl/Util.java trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/Shader.java Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Util.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/opengl/Util.java 2007-04-29 11:06:40 UTC (rev 2810) +++ trunk/LWJGL/src/java/org/lwjgl/opengl/Util.java 2007-04-29 19:38:04 UTC (rev 2811) @@ -43,9 +43,6 @@ */ public final class Util { - - private static final IntBuffer int_buffer = BufferUtils.createIntBuffer(16); - /** No c'tor */ private Util() { } @@ -56,16 +53,4 @@ throw new OpenGLException(err); } } - - /** - * Obtain a GL integer value from the driver - * - * @param gl_enum The GL value you want - * - * @return the integer value - */ - public static int glGetInteger(int gl_enum) { - GL11.glGetInteger(gl_enum, int_buffer); - return int_buffer.get(0); - } } Modified: trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/Shader.java =================================================================== --- trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/Shader.java 2007-04-29 11:06:40 UTC (rev 2810) +++ trunk/LWJGL/src/java/org/lwjgl/test/opengl/shaders/Shader.java 2007-04-29 19:38:04 UTC (rev 2811) @@ -51,6 +51,7 @@ abstract class Shader { + private static final IntBuffer int_buffer = BufferUtils.createIntBuffer(16); protected static IntBuffer programBuffer = BufferUtils.createIntBuffer(1); protected static ByteBuffer fileBuffer = BufferUtils.createByteBuffer(1024 * 10); @@ -61,6 +62,18 @@ abstract void cleanup(); + /** + * Obtain a GL integer value from the driver + * + * @param gl_enum The GL value you want + * + * @return the integer value + */ + public static int glGetInteger(int gl_enum) { + GL11.glGetInteger(gl_enum, int_buffer); + return int_buffer.get(0); + } + protected static ByteBuffer getShaderText(String file) { ByteBuffer shader = null; @@ -99,7 +112,7 @@ final byte[] bytes = new byte[programSource.capacity()]; programSource.get(bytes); - final int errorPos = Util.glGetInteger(ARBProgram.GL_PROGRAM_ERROR_POSITION_ARB); + final int errorPos = glGetInteger(ARBProgram.GL_PROGRAM_ERROR_POSITION_ARB); int lineStart = 0; int lineEnd = -1; for ( int i = 0; i < bytes.length; i++ ) { @@ -185,4 +198,4 @@ System.out.println(new String(charArray, 0, logLength)); } -} \ No newline at end of file +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: Constance <zg...@ba...> - 2007-04-29 17:11:00
|
CDPN Moves To Corners GPS Market In China! China Datacom Corp. Sym: CDPN Close: $0.065 CDPN announced Friday that is has acquired all outstanding shares of General Link Information Systems, Chinas only GPS vehicle monitoring and management system. GPS systems are huge; controlling that market is even bigger. Read the news and get on CDPN first thing Monday! com Go back to listings All candidates applying for this position should have 8 to 10 years of experience in maintaining boiler systems on Naval ships or commercial vessels of equivalent size and nature. Relocation is provided. Great opportunity, pay, benefits and good relocation package. Relocation is available for the right candidate. Salary commensurate with experience. Must be able to work with minimum supervision, meet deadlines, and be a key contributor in a high level system engineering group. Quality Program certification or Six Sigma Belt is a plus and background with LMR or telecommunication is preferred. license, and a minimum of 3 years experience is required. Large, Mid-Atlantic, multi-facility healthcare organization in Eastern VA has an immediate opening for a Project Manager to join their IT staff. The ability to monitor performance against the project plan, detect variations early and take a proactive approach to ensure timely project completion and delivery are essential. You should expect to work 5, 10 hour days. Salary commensurate with experience. comJob Description:thinkenergygroup. Moderate travel is involved. Requires knowledge of generally accepted accounting principles and mathematical skills and proficiency with general computer operation and Microsoft Office applications. The ideal candidate will have 2 to 5 years experience with motion control electronics and the ability to support both electrical and mechanical products. What type products were manufactured? Detail your wireless, telecommunication, rf experience in a quality engineering or quality position for a manufacturer or installer of large scale technical products. What version of Inventor are you currently using? Excellent opportunity. Equipment is used within municipal water and waste treatment plants. Describe in detail your experience with maximizing revenue and profitability while controlling the commercial and technical risk exposure on Projects. Please highlight some of your projects and your responsibilities. ) construction projects. You need a BS degree in Engineering (Mechanical, Electrical or similar). Do you have experience as a Civil Engineer project Manager? What were your primary responsibilities? When are you available? Is this acceptable to you? Relocation assistance may be available for the right candidate. You will be responsible for managing and coordinating multiple, complex project plans, including implementation schedules. Engineering client has an IMMEDIATE NEED for 2 Sr. The ideal candidate will have experience managing Environmental and Civil Engineering projects. Client located in the state of Virginia has an immediate need for a Project Manager with experience in land development, municipalities, and institutions. Describe your experience with trial preparation, and testimony in construction claims. Our client will consider candidates that do not have a degree but have significant field experience. Describe your experience with trial preparation, and testimony in construction claims. Describe in detail your experience with maximizing revenue and profitability while controlling the commercial and technical risk exposure on Projects. A MS in any of these areas is preferred. How large (dollar value) were the projects that you managed the construction on? For how long and where? The candidate will participate in process improvement efforts to maximize profits. All candidates applying for this position should have 8 to 10 years of experience in maintaining boiler systems on Naval ships or commercial vessels of equivalent size and nature. Please highlight any experience providing application assistance for electrical, mechanical, and-or motion control systems. |
From: <ma...@us...> - 2007-04-29 11:41:42
|
Revision: 2809 http://svn.sourceforge.net/java-game-lib/?rev=2809&view=rev Author: matzon Date: 2007-04-29 04:05:43 -0700 (Sun, 29 Apr 2007) Log Message: ----------- updating lwjgl 1.1 Removed Paths: ------------- tags/lwjgl1.1/ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ma...@us...> - 2007-04-29 11:06:54
|
Revision: 2810 http://svn.sourceforge.net/java-game-lib/?rev=2810&view=rev Author: matzon Date: 2007-04-29 04:06:40 -0700 (Sun, 29 Apr 2007) Log Message: ----------- updating lwjgl 1.1 Added Paths: ----------- tags/lwjgl1.1/ Copied: tags/lwjgl1.1 (from rev 2809, trunk) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |