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

@@ -48,22 +48,27 @@ public class Script extends BaseObj {
}
public void bindAllocation(Allocation va, int slot) {
mRS.validate();
mRS.nScriptBindAllocation(mID, va.mID, slot);
}
public void setClearColor(float r, float g, float b, float a) {
mRS.validate();
mRS.nScriptSetClearColor(mID, r, g, b, a);
}
public void setClearDepth(float d) {
mRS.validate();
mRS.nScriptSetClearDepth(mID, d);
}
public void setClearStencil(int stencil) {
mRS.validate();
mRS.nScriptSetClearStencil(mID, stencil);
}
public void setTimeZone(String timeZone) {
mRS.validate();
try {
mRS.nScriptSetTimeZone(mID, timeZone.getBytes("UTF-8"));
} catch (java.io.UnsupportedEncodingException e) {