Moved BO code from GL11 into BufferObjectTracker

This commit is contained in:
Elias Naur 2005-02-08 19:12:56 +00:00
parent 2632148791
commit 8489f336a3
2 changed files with 23 additions and 15 deletions

View File

@ -61,6 +61,26 @@ final class BufferObjectTracker {
attrib_stack = new StateStack(stack_size, 0);
}
static void popAttrib() {
if ((getClientAttribStack().popState() & GL11.GL_CLIENT_VERTEX_ARRAY_BIT) != 0) {
getVBOArrayStack().popState();
getVBOElementStack().popState();
getPBOPackStack().popState();
getPBOUnpackStack().popState();
}
}
static void pushAttrib(int mask) {
getClientAttribStack().pushState();
getClientAttribStack().setState(mask);
if ((mask & GL11.GL_CLIENT_VERTEX_ARRAY_BIT) != 0) {
getVBOArrayStack().pushState();
getVBOElementStack().pushState();
getPBOPackStack().pushState();
getPBOUnpackStack().pushState();
}
}
static StateStack getVBOArrayStack() {
return current_tracker.vbo_array_stack;
}

View File

@ -1426,25 +1426,13 @@ public final class GL11 {
public static native void glPopMatrix();
public static void glPushClientAttrib(int mask) {
BufferObjectTracker.getClientAttribStack().pushState();
BufferObjectTracker.getClientAttribStack().setState(mask);
if ((mask & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) {
BufferObjectTracker.getVBOArrayStack().pushState();
BufferObjectTracker.getVBOElementStack().pushState();
BufferObjectTracker.getPBOPackStack().pushState();
BufferObjectTracker.getPBOUnpackStack().pushState();
}
BufferObjectTracker.pushAttrib(mask);
nglPushClientAttrib(mask);
}
private static native void nglPushClientAttrib(int mask);
public static void glPopClientAttrib() {
if ((BufferObjectTracker.getClientAttribStack().popState() & GL_CLIENT_VERTEX_ARRAY_BIT) != 0) {
BufferObjectTracker.getVBOArrayStack().popState();
BufferObjectTracker.getVBOElementStack().popState();
BufferObjectTracker.getPBOPackStack().popState();
BufferObjectTracker.getPBOUnpackStack().popState();
}
BufferObjectTracker.popAttrib();
nglPopClientAttrib();
}
private static native void nglPopClientAttrib();
@ -1675,4 +1663,4 @@ public final class GL11 {
public static native void glStencilOp(int fail, int zfail, int zpass);
public static native void glStencilMask(int mask);
public static native void glViewport(int x, int y, int width, int height);
}
}