From 8363df5da5794faf10478789954992cef0c0d50f Mon Sep 17 00:00:00 2001
From: Sven Gothel <sgothel@jausoft.com>
Date: Thu, 10 Oct 2013 13:16:39 +0200
Subject: Bug 852: Validate CPU sourced data API is allowed, throw exception if
 not. GLContext: isCPUSourcedAvail() -> isCPUDataSourcingAvail()

---
 make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

(limited to 'make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java')

diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
index c769ddcfa..30047278b 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java
@@ -334,7 +334,16 @@ private final boolean checkBufferObject(boolean extensionAvail,
   }
 }  
 
+private final void validateCPUSourcedAvail() {
+    if(!_context.isCPUDataSourcingAvail()) {
+        throw new GLException("CPU data sourcing n/a w/ "+_context);
+    }
+}
+
 private final boolean checkArrayVBOUnbound(boolean throwException) { 
+  if(throwException) {
+      validateCPUSourcedAvail();
+  }
   return checkBufferObject(haveGL15 || haveARBVertexBufferObject,
                            haveARBVertexArrayObject, // allowVAO
                            false, // bound
@@ -351,6 +360,9 @@ private final boolean checkArrayVBOBound(boolean throwException) {
 }
 
 private final boolean checkElementVBOUnbound(boolean throwException) { 
+  if(throwException) {
+      validateCPUSourcedAvail();
+  }
   return checkBufferObject(haveGL15 || haveARBVertexBufferObject,
                            haveARBVertexArrayObject, // allowVAO
                            false, // bound
@@ -367,6 +379,9 @@ private final boolean checkElementVBOBound(boolean throwException) {
 }
 
 private final boolean checkIndirectVBOUnbound(boolean throwException) { 
+  if(throwException) {
+      validateCPUSourcedAvail();
+  }
   return checkBufferObject(haveGL15 || haveARBVertexBufferObject,
                            haveARBVertexArrayObject, // allowVAO
                            false, // bound
-- 
cgit v1.2.3