39 |
*/ |
*/ |
40 |
public class GL { |
public class GL { |
41 |
public static boolean dbg = false; |
public static boolean dbg = false; |
42 |
private static void pa(String s) { System.err.println(s); } |
private static void pa(String s) { System.out.println(s); } |
43 |
|
|
44 |
/** Initialize the native library by creating |
/** Initialize the native library by creating |
45 |
* OpenGL contexts and the like. |
* OpenGL contexts and the like. |
142 |
/** During garbage collection: destroy the C++ object associated with this object. |
/** During garbage collection: destroy the C++ object associated with this object. |
143 |
*/ |
*/ |
144 |
public void finalize() { |
public void finalize() { |
145 |
if(this.dbg) pa("Finalizing "+this+" "+id); |
if(GL.dbg) pa("Finalizing "+this+" "+id); |
146 |
// Would like to |
// Would like to |
147 |
// deleteObj(); |
// deleteObj(); |
148 |
// but can't due to thread problems. |
// but can't due to thread problems. |
154 |
RenderInfo info2 |
RenderInfo info2 |
155 |
) { } |
) { } |
156 |
public void deleteObject() { |
public void deleteObject() { |
157 |
|
if(GL.dbg) pa("DeleteObj "+this+" "+id); |
158 |
deleteObj(); |
deleteObj(); |
159 |
id = 0; |
id = 0; |
160 |
} |
} |
199 |
return addToList(list, cur); |
return addToList(list, cur); |
200 |
} |
} |
201 |
protected void deleteObj() { |
protected void deleteObj() { |
202 |
deleteRenderable1(getId()); |
deleteRenderable0(getId()); |
203 |
} |
} |
204 |
} |
} |
205 |
static private native void deleteRenderable0(int id); |
static private native void deleteRenderable0(int id); |