lower opengl requirement to 2.1 when higher versions are unsupported #21

Closed
rdh wants to merge 10 commits from rdh/celeritas:stonecutter into stonecutter
pull from: rdh/celeritas:stonecutter
2 changed files with 18 additions and 18 deletions
Showing only changes of commit 91dc080322 - Show all commits

No files matched your search

@@ -34,42 +34,42 @@ public class APPLEVertexArrayObject {
public static final boolean supported = bindVertexArray != 0;
public static void glBindVertexArray(@NativeType("GLuint") int array) {
public static void glBindVertexArrayAPPLE(@NativeType("GLuint") int array) {
JNI.callV(array, bindVertexArray);
}
public static void nglDeleteVertexArrays(int n, long arrays) {
public static void nglDeleteVertexArraysAPPLE(int n, long arrays) {
JNI.callPV(n, arrays, deleteVertexArrays);
}
public static void glDeleteVertexArrays(@NativeType("GLuint const *") IntBuffer arrays) {
nglDeleteVertexArrays(arrays.remaining(), memAddress(arrays));
public static void glDeleteVertexArraysAPPLE(@NativeType("GLuint const *") IntBuffer arrays) {
nglDeleteVertexArraysAPPLE(arrays.remaining(), memAddress(arrays));
}
public static void glDeleteVertexArrays(@NativeType("GLuint const *") int array) {
public static void glDeleteVertexArraysAPPLE(@NativeType("GLuint const *") int array) {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
IntBuffer arrays = stack.callocInt(1);
arrays.put(0, array);
nglDeleteVertexArrays(1, memAddress(arrays));
nglDeleteVertexArraysAPPLE(1, memAddress(arrays));
} finally {
stack.setPointer(stackPointer);
}
}
public static void nglGenVertexArrays(int n, long arrays) {
public static void nglGenVertexArraysAPPLE(int n, long arrays) {
JNI.callPV(n, arrays, genVertexArrays);
}
public static void glGenVertexArrays(@NativeType("GLuint *") IntBuffer arrays) {
nglGenVertexArrays(arrays.remaining(), memAddress(arrays));
public static void glGenVertexArraysAPPLE(@NativeType("GLuint *") IntBuffer arrays) {
nglGenVertexArraysAPPLE(arrays.remaining(), memAddress(arrays));
}
public static int glGenVertexArrays() {
public static int glGenVertexArraysAPPLE() {
MemoryStack stack = stackGet(); int stackPointer = stack.getPointer();
try {
IntBuffer arrays = stack.callocInt(1);
nglGenVertexArrays(1, memAddress(arrays));
nglGenVertexArraysAPPLE(1, memAddress(arrays));
return arrays.get(0);
} finally {
stack.setPointer(stackPointer);
@@ -23,7 +23,7 @@ public class VAOUtil {
} else if (arbSupported) {
ARBVertexArrayObject.glBindVertexArray(array);
} else if (appleSupported) {
APPLEVertexArrayObject.glBindVertexArray(array);
APPLEVertexArrayObject.glBindVertexArrayAPPLE(array);
} else {
throw new UnsupportedOperationException("VAO not supported");
}
@@ -35,7 +35,7 @@ public class VAOUtil {
} else if (arbSupported) {
ARBVertexArrayObject.nglDeleteVertexArrays(n, arrays);
} else if (appleSupported) {
APPLEVertexArrayObject.nglDeleteVertexArrays(n, arrays);
APPLEVertexArrayObject.nglDeleteVertexArraysAPPLE(n, arrays);
} else {
throw new UnsupportedOperationException("VAO not supported");
}
@@ -47,7 +47,7 @@ public class VAOUtil {
} else if (arbSupported) {
ARBVertexArrayObject.glDeleteVertexArrays(arrays);
} else if (appleSupported) {
APPLEVertexArrayObject.glDeleteVertexArrays(arrays);
APPLEVertexArrayObject.glDeleteVertexArraysAPPLE(arrays);
} else {
throw new UnsupportedOperationException("VAO not supported");
}
@@ -59,7 +59,7 @@ public class VAOUtil {
} else if (arbSupported) {
ARBVertexArrayObject.glDeleteVertexArrays(array);
} else if (appleSupported) {
APPLEVertexArrayObject.glDeleteVertexArrays(array);
APPLEVertexArrayObject.glDeleteVertexArraysAPPLE(array);
} else {
throw new UnsupportedOperationException("VAO not supported");
}
@@ -71,7 +71,7 @@ public class VAOUtil {
} else if (arbSupported) {
ARBVertexArrayObject.nglGenVertexArrays(n, arrays);
} else if (appleSupported) {
APPLEVertexArrayObject.nglGenVertexArrays(n, arrays);
APPLEVertexArrayObject.nglGenVertexArraysAPPLE(n, arrays);
} else {
throw new UnsupportedOperationException("VAO not supported");
}
@@ -83,7 +83,7 @@ public class VAOUtil {
} else if (arbSupported) {
ARBVertexArrayObject.glGenVertexArrays(arrays);
} else if (appleSupported) {
APPLEVertexArrayObject.glGenVertexArrays(arrays);
APPLEVertexArrayObject.glGenVertexArraysAPPLE(arrays);
} else {
throw new UnsupportedOperationException("VAO not supported");
}
@@ -95,7 +95,7 @@ public class VAOUtil {
} else if (arbSupported) {
return ARBVertexArrayObject.glGenVertexArrays();
} else if (appleSupported) {
return APPLEVertexArrayObject.glGenVertexArrays();
return APPLEVertexArrayObject.glGenVertexArraysAPPLE();
} else {
throw new UnsupportedOperationException("VAO not supported");
}