167 |
|
|
168 |
/** The Java proxy for a C++ object. |
/** The Java proxy for a C++ object. |
169 |
*/ |
*/ |
170 |
static public abstract class JavaObject extends Vob |
static public abstract class JavaObject extends AbstractVob |
171 |
implements GLDeletable { |
implements GLDeletable { |
172 |
private int id = 0; |
private int id = 0; |
173 |
JavaObject(int id) { super(); this.id = id; } |
JavaObject(int id) { super(); this.id = id; } |
334 |
* Here, id == directly the texture id. |
* Here, id == directly the texture id. |
335 |
*/ |
*/ |
336 |
static public class Texture extends NonRenderableJavaObject { |
static public class Texture extends NonRenderableJavaObject { |
337 |
private Texture(int id) { super(id); } |
boolean delReal; |
338 |
|
private Texture(int id) { super(id); delReal = false; } |
339 |
|
private Texture(int id, boolean delReal) { super(id); |
340 |
|
this.delReal = delReal; } |
341 |
protected void deleteObj() { impl_deleteTexture(getId()); } |
protected void deleteObj() { impl_deleteTexture(getId()); } |
342 |
|
|
343 |
/** Get the OpenGL texture id of this texture. |
/** Get the OpenGL texture id of this texture. |
453 |
/** Create a new OpenGL texture object. |
/** Create a new OpenGL texture object. |
454 |
*/ |
*/ |
455 |
static public Texture createTexture() { |
static public Texture createTexture() { |
456 |
return new Texture(impl_createTexture()); |
return new Texture(impl_createTexture(), true); |
457 |
} |
} |
458 |
static private native int impl_createTexture(); |
static private native int impl_createTexture(); |
459 |
static private native void impl_deleteTexture(int id); |
static private native void impl_deleteTexture(int id); |
507 |
* in the font. |
* in the font. |
508 |
*/ |
*/ |
509 |
public void getWidths(float[] w) { putFontWidths(getId(), w); } |
public void getWidths(float[] w) { putFontWidths(getId(), w); } |
510 |
|
|
511 |
|
/** Get the number of textures in the font. |
512 |
|
*/ |
513 |
|
public int getNTextures() { return impl_Font_getNTextures(getId()); } |
514 |
|
|
515 |
|
/** Get the ith texture of the font. |
516 |
|
*/ |
517 |
|
public Texture getTexture(int i) { |
518 |
|
return new Texture(impl_Font_getTexture(getId(), i), false); |
519 |
|
} |
520 |
} |
} |
521 |
|
|
522 |
static String defaultFontFile = "/usr/share/fonts/type1/gsfonts/n019004l.pfb"; |
static String defaultFontFile = "/usr/share/fonts/type1/gsfonts/n019004l.pfb"; |
542 |
static private native float getFontYOffs(int id); |
static private native float getFontYOffs(int id); |
543 |
static private native void deleteFont(int id); |
static private native void deleteFont(int id); |
544 |
static private native void putFontWidths(int id, float[] w); |
static private native void putFontWidths(int id, float[] w); |
545 |
|
static private native int impl_Font_getNTextures(int id); |
546 |
|
static private native int impl_Font_getTexture(int id, int i); |
547 |
|
|
548 |
|
|
549 |
//--------- OpenGL Program |
//--------- OpenGL Program |