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
[COLOR=#9872A2][FONT=Consolas]public [/FONT][/COLOR][COLOR=#9872A2][FONT=Consolas]class [/FONT][/COLOR][COLOR=#9B0000][FONT=Consolas]CSurface [/FONT][/COLOR][COLOR=#9872A2][FONT=Consolas]extends [/FONT][/COLOR][COLOR=#C7444A][FONT=Consolas]ITexture[/FONT][/COLOR][COLOR=#C5C8C6][FONT=Consolas] {
[COLOR=#9872a2]public[/COLOR] [COLOR=#ce6700]CSurface[/COLOR]([COLOR=#9872a2]Bitmap[/COLOR] [COLOR=#6089b4]bmp[/COLOR]) {
[COLOR=#c7444a]this[/COLOR].[COLOR=#ce6700]imageSetData[/COLOR](bmp);
}
@[COLOR=#9872a2]Override[/COLOR]
[COLOR=#9872a2]public[/COLOR] [COLOR=#9872a2]native[/COLOR] [COLOR=#9872a2]int[/COLOR] [COLOR=#ce6700]texture[/COLOR] ();
[COLOR=#9872a2]public[/COLOR] [COLOR=#9872a2]native[/COLOR] [COLOR=#9872a2]void[/COLOR] [COLOR=#ce6700]imageSetData[/COLOR]([COLOR=#9872a2]int[/COLOR] [] [COLOR=#6089b4]pixels[/COLOR]);
[COLOR=#9872a2]public[/COLOR] [COLOR=#9872a2]void[/COLOR] [COLOR=#ce6700]imageSetData[/COLOR]([COLOR=#9872a2]Bitmap[/COLOR] [COLOR=#6089b4]img[/COLOR])
{
[COLOR=#9872a2]int[/COLOR] [] [COLOR=#6089b4]pixels[/COLOR] [COLOR=#676867]=[/COLOR] [COLOR=#9872a2]new[/COLOR] [COLOR=#9872a2]int[/COLOR] [[COLOR=#6089b4]img[/COLOR].[COLOR=#ce6700]getWidth[/COLOR] () [COLOR=#676867]*[/COLOR] [COLOR=#6089b4]img[/COLOR].[COLOR=#ce6700]getHeight[/COLOR] ()];
[COLOR=#6089b4]img[/COLOR].[COLOR=#ce6700]getPixels[/COLOR] (pixels, [COLOR=#6089b4]0[/COLOR], [COLOR=#6089b4]img[/COLOR].[COLOR=#ce6700]getWidth[/COLOR] (), [COLOR=#6089b4]0[/COLOR], [COLOR=#6089b4]0[/COLOR], [COLOR=#6089b4]img[/COLOR].[COLOR=#ce6700]getWidth[/COLOR] (), [COLOR=#6089b4]img[/COLOR].[COLOR=#ce6700]getHeight[/COLOR] ());
[COLOR=#ce6700]imageSetData[/COLOR] (pixels);
}
@[COLOR=#9872a2]Override[/COLOR]
[COLOR=#9872a2]public[/COLOR] [COLOR=#9872a2]native[/COLOR] [COLOR=#9872a2]int[/COLOR] [COLOR=#ce6700]getWidth[/COLOR]();
@[COLOR=#9872a2]Override[/COLOR]
[COLOR=#9872a2]public[/COLOR] [COLOR=#9872a2]native[/COLOR] [COLOR=#9872a2]int[/COLOR] [COLOR=#ce6700]getHeight[/COLOR]();
[/FONT][/COLOR]
[COLOR=#C5C8C6][FONT=Consolas] }[/FONT][/COLOR]
Display More
Thanks