537 |
} |
} |
538 |
|
|
539 |
|
|
|
/** Copy this texture into the given texture. |
|
|
* This function can be used for downsampling by copying from a non-zero level |
|
|
* @param into The texture to copy into |
|
|
* @param levelFrom The mipmap level from which to copy. Note that the texture |
|
|
* is always copied TO level 0. |
|
|
* @param internalFormat The internalFormat to use in the texture into. |
|
|
* @param transferformat The format to use for the transfer. |
|
|
*/ |
|
|
public void downsampleInto(Texture into, String target, int levelFrom, String internalFormat, String transferformat) { |
|
|
impl_Texture_downsampleInto(getId(), into.getId(), target, levelFrom, |
|
|
internalFormat, transferformat); |
|
|
} |
|
|
|
|
540 |
/** Load an image into a part of this texture. |
/** Load an image into a part of this texture. |
541 |
*/ |
*/ |
542 |
public void loadSubImage(int level, Image img, int x, int y, int xoffs, int yoffs, int w, int h) { |
public void loadSubImage(int level, Image img, int x, int y, int xoffs, int yoffs, int w, int h) { |
587 |
int border, String format, String type, byte[] data) ; |
int border, String format, String type, byte[] data) ; |
588 |
static private native void impl_Texture_loadSubImage(int id, |
static private native void impl_Texture_loadSubImage(int id, |
589 |
int level, int imgid, int x, int y, int xoffs, int yoffs, int w, int h) ; |
int level, int imgid, int x, int y, int xoffs, int yoffs, int w, int h) ; |
|
static private native void impl_Texture_downsampleInto(int id, int intoid, String target, |
|
|
int level, String internalFormat, String transferformat); |
|
590 |
static private native void impl_Texture_copyTexImage2D( |
static private native void impl_Texture_copyTexImage2D( |
591 |
int id, int wid, String buffer, |
int id, int wid, String buffer, |
592 |
String target, int level, |
String target, int level, |
701 |
|
|
702 |
} |
} |
703 |
|
|
704 |
|
public static FTFont createFTFont(String filename, int pixelSize_X, |
705 |
|
int pixelSize_Y) { |
706 |
|
return createFTFont(filename, pixelSize_X, pixelSize_Y, 1 << 16, 0, 0, 1 << 16); |
707 |
|
} |
708 |
/** Create a freetype font, with the given |
/** Create a freetype font, with the given |
709 |
* pixel sizes. |
* pixel sizes. |
710 |
*/ |
*/ |
711 |
public static FTFont createFTFont(String filename, int pixelSize_X, |
public static FTFont createFTFont(String filename, int pixelSize_X, |
712 |
int pixelSize_Y) { |
int pixelSize_Y, |
713 |
int id = impl_FTFont_create(filename, pixelSize_X, pixelSize_Y); |
int xx, int xy, int yx, int yy) { |
714 |
|
int id = impl_FTFont_create(filename, pixelSize_X, pixelSize_Y, xx, xy, yx, yy); |
715 |
if(id < 0) |
if(id < 0) |
716 |
throw new Error("Couldn't create font '"+filename+"'"); |
throw new Error("Couldn't create font '"+filename+"'"); |
717 |
return new FTFont(id); |
return new FTFont(id); |
718 |
} |
} |
719 |
private static native int impl_FTFont_create(String filename, int psx, int psy); |
private static native int impl_FTFont_create(String filename, int psx, int psy, |
720 |
|
int xx, int xy, int yx, int yy); |
721 |
private static native void impl_FTFont_delete(int id); |
private static native void impl_FTFont_delete(int id); |
722 |
private static native int[] impl_FTFont_getMeasurements(int id, int[] characters) ; |
private static native int[] impl_FTFont_getMeasurements(int id, int[] characters) ; |
723 |
private static native byte[][] impl_FTFont_getBitmaps(int id, int[] characters) ; |
private static native byte[][] impl_FTFont_getBitmaps(int id, int[] characters) ; |
799 |
xadvance, yadvance); |
xadvance, yadvance); |
800 |
} |
} |
801 |
|
|
802 |
|
/** Get the measurements for a single glyph. |
803 |
|
* @param glyph The index of the glyph |
804 |
|
* @return A float array of 11 elements, in order of parameters |
805 |
|
* of setMeasurements |
806 |
|
*/ |
807 |
|
public float[] getMeasurements(int glyph) { |
808 |
|
return impl_QuadFont_getMeasurements(getId(), |
809 |
|
glyph); |
810 |
|
} |
811 |
} |
} |
812 |
|
|
813 |
public static QuadFont createQuadFont() { |
public static QuadFont createQuadFont() { |
826 |
float x0, float y0, float x1, float y1, |
float x0, float y0, float x1, float y1, |
827 |
float tx0, float ty0, float tx1, float ty1, |
float tx0, float ty0, float tx1, float ty1, |
828 |
float xadvance, float yadvance) ; |
float xadvance, float yadvance) ; |
829 |
|
private static native float[] impl_QuadFont_getMeasurements(int id, int glyph); |
830 |
private static native String[] impl_QuadFont_getTexUnits(int id); |
private static native String[] impl_QuadFont_getTexUnits(int id); |
831 |
private static native String[] impl_QuadFont_getTexTargets(int id); |
private static native String[] impl_QuadFont_getTexTargets(int id); |
832 |
|
|
990 |
public byte[] get() { |
public byte[] get() { |
991 |
return impl_ByteVector_get(getId()); |
return impl_ByteVector_get(getId()); |
992 |
} |
} |
993 |
|
|
994 |
|
/** Set the values from a byte array. |
995 |
|
*/ |
996 |
|
public void set(byte[] bytes) { |
997 |
|
impl_ByteVector_set(getId(), bytes); |
998 |
|
} |
999 |
|
|
1000 |
/** Get the values from the vector as an array of ints. |
/** Get the values from the vector as an array of ints. |
1001 |
* Each integer is formed by packing 4 bytes. |
* Each integer is formed by packing 4 bytes. |
1002 |
*/ |
*/ |
1036 |
int x, int y, float z, int width, int height, |
int x, int y, float z, int width, int height, |
1037 |
String format, String type) ; |
String format, String type) ; |
1038 |
static private native int impl_ByteVector_get(int id, int ind); |
static private native int impl_ByteVector_get(int id, int ind); |
1039 |
|
static private native int impl_ByteVector_set(int id, byte[] bytes); |
1040 |
static private native byte[] impl_ByteVector_get(int id); |
static private native byte[] impl_ByteVector_get(int id); |
1041 |
static private native int[] impl_ByteVector_getInts(int id); |
static private native int[] impl_ByteVector_getInts(int id); |
1042 |
|
|