You can subscribe to this list here.
| 2002 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(134) |
Sep
(52) |
Oct
(13) |
Nov
(342) |
Dec
(163) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2003 |
Jan
(44) |
Feb
(62) |
Mar
(158) |
Apr
(38) |
May
(70) |
Jun
(58) |
Jul
(104) |
Aug
(207) |
Sep
(83) |
Oct
(122) |
Nov
(23) |
Dec
(49) |
| 2004 |
Jan
(119) |
Feb
(132) |
Mar
(192) |
Apr
(140) |
May
(77) |
Jun
(74) |
Jul
(201) |
Aug
(63) |
Sep
(102) |
Oct
(70) |
Nov
(173) |
Dec
(78) |
| 2005 |
Jan
(174) |
Feb
(197) |
Mar
(105) |
Apr
(59) |
May
(77) |
Jun
(43) |
Jul
(21) |
Aug
(18) |
Sep
(47) |
Oct
(37) |
Nov
(74) |
Dec
(50) |
| 2006 |
Jan
(44) |
Feb
(19) |
Mar
(32) |
Apr
(24) |
May
(31) |
Jun
(55) |
Jul
(138) |
Aug
(28) |
Sep
(12) |
Oct
(41) |
Nov
(58) |
Dec
(24) |
| 2007 |
Jan
(28) |
Feb
(14) |
Mar
(10) |
Apr
(68) |
May
(30) |
Jun
(26) |
Jul
(18) |
Aug
(63) |
Sep
(19) |
Oct
(29) |
Nov
(20) |
Dec
(10) |
| 2008 |
Jan
(38) |
Feb
(7) |
Mar
(37) |
Apr
(120) |
May
(41) |
Jun
(36) |
Jul
(39) |
Aug
(24) |
Sep
(28) |
Oct
(30) |
Nov
(36) |
Dec
(75) |
| 2009 |
Jan
(46) |
Feb
(22) |
Mar
(50) |
Apr
(70) |
May
(134) |
Jun
(105) |
Jul
(75) |
Aug
(34) |
Sep
(38) |
Oct
(34) |
Nov
(19) |
Dec
(20) |
| 2010 |
Jan
(11) |
Feb
(20) |
Mar
(65) |
Apr
(83) |
May
(104) |
Jun
(73) |
Jul
(78) |
Aug
(57) |
Sep
(43) |
Oct
(35) |
Nov
(9) |
Dec
(4) |
| 2011 |
Jan
(21) |
Feb
(11) |
Mar
(18) |
Apr
(10) |
May
(18) |
Jun
(15) |
Jul
(48) |
Aug
(25) |
Sep
(17) |
Oct
(45) |
Nov
(15) |
Dec
(12) |
| 2012 |
Jan
(21) |
Feb
(9) |
Mar
(12) |
Apr
(9) |
May
(9) |
Jun
(5) |
Jul
(1) |
Aug
(10) |
Sep
(12) |
Oct
(1) |
Nov
(28) |
Dec
(5) |
| 2013 |
Jan
(4) |
Feb
(1) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
(1) |
Mar
(1) |
Apr
|
May
(2) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2015 |
Jan
(1) |
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
|
Dec
|
| 2016 |
Jan
(2) |
Feb
(1) |
Mar
(1) |
Apr
(1) |
May
(2) |
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
(1) |
Dec
|
| 2017 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
| S | M | T | W | T | F | S |
|---|---|---|---|---|---|---|
|
|
1
(1) |
2
|
3
|
4
|
5
(1) |
6
|
|
7
|
8
|
9
|
10
|
11
(1) |
12
|
13
|
|
14
|
15
|
16
|
17
|
18
|
19
|
20
|
|
21
|
22
|
23
(1) |
24
(1) |
25
|
26
(1) |
27
(1) |
|
28
|
29
(2) |
30
|
|
|
|
|
|
From: <sp...@us...> - 2010-11-29 18:25:35
|
Revision: 3460
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3460&view=rev
Author: spasi
Date: 2010-11-29 18:25:28 +0000 (Mon, 29 Nov 2010)
Log Message:
-----------
Reverted @CachedReference tracking removal.
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/opengl/StateTracker.java
trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.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/EXT_fog_coord.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.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/GL14.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.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 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -31,15 +31,20 @@
*/
package org.lwjgl.opengl;
+import java.nio.Buffer;
+import java.util.Arrays;
+
import static org.lwjgl.opengl.GL11.*;
+import static org.lwjgl.opengl.GL13.*;
+import static org.lwjgl.opengl.GL20.*;
class BaseReferences {
int elementArrayBuffer;
int arrayBuffer;
- //final Buffer[] glVertexAttribPointer_buffer;
- //final Buffer[] glTexCoordPointer_buffer;
- //int glClientActiveTexture;
+ final Buffer[] glVertexAttribPointer_buffer;
+ final Buffer[] glTexCoordPointer_buffer;
+ int glClientActiveTexture;
int vertexArrayObject;
@@ -49,31 +54,29 @@
int indirectBuffer;
BaseReferences(ContextCapabilities caps) {
- /*
int max_vertex_attribs;
- if (caps.OpenGL20 || caps.GL_ARB_vertex_shader)
+ if ( caps.OpenGL20 || caps.GL_ARB_vertex_shader )
max_vertex_attribs = glGetInteger(GL_MAX_VERTEX_ATTRIBS);
else
max_vertex_attribs = 0;
- glVertexAttribPointer_buffer = new Buffer[max_vertex_attribs];
+ glVertexAttribPointer_buffer = new Buffer[max_vertex_attribs];
int max_texture_units;
- if (caps.OpenGL20)
+ if ( caps.OpenGL20 )
max_texture_units = glGetInteger(GL_MAX_TEXTURE_IMAGE_UNITS);
- else if (caps.OpenGL13 || caps.GL_ARB_multitexture)
+ else if ( caps.OpenGL13 || caps.GL_ARB_multitexture )
max_texture_units = glGetInteger(GL_MAX_TEXTURE_UNITS);
else
max_texture_units = 1;
- glTexCoordPointer_buffer = new Buffer[max_texture_units];
- */
+ glTexCoordPointer_buffer = new Buffer[max_texture_units];
}
void clear() {
this.elementArrayBuffer = 0;
this.arrayBuffer = 0;
- //this.glClientActiveTexture = 0;
- //Arrays.fill(glVertexAttribPointer_buffer, null);
- //Arrays.fill(glTexCoordPointer_buffer, null);
+ this.glClientActiveTexture = 0;
+ Arrays.fill(glVertexAttribPointer_buffer, null);
+ Arrays.fill(glTexCoordPointer_buffer, null);
this.vertexArrayObject = 0;
@@ -87,9 +90,9 @@
if ( (mask & GL_CLIENT_VERTEX_ARRAY_BIT) != 0 ) {
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);
+ 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);
this.vertexArrayObject = references.vertexArrayObject;
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -34,10 +34,10 @@
import static org.lwjgl.opengl.GL11.*;
class ReferencesStack {
- private BaseReferences[] references_stack;
+ private References[] references_stack;
private int stack_pos;
- public BaseReferences getReferences() {
+ public References getReferences() {
return references_stack[stack_pos];
}
@@ -49,8 +49,8 @@
references_stack[pos].copy(references_stack[pos - 1], GL_ALL_CLIENT_ATTRIB_BITS);
}
- public BaseReferences popState(int mask) {
- BaseReferences result = references_stack[stack_pos--];
+ public References popState(int mask) {
+ References result = references_stack[stack_pos--];
references_stack[stack_pos].copy(result, ~mask);
result.clear();
@@ -59,17 +59,17 @@
}
private void growStack() {
- BaseReferences[] new_references_stack = new BaseReferences[references_stack.length + 1];
+ 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 BaseReferences(GLContext.getCapabilities());
+ references_stack[references_stack.length - 1] = new References(GLContext.getCapabilities());
}
ReferencesStack() {
ContextCapabilities caps = GLContext.getCapabilities();
- references_stack = new BaseReferences[1];
+ references_stack = new References[1];
stack_pos = 0;
for (int i = 0; i < references_stack.length; i++)
- references_stack[i] = new BaseReferences(caps);
+ references_stack[i] = new References(caps);
}
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -81,7 +81,7 @@
references_stack.pushState();
}
- static BaseReferences getReferences(ContextCapabilities caps) {
+ static References getReferences(ContextCapabilities caps) {
return caps.tracker.references_stack.getReferences();
}
Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -596,7 +596,7 @@
cachedReference != null &&
(mode != Mode.BUFFEROBJECT || param.getAnnotation(BufferObject.class) == null) &&
param.getAnnotation(Result.class) == null) {
- writer.print("\t\tif ( LWJGLUtil.CHECKS ) " + Utils.CHECKS_CLASS_NAME + ".getReferences(caps).");
+ writer.print("\t\tif ( LWJGLUtil.CHECKS ) " + "StateTracker.getReferences(caps).");
if(cachedReference.name().length() > 0) {
writer.print(cachedReference.name());
} else {
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -52,7 +52,7 @@
void glCurrentPaletteMatrixARB(int index);
void glMatrixIndexPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -85,7 +85,7 @@
@Reuse("GL41")
void glVertexAttribLPointer(@GLuint int index, int size, @Constant("GL11.GL_DOUBLE") @GLenum int type, @GLsizei int stride,
- //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check @Const @GLdouble Buffer pointer);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -106,7 +106,7 @@
void glWeightuivARB(@AutoSize("pWeights") int size, @GLuint IntBuffer pWeights);
void glWeightPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -134,7 +134,7 @@
@Reuse("ARBVertexShader")
void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
- //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ @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 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -129,7 +129,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(index = "index", name = "glVertexAttribPointer_buffer")
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_fog_coord.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_fog_coord.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_fog_coord.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -54,7 +54,7 @@
void glFogCoorddEXT(double coord);
void glFogCoordPointerEXT(@AutoType("data") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -158,7 +158,7 @@
void glVertexAttribI4usvEXT(@GLuint int index, @Check("4") @Const @GLushort ShortBuffer v);
void glVertexAttribIPointerEXT(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -55,7 +55,7 @@
void glSecondaryColor3ubEXT(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
void glSecondaryColorPointerEXT(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -75,7 +75,7 @@
void glVertexAttribL4dvEXT(@GLuint int index, @Const @Check("4") DoubleBuffer v);
void glVertexAttribLPointerEXT(@GLuint int index, int size, @Constant("GL11.GL_DOUBLE") @GLenum int type, @GLsizei int stride,
- //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check @Const @GLdouble Buffer pointer);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -225,7 +225,7 @@
void glVariantuivEXT(@GLuint int id, @Check("4") @Const @GLuint IntBuffer pAddr);
void glVariantPointerEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type, @GLuint int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -57,7 +57,7 @@
void glVertexWeightfEXT(float weight);
void glVertexWeightPointerEXT(@GLsizei int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -800,7 +800,7 @@
@DeprecatedGL
void glColorPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@Check
@BufferObject(BufferKind.ArrayVBO)
@Const
@@ -889,7 +889,7 @@
@DeprecatedGL
void glEdgeFlagPointer(int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
@@ -1295,7 +1295,7 @@
@DeprecatedGL
void glNormalPointer(@AutoType("pointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
@@ -1431,7 +1431,7 @@
@DeprecatedGL
void glVertexPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
@@ -1565,7 +1565,7 @@
@DeprecatedGL
void glTexCoordPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- //@CachedReference(index = "GLChecks.getReferences(caps).glClientActiveTexture", name = "glTexCoordPointer_buffer")
+ @CachedReference(index = "StateTracker.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 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -150,7 +150,7 @@
void glActiveTexture(@GLenum int texture);
- //@Code("\t\tGLChecks.getReferences(caps).glClientActiveTexture = texture - GL_TEXTURE0;")
+ @Code("\t\tStateTracker.getReferences(caps).glClientActiveTexture = texture - GL_TEXTURE0;")
@DeprecatedGL
void glClientActiveTexture(@GLenum int texture);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL14.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL14.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL14.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -107,7 +107,7 @@
@DeprecatedGL
void glFogCoordPointer(@AutoType("data") @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -338,7 +338,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(index = "index", name = "glVertexAttribPointer_buffer")
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -204,7 +204,7 @@
void glVertexAttribI4usv(@GLuint int index, @Check("4") @Const @GLushort ShortBuffer v);
void glVertexAttribIPointer(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
- //@CachedReference
+ @CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -390,7 +390,7 @@
@Optional(reason = "Not exposed in ATI Catalyst 10.10c")
void glVertexAttribLPointer(@GLuint int index, int size, @Constant("GL11.GL_DOUBLE") @GLenum int type, @GLsizei int stride,
- //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check @Const @GLdouble Buffer pointer);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java 2010-11-29 17:21:05 UTC (rev 3459)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java 2010-11-29 18:25:28 UTC (rev 3460)
@@ -229,7 +229,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(index="index",name="glVertexAttribPointer_buffer")
+ @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: <sp...@us...> - 2010-11-29 17:21:13
|
Revision: 3459
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3459&view=rev
Author: spasi
Date: 2010-11-29 17:21:05 +0000 (Mon, 29 Nov 2010)
Log Message:
-----------
Fixed ELEMENT_ARRAY_BUFFER_BINDING tracking when VAOs are used.
Removed CachedReference tracking, we never check those.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java
trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java
trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java
trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.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/EXT_fog_coord.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.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/GL14.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java
trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java
Added Paths:
-----------
trunk/LWJGL/src/java/org/lwjgl/opengl/FastIntMap.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/BaseReferences.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -31,27 +31,25 @@
*/
package org.lwjgl.opengl;
-import java.nio.Buffer;
-import java.util.Arrays;
-
import static org.lwjgl.opengl.GL11.*;
-import static org.lwjgl.opengl.GL13.*;
-import static org.lwjgl.opengl.GL20.*;
class BaseReferences {
- int elementArrayBuffer;
- int arrayBuffer;
- final Buffer[] glVertexAttribPointer_buffer;
- final Buffer[] glTexCoordPointer_buffer;
- int glClientActiveTexture;
+ int elementArrayBuffer;
+ int arrayBuffer;
+ //final Buffer[] glVertexAttribPointer_buffer;
+ //final Buffer[] glTexCoordPointer_buffer;
+ //int glClientActiveTexture;
+ int vertexArrayObject;
+
int pixelPackBuffer;
int pixelUnpackBuffer;
int indirectBuffer;
BaseReferences(ContextCapabilities caps) {
+ /*
int max_vertex_attribs;
if (caps.OpenGL20 || caps.GL_ARB_vertex_shader)
max_vertex_attribs = glGetInteger(GL_MAX_VERTEX_ATTRIBS);
@@ -67,35 +65,40 @@
else
max_texture_units = 1;
glTexCoordPointer_buffer = new Buffer[max_texture_units];
- }
+ */
+ }
- void clear() {
- this.elementArrayBuffer = 0;
- this.arrayBuffer = 0;
- this.glClientActiveTexture = 0;
- Arrays.fill(glVertexAttribPointer_buffer, null);
- Arrays.fill(glTexCoordPointer_buffer, null);
+ void clear() {
+ this.elementArrayBuffer = 0;
+ this.arrayBuffer = 0;
+ //this.glClientActiveTexture = 0;
+ //Arrays.fill(glVertexAttribPointer_buffer, null);
+ //Arrays.fill(glTexCoordPointer_buffer, null);
- this.pixelPackBuffer = 0;
- this.pixelUnpackBuffer = 0;
+ this.vertexArrayObject = 0;
- this.indirectBuffer = 0;
- }
+ this.pixelPackBuffer = 0;
+ this.pixelUnpackBuffer = 0;
- void copy(BaseReferences references, int mask) {
- if ( (mask & GL_CLIENT_VERTEX_ARRAY_BIT) != 0 ) {
- 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);
+ this.indirectBuffer = 0;
+ }
- this.indirectBuffer = references.indirectBuffer;
- }
+ void copy(BaseReferences references, int mask) {
+ if ( (mask & GL_CLIENT_VERTEX_ARRAY_BIT) != 0 ) {
+ 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);
- if ( (mask & GL_CLIENT_PIXEL_STORE_BIT) != 0 ) {
+ this.vertexArrayObject = references.vertexArrayObject;
+
+ this.indirectBuffer = references.indirectBuffer;
+ }
+
+ if ( (mask & GL_CLIENT_PIXEL_STORE_BIT) != 0 ) {
this.pixelPackBuffer = references.pixelPackBuffer;
this.pixelUnpackBuffer = references.pixelUnpackBuffer;
- }
- }
+ }
+ }
}
Added: trunk/LWJGL/src/java/org/lwjgl/opengl/FastIntMap.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/FastIntMap.java (rev 0)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/FastIntMap.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -0,0 +1,238 @@
+/*
+ * Copyright 2002-2004 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the
+ * License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS"
+ * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language
+ * governing permissions and limitations under the License.
+ */
+package org.lwjgl.opengl;
+
+import java.util.Iterator;
+
+/**
+ * A hash map using primitive ints as keys rather than objects.
+ *
+ * @author Justin Couch
+ * @author Alex Chaffee (al...@ap...)
+ * @author Stephen Colebourne
+ * @author Nathan Sweet
+ */
+final class FastIntMap<V> implements Iterable<FastIntMap.Entry<V>> {
+
+ private Entry[] table;
+ private int size, mask, capacity, threshold;
+
+ /** Same as: FastIntMap(16, 0.75f); */
+ FastIntMap() {
+ this(16, 0.75f);
+ }
+
+ /** Same as: FastIntMap(initialCapacity, 0.75f); */
+ FastIntMap(int initialCapacity) {
+ this(initialCapacity, 0.75f);
+ }
+
+ FastIntMap(int initialCapacity, float loadFactor) {
+ if ( initialCapacity > 1 << 30 ) throw new IllegalArgumentException("initialCapacity is too large.");
+ if ( initialCapacity < 0 ) throw new IllegalArgumentException("initialCapacity must be greater than zero.");
+ if ( loadFactor <= 0 ) throw new IllegalArgumentException("initialCapacity must be greater than zero.");
+ capacity = 1;
+ while ( capacity < initialCapacity )
+ capacity <<= 1;
+ this.threshold = (int)(capacity * loadFactor);
+ this.table = new Entry[capacity];
+ this.mask = capacity - 1;
+ }
+
+ private int index(final int key) {
+ return index(key, mask);
+ }
+
+ private static int index(final int key, final int mask) {
+ return key & mask;
+ }
+
+ public V put(int key, V value) {
+ final Entry<V>[] table = this.table;
+ int index = index(key);
+
+ // Check if key already exists.
+ for ( Entry<V> e = table[index]; e != null; e = e.next ) {
+ if ( e.key != key ) continue;
+ V oldValue = e.value;
+ e.value = value;
+ return oldValue;
+ }
+
+ table[index] = new Entry<V>(key, value, table[index]);
+
+ if ( size++ >= threshold )
+ rehash(table);
+
+ return null;
+ }
+
+ private void rehash(final Entry<V>[] table) {
+ final int newCapacity = 2 * capacity;
+ final int newMask = newCapacity - 1;
+
+ final Entry<V>[] newTable = new Entry[newCapacity];
+
+ for ( int i = 0, index; i < table.length; i++ ) {
+ Entry<V> e = table[i];
+ if ( e == null ) continue;
+ do {
+ final Entry<V> next = e.next;
+ index = index(e.key, newMask);
+ e.next = newTable[index];
+ newTable[index] = e;
+ e = next;
+ } while ( e != null );
+ }
+
+ this.table = newTable;
+ capacity = newCapacity;
+ mask = newMask;
+ threshold *= 2;
+ }
+
+ public V get(int key) {
+ final int index = index(key);
+ for ( Entry<V> e = table[index]; e != null; e = e.next )
+ if ( e.key == key ) return e.value;
+ return null;
+ }
+
+ public boolean containsValue(Object value) {
+ final Entry<V>[] table = this.table;
+ for ( int i = table.length - 1; i >= 0; i-- )
+ for ( Entry<V> e = table[i]; e != null; e = e.next )
+ if ( e.value.equals(value) ) return true;
+ return false;
+ }
+
+ public boolean containsKey(int key) {
+ final int index = index(key);
+ for ( Entry<V> e = table[index]; e != null; e = e.next )
+ if ( e.key == key ) return true;
+ return false;
+ }
+
+ public V remove(int key) {
+ final int index = index(key);
+
+ Entry<V> prev = table[index];
+ Entry<V> e = prev;
+ while ( e != null ) {
+ Entry<V> next = e.next;
+ if ( e.key == key ) {
+ size--;
+ if ( prev == e )
+ table[index] = next;
+ else
+ prev.next = next;
+ return e.value;
+ }
+ prev = e;
+ e = next;
+ }
+ return null;
+ }
+
+ public int size() {
+ return size;
+ }
+
+ public boolean isEmpty() {
+ return size == 0;
+ }
+
+ public void clear() {
+ final Entry<V>[] table = this.table;
+ for ( int index = table.length - 1; index >= 0; index-- )
+ table[index] = null;
+ size = 0;
+ }
+
+ public EntryIterator iterator() {
+ return new EntryIterator();
+ }
+
+ public class EntryIterator implements Iterator<Entry<V>> {
+
+ private int nextIndex;
+ private Entry<V> current;
+
+ EntryIterator() {
+ reset();
+ }
+
+ public void reset() {
+ current = null;
+ // Find first bucket.
+ final Entry<V>[] table = FastIntMap.this.table;
+ int i;
+ for ( i = table.length - 1; i >= 0; i-- )
+ if ( table[i] != null ) break;
+ nextIndex = i;
+ }
+
+ public boolean hasNext() {
+ if ( nextIndex >= 0 ) return true;
+ Entry e = current;
+ return e != null && e.next != null;
+ }
+
+ public Entry<V> next() {
+ // Next entry in current bucket.
+ Entry<V> e = current;
+ if ( e != null ) {
+ e = e.next;
+ if ( e != null ) {
+ current = e;
+ return e;
+ }
+ }
+ // Use the bucket at nextIndex and find the next nextIndex.
+ final Entry<V>[] table = FastIntMap.this.table;
+ int i = nextIndex;
+ e = current = table[i];
+ while ( --i >= 0 )
+ if ( table[i] != null ) break;
+ nextIndex = i;
+ return e;
+ }
+
+ public void remove() {
+ FastIntMap.this.remove(current.key);
+ }
+ }
+
+ static final class Entry<T> {
+
+ final int key;
+ T value;
+ Entry<T> next;
+
+ Entry(int key, T value, Entry<T> next) {
+ this.key = key;
+ this.value = value;
+ this.next = next;
+ }
+
+ public int getKey() {
+ return key;
+ }
+
+ public T getValue() {
+ return value;
+ }
+
+ }
+
+}
\ No newline at end of file
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/GLChecks.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -63,10 +63,6 @@
private GLChecks() {
}
- static References getReferences(ContextCapabilities caps) {
- return StateTracker.getReferencesStack(caps).getReferences();
- }
-
static int getBufferObjectSize(ContextCapabilities caps, int buffer_enum) {
return glGetBufferParameter(buffer_enum, GL_BUFFER_SIZE);
}
@@ -85,61 +81,61 @@
/** 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( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().arrayBuffer != 0 )
+ if( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).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( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().arrayBuffer == 0 )
+ if( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).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( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer != 0 )
+ if( LWJGLUtil.CHECKS && StateTracker.getElementArrayBufferBound(caps) != 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( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().elementArrayBuffer == 0 )
+ if( LWJGLUtil.CHECKS && StateTracker.getElementArrayBufferBound(caps) == 0 )
throw new OpenGLException("Cannot use offsets when Element Array Buffer Object is disabled");
}
/** Helper method to ensure that array buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
static void ensureIndirectBOdisabled(ContextCapabilities caps) {
- if ( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().indirectBuffer != 0 )
+ if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).indirectBuffer != 0 )
throw new OpenGLException("Cannot use Buffers when Draw Indirect Object is enabled");
}
/** Helper method to ensure that array buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
static void ensureIndirectBOenabled(ContextCapabilities caps) {
- if ( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().indirectBuffer == 0 )
+ if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).indirectBuffer == 0 )
throw new OpenGLException("Cannot use offsets when Draw Indirect Object is disabled");
}
/** Helper method to ensure that pixel pack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
static void ensurePackPBOdisabled(ContextCapabilities caps) {
- if ( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().pixelPackBuffer != 0 )
+ if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).pixelPackBuffer != 0 )
throw new OpenGLException("Cannot use Buffers when Pixel Pack Buffer Object is enabled");
}
/** Helper method to ensure that pixel pack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
static void ensurePackPBOenabled(ContextCapabilities caps) {
- if ( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().pixelPackBuffer == 0 )
+ if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).pixelPackBuffer == 0 )
throw new OpenGLException("Cannot use offsets when Pixel Pack Buffer Object is disabled");
}
/** Helper method to ensure that pixel unpack buffer objects are disabled. If they are enabled, we'll throw an OpenGLException */
static void ensureUnpackPBOdisabled(ContextCapabilities caps) {
- if ( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().pixelUnpackBuffer != 0 )
+ if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).pixelUnpackBuffer != 0 )
throw new OpenGLException("Cannot use Buffers when Pixel Unpack Buffer Object is enabled");
}
/** Helper method to ensure that pixel unpack buffer objects are enabled. If they are disabled, we'll throw an OpenGLException */
static void ensureUnpackPBOenabled(ContextCapabilities caps) {
- if ( LWJGLUtil.CHECKS && StateTracker.getReferencesStack(caps).getReferences().pixelUnpackBuffer == 0 )
+ if ( LWJGLUtil.CHECKS && StateTracker.getReferences(caps).pixelUnpackBuffer == 0 )
throw new OpenGLException("Cannot use offsets when Pixel Unpack Buffer Object is disabled");
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/ReferencesStack.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -34,10 +34,10 @@
import static org.lwjgl.opengl.GL11.*;
class ReferencesStack {
- private References[] references_stack;
+ private BaseReferences[] references_stack;
private int stack_pos;
- public References getReferences() {
+ public BaseReferences getReferences() {
return references_stack[stack_pos];
}
@@ -49,8 +49,8 @@
references_stack[pos].copy(references_stack[pos - 1], GL_ALL_CLIENT_ATTRIB_BITS);
}
- public References popState(int mask) {
- References result = references_stack[stack_pos--];
+ public BaseReferences popState(int mask) {
+ BaseReferences result = references_stack[stack_pos--];
references_stack[stack_pos].copy(result, ~mask);
result.clear();
@@ -59,17 +59,17 @@
}
private void growStack() {
- References[] new_references_stack = new References[references_stack.length + 1];
+ BaseReferences[] new_references_stack = new BaseReferences[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(GLContext.getCapabilities());
+ references_stack[references_stack.length - 1] = new BaseReferences(GLContext.getCapabilities());
}
ReferencesStack() {
ContextCapabilities caps = GLContext.getCapabilities();
- references_stack = new References[1];
+ references_stack = new BaseReferences[1];
stack_pos = 0;
for (int i = 0; i < references_stack.length; i++)
- references_stack[i] = new References(caps);
+ references_stack[i] = new BaseReferences(caps);
}
}
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/StateTracker.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -31,16 +31,22 @@
*/
package org.lwjgl.opengl;
+import java.nio.IntBuffer;
+
import static org.lwjgl.opengl.GL15.*;
import static org.lwjgl.opengl.GL21.*;
import static org.lwjgl.opengl.GL40.*;
final class StateTracker {
+
private ReferencesStack references_stack;
private final StateStack attrib_stack;
private boolean insideBeginEnd;
+ // VAOs are not shareable between contexts, no need to sync or make this static.
+ private final FastIntMap<VAOState> vaoMap = new FastIntMap<VAOState>();
+
StateTracker() {
attrib_stack = new StateStack(0);
}
@@ -75,29 +81,82 @@
references_stack.pushState();
}
- static ReferencesStack getReferencesStack(ContextCapabilities caps) {
- return caps.tracker.references_stack;
+ static BaseReferences getReferences(ContextCapabilities caps) {
+ return caps.tracker.references_stack.getReferences();
}
- static void bindBuffer(ContextCapabilities caps, int target, int buffer) {
- ReferencesStack references_stack = getReferencesStack(caps);
- switch(target) {
- case GL_ELEMENT_ARRAY_BUFFER:
- references_stack.getReferences().elementArrayBuffer = buffer;
- break;
- case GL_ARRAY_BUFFER:
- references_stack.getReferences().arrayBuffer = buffer;
- break;
- case GL_PIXEL_PACK_BUFFER:
- references_stack.getReferences().pixelPackBuffer = buffer;
- break;
- case GL_PIXEL_UNPACK_BUFFER:
- references_stack.getReferences().pixelUnpackBuffer = buffer;
- break;
- case GL_DRAW_INDIRECT_BUFFER:
- references_stack.getReferences().indirectBuffer = buffer;
- break;
+ static void bindBuffer(ContextCapabilities caps, int target, int buffer) {
+ final BaseReferences references = getReferences(caps);
+ switch ( target ) {
+ case GL_ARRAY_BUFFER:
+ references.arrayBuffer = buffer;
+ break;
+ case GL_ELEMENT_ARRAY_BUFFER:
+ // When a vertex array object is currently bound, update
+ // the VAO state instead of client state.
+ if ( references.vertexArrayObject != 0 )
+ caps.tracker.vaoMap.get(references.vertexArrayObject).elementArrayBuffer = buffer;
+ else
+ references.elementArrayBuffer = buffer;
+ break;
+ case GL_PIXEL_PACK_BUFFER:
+ references.pixelPackBuffer = buffer;
+ break;
+ case GL_PIXEL_UNPACK_BUFFER:
+ references.pixelUnpackBuffer = buffer;
+ break;
+ case GL_DRAW_INDIRECT_BUFFER:
+ references.indirectBuffer = buffer;
+ break;
+ }
+ }
- }
- }
-}
+ static void bindVAO(final ContextCapabilities caps, final int array) {
+ final FastIntMap<VAOState> vaoMap = caps.tracker.vaoMap;
+ if ( !vaoMap.containsKey(array) )
+ vaoMap.put(array, new VAOState());
+
+ getReferences(caps).vertexArrayObject = array;
+ }
+
+ static void deleteVAO(final ContextCapabilities caps, final IntBuffer arrays) {
+ for ( int i = arrays.position(); i < arrays.limit(); i++ )
+ deleteVAO(caps, arrays.get(i));
+ }
+
+ static void deleteVAO(final ContextCapabilities caps, final int array) {
+ caps.tracker.vaoMap.remove(array);
+
+ final BaseReferences references = getReferences(caps);
+ if ( references.vertexArrayObject == array )
+ references.vertexArrayObject = 0;
+ }
+
+ /**
+ * Returns the currently bound ELEMENT_ARRAY_BUFFER. If a vertex array
+ * object is currently bound, then the VAO state is returned instead
+ * of the client state.
+ *
+ * @return the currently bound ELEMENT_ARRAY_BUFFER.
+ */
+ static int getElementArrayBufferBound(final ContextCapabilities caps) {
+ final BaseReferences references = getReferences(caps);
+
+ if ( references.vertexArrayObject == 0 )
+ return references.elementArrayBuffer;
+ else
+ return caps.tracker.vaoMap.get(references.vertexArrayObject).elementArrayBuffer;
+ }
+
+ /**
+ * Simple class to help us track VAO state. Currently
+ * only ELEMENT_ARRAY_BUFFER_BINDING is tracked, since
+ * that's the only state we check from tables 6.6-6.9.
+ */
+ private static class VAOState {
+
+ int elementArrayBuffer;
+
+ }
+
+}
\ No newline at end of file
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_matrix_palette.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -52,7 +52,7 @@
void glCurrentPaletteMatrixARB(int index);
void glMatrixIndexPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_attrib_64bit.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -85,7 +85,7 @@
@Reuse("GL41")
void glVertexAttribLPointer(@GLuint int index, int size, @Constant("GL11.GL_DOUBLE") @GLenum int type, @GLsizei int stride,
- @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check @Const @GLdouble Buffer pointer);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_blend.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -106,7 +106,7 @@
void glWeightuivARB(@AutoSize("pWeights") int size, @GLuint IntBuffer pWeights);
void glWeightPointerARB(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_program.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -134,7 +134,7 @@
@Reuse("ARBVertexShader")
void glVertexAttribPointerARB(@GLuint int index, int size, @AutoType("buffer") @GLenum int type, boolean normalized, @GLsizei int stride,
- @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ //@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 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/ARB_vertex_shader.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -129,7 +129,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(index = "index", name = "glVertexAttribPointer_buffer")
+ //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_fog_coord.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_fog_coord.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_fog_coord.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -54,7 +54,7 @@
void glFogCoorddEXT(double coord);
void glFogCoordPointerEXT(@AutoType("data") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_gpu_shader4.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -158,7 +158,7 @@
void glVertexAttribI4usvEXT(@GLuint int index, @Check("4") @Const @GLushort ShortBuffer v);
void glVertexAttribIPointerEXT(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_secondary_color.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -55,7 +55,7 @@
void glSecondaryColor3ubEXT(@GLubyte byte red, @GLubyte byte green, @GLubyte byte blue);
void glSecondaryColorPointerEXT(int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_attrib_64bit.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -75,7 +75,7 @@
void glVertexAttribL4dvEXT(@GLuint int index, @Const @Check("4") DoubleBuffer v);
void glVertexAttribLPointerEXT(@GLuint int index, int size, @Constant("GL11.GL_DOUBLE") @GLenum int type, @GLsizei int stride,
- @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check @Const @GLdouble Buffer pointer);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_shader.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -225,7 +225,7 @@
void glVariantuivEXT(@GLuint int id, @Check("4") @Const @GLuint IntBuffer pAddr);
void glVariantPointerEXT(@GLuint int id, @AutoType("pAddr") @GLenum int type, @GLuint int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/EXT_vertex_weighting.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -57,7 +57,7 @@
void glVertexWeightfEXT(float weight);
void glVertexWeightPointerEXT(@GLsizei int size, @AutoType("pPointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL11.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -800,7 +800,7 @@
@DeprecatedGL
void glColorPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@Check
@BufferObject(BufferKind.ArrayVBO)
@Const
@@ -889,7 +889,7 @@
@DeprecatedGL
void glEdgeFlagPointer(int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
@@ -1295,7 +1295,7 @@
@DeprecatedGL
void glNormalPointer(@AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
@@ -1431,7 +1431,7 @@
@DeprecatedGL
void glVertexPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
@@ -1565,7 +1565,7 @@
@DeprecatedGL
void glTexCoordPointer(int size, @AutoType("pointer") @GLenum int type, @GLsizei int stride,
- @CachedReference(index = "GLChecks.getReferences(caps).glClientActiveTexture", name = "glTexCoordPointer_buffer")
+ //@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 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL13.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -150,7 +150,7 @@
void glActiveTexture(@GLenum int texture);
- @Code("\t\tGLChecks.getReferences(caps).glClientActiveTexture = texture - GL_TEXTURE0;")
+ //@Code("\t\tGLChecks.getReferences(caps).glClientActiveTexture = texture - GL_TEXTURE0;")
@DeprecatedGL
void glClientActiveTexture(@GLenum int texture);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL14.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL14.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL14.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -107,7 +107,7 @@
@DeprecatedGL
void glFogCoordPointer(@AutoType("data") @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL20.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -338,7 +338,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(index = "index", name = "glVertexAttribPointer_buffer")
+ //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL30.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -204,7 +204,7 @@
void glVertexAttribI4usv(@GLuint int index, @Check("4") @Const @GLushort ShortBuffer v);
void glVertexAttribIPointer(@GLuint int index, int size, @GLenum int type, @GLsizei int stride,
- @CachedReference
+ //@CachedReference
@BufferObject(BufferKind.ArrayVBO)
@Check
@Const
@@ -1011,11 +1011,14 @@
*/
int GL_VERTEX_ARRAY_BINDING = 0x85B5;
+ @Code(" StateTracker.bindVAO(caps, array);")
void glBindVertexArray(@GLuint int array);
+ @Code(" StateTracker.deleteVAO(caps, arrays);")
void glDeleteVertexArrays(@AutoSize("arrays") @GLsizei int n, @Const @GLuint IntBuffer arrays);
@Alternate("glDeleteVertexArrays")
+ @Code(" StateTracker.deleteVAO(caps, array);")
void glDeleteVertexArrays(@Constant("1") @GLsizei int n, @Constant(value = "APIUtil.getBufferInt().put(0, array), 0", keepParam = true) int array);
void glGenVertexArrays(@AutoSize("arrays") @GLsizei int n, @OutParameter @GLuint IntBuffer arrays);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/GL41.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -390,7 +390,7 @@
@Optional(reason = "Not exposed in ATI Catalyst 10.10c")
void glVertexAttribLPointer(@GLuint int index, int size, @Constant("GL11.GL_DOUBLE") @GLenum int type, @GLsizei int stride,
- @CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
+ //@CachedReference(index = "index", name = "glVertexAttribPointer_buffer")
@BufferObject(BufferKind.ArrayVBO)
@Check @Const @GLdouble Buffer pointer);
Modified: trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java 2010-11-27 09:38:48 UTC (rev 3458)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/NV_vertex_program.java 2010-11-29 17:21:05 UTC (rev 3459)
@@ -229,7 +229,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(index="index",name="glVertexAttribPointer_buffer")
+ //@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: <sp...@us...> - 2010-11-27 09:38:55
|
Revision: 3458
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3458&view=rev
Author: spasi
Date: 2010-11-27 09:38:48 +0000 (Sat, 27 Nov 2010)
Log Message:
-----------
Added AMD_depth_clamp_separate.
Added Paths:
-----------
trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_depth_clamp_separate.java
Added: trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_depth_clamp_separate.java
===================================================================
--- trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_depth_clamp_separate.java (rev 0)
+++ trunk/LWJGL/src/templates/org/lwjgl/opengl/AMD_depth_clamp_separate.java 2010-11-27 09:38:48 UTC (rev 3458)
@@ -0,0 +1,44 @@
+/*
+ * Copyright (c) 2002-2010 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;
+
+public interface AMD_depth_clamp_separate {
+
+ /**
+ * Accepted by the <cap> parameter of Enable, Disable, and IsEnabled,
+ * and by the <pname> parameter of GetBooleanv, GetIntegerv,
+ * GetFloatv, and GetDoublev:
+ */
+ int GL_DEPTH_CLAMP_NEAR_AMD = 0x901E,
+ GL_DEPTH_CLAMP_FAR_AMD = 0x901F;
+
+}
\ 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: <ka...@us...> - 2010-11-26 20:38:46
|
Revision: 3457
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3457&view=rev
Author: kappa1
Date: 2010-11-26 20:38:39 +0000 (Fri, 26 Nov 2010)
Log Message:
-----------
remove debug code left in WindowsDisplay, thx to MatthiasM.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-11-24 21:48:23 UTC (rev 3456)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/WindowsDisplay.java 2010-11-26 20:38:39 UTC (rev 3457)
@@ -747,11 +747,6 @@
int scan_code = (int)((lParam >>> 16) & 0xFF);
if (keyboard != null) {
keyboard.handleKey((int)wParam, scan_code, extended != 0, state, millis, repeat);
-
- if(captureMouse != -1 && keyboard.isKeyDown(Keyboard.KEY_ESCAPE)) {
- nReleaseCapture();
- captureMouse = -1;
- }
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <ma...@us...> - 2010-11-24 21:48:29
|
Revision: 3456
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3456&view=rev
Author: matzon
Date: 2010-11-24 21:48:23 +0000 (Wed, 24 Nov 2010)
Log Message:
-----------
adding support for zeroing buffers - patch'ish by MatthiasM
Modified Paths:
--------------
trunk/LWJGL/build.xml
trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java
Added Paths:
-----------
trunk/LWJGL/src/native/common/org_lwjgl_BufferUtils.c
Modified: trunk/LWJGL/build.xml
===================================================================
--- trunk/LWJGL/build.xml 2010-11-11 21:25:20 UTC (rev 3455)
+++ trunk/LWJGL/build.xml 2010-11-24 21:48:23 UTC (rev 3456)
@@ -266,6 +266,7 @@
<class name="org.lwjgl.opengl.CallbackUtil" />
<class name="org.lwjgl.opencl.CL" />
<class name="org.lwjgl.opencl.CallbackUtil" />
+ <class name="org.lwjgl.BufferUtils" />
</javah>
</target>
Modified: trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java 2010-11-11 21:25:20 UTC (rev 3455)
+++ trunk/LWJGL/src/java/org/lwjgl/BufferUtils.java 2010-11-24 21:48:23 UTC (rev 3456)
@@ -155,4 +155,41 @@
return buffer.position() << getElementSizeExponent(buffer);
}
+ /** Fill buffer with zeros from position to remaining */
+ public static void zeroBuffer(ByteBuffer b) {
+ zeroBuffer0(b, b.position(), b.remaining());
+ }
+
+ /** Fill buffer with zeros from position to remaining */
+ public static void zeroBuffer(ShortBuffer b) {
+ zeroBuffer0(b, b.position()*2L, b.remaining()*2L);
+ }
+
+ /** Fill buffer with zeros from position to remaining */
+ public static void zeroBuffer(CharBuffer b) {
+ zeroBuffer0(b, b.position()*2L, b.remaining()*2L);
+ }
+
+ /** Fill buffer with zeros from position to remaining */
+ public static void zeroBuffer(IntBuffer b) {
+ zeroBuffer0(b, b.position()*4L, b.remaining()*4L);
+ }
+
+ /** Fill buffer with zeros from position to remaining */
+ public static void zeroBuffer(FloatBuffer b) {
+ zeroBuffer0(b, b.position()*4L, b.remaining()*4L);
+ }
+
+ /** Fill buffer with zeros from position to remaining */
+ public static void zeroBuffer(LongBuffer b) {
+ zeroBuffer0(b, b.position()*8L, b.remaining()*8L);
+ }
+
+ /** Fill buffer with zeros from position to remaining */
+ public static void zeroBuffer(DoubleBuffer b) {
+ zeroBuffer0(b, b.position()*8L, b.remaining()*8L);
+ }
+
+ /** Fill buffer with zeros from position to remaining */
+ private static native void zeroBuffer0(Buffer b, long off, long size);
}
Added: trunk/LWJGL/src/native/common/org_lwjgl_BufferUtils.c
===================================================================
--- trunk/LWJGL/src/native/common/org_lwjgl_BufferUtils.c (rev 0)
+++ trunk/LWJGL/src/native/common/org_lwjgl_BufferUtils.c 2010-11-24 21:48:23 UTC (rev 3456)
@@ -0,0 +1,5 @@
+#include "org_lwjgl_BufferUtils.h"
+
+JNIEXPORT void JNICALL Java_org_lwjgl_BufferUtils_zeroBuffer0(JNIEnv *env, jclass clazz, jobject buffer, jlong offset, jlong size) {
+ memset((char*)(*env)->GetDirectBufferAddress(env, buffer) + (size_t)offset, 0, (size_t)size);
+}
\ 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: <ka...@us...> - 2010-11-11 21:25:27
|
Revision: 3455
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3455&view=rev
Author: kappa1
Date: 2010-11-11 21:25:20 +0000 (Thu, 11 Nov 2010)
Log Message:
-----------
Changed initial alpha value of glClearColor from 1 to 0 which is set when Initialising the Display. This now matches expected OpenGL behaviour. Thanks to Ryanm for spotting this. If you use FBO's make sure your setting glClearColor properly.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
Modified: trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2010-11-05 17:13:56 UTC (rev 3454)
+++ trunk/LWJGL/src/java/org/lwjgl/opengl/Display.java 2010-11-11 21:25:20 UTC (rev 3455)
@@ -905,7 +905,7 @@
private static void initContext() {
// set background clear color
- glClearColor(r, g, b, 1.0f);
+ glClearColor(r, g, b, 0.0f);
// Clear window to avoid the desktop "showing through"
glClear(GL_COLOR_BUFFER_BIT);
update();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <sp...@us...> - 2010-11-05 17:14:02
|
Revision: 3454
http://java-game-lib.svn.sourceforge.net/java-game-lib/?rev=3454&view=rev
Author: spasi
Date: 2010-11-05 17:13:56 +0000 (Fri, 05 Nov 2010)
Log Message:
-----------
Fixed @Reuse + @BufferObject generation.
Modified Paths:
--------------
trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java
Modified: trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java
===================================================================
--- trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2010-10-28 21:39:55 UTC (rev 3453)
+++ trunk/LWJGL/src/java/org/lwjgl/util/generator/JavaMethodsGenerator.java 2010-11-05 17:13:56 UTC (rev 3454)
@@ -75,19 +75,19 @@
printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.CACHEDRESULT, generate_error_checks, context_specific);
}
- // Skip the native function if we're re-using.
Reuse reuse_annotation = method.getAnnotation(Reuse.class);
- if ( reuse_annotation != null )
- return;
-
Alternate alt_annotation = method.getAnnotation(Alternate.class);
if ( alt_annotation == null || (alt_annotation.nativeAlt() && !alt_annotation.skipNative()) ) {
if ( alt_annotation != null && method.getSimpleName().equals(alt_annotation.value()) )
throw new RuntimeException("An alternate function with native code should have a different name than the main function.");
- printJavaNativeStub(writer, method, Mode.NORMAL, generate_error_checks, context_specific);
+
+ if ( reuse_annotation == null )
+ printJavaNativeStub(writer, method, Mode.NORMAL, generate_error_checks, context_specific);
+
if (Utils.hasMethodBufferObjectParameter(method)) {
printMethodWithMultiType(env, type_map, writer, interface_decl, method, TypeInfo.getDefaultTypeInfoMap(method), Mode.BUFFEROBJECT, generate_error_checks, context_specific);
- printJavaNativeStub(writer, method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
+ if ( reuse_annotation == null )
+ printJavaNativeStub(writer, method, Mode.BUFFEROBJECT, generate_error_checks, context_specific);
}
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|