Hello,
For my extension I have a android.graphics.Bitmap object and I need to convert it to ITexture for use GLRenderer.inst.renderImage function.
I try to create my extends ITexture class but it don't work.
Code:
public class CSurface extends ITexture {
public CSurface(Bitmap bmp) {
this.imageSetData(bmp);
}
@Override
public native int texture ();
public native void imageSetData(int [] pixels);
public void imageSetData(Bitmap img)
{
int [] pixels = new int [img.getWidth () * img.getHeight ()];
img.getPixels (pixels, 0, img.getWidth (), 0, 0, img.getWidth (), img.getHeight ());
imageSetData (pixels);
}
@Override
public native int getWidth();
@Override
public native int getHeight();
}
Thanks