Add Java exceptions to catch RS calls with no context or no surface.

This commit is contained in:
Jason Sams
2009-12-07 12:40:12 -08:00
parent 6d42d80653
commit 771bebb940
11 changed files with 71 additions and 0 deletions

View File

@@ -35,18 +35,22 @@ public class SimpleMesh extends BaseObj {
}
public void bindVertexAllocation(Allocation a, int slot) {
mRS.validate();
mRS.nSimpleMeshBindVertex(mID, a.mID, slot);
}
public void bindIndexAllocation(Allocation a) {
mRS.validate();
mRS.nSimpleMeshBindIndex(mID, a.mID);
}
public Allocation createVertexAllocation(int slot) {
mRS.validate();
return Allocation.createTyped(mRS, mVertexTypes[slot]);
}
public Allocation createIndexAllocation() {
mRS.validate();
return Allocation.createTyped(mRS, mIndexType);
}
@@ -162,6 +166,7 @@ public class SimpleMesh extends BaseObj {
}
public SimpleMesh create() {
mRS.validate();
SimpleMesh sm = internalCreate(mRS, this);
sm.mVertexTypes = new Type[mVertexTypeCount];
for(int ct=0; ct < mVertexTypeCount; ct++) {