jPCT-AE - a 3d engine for Android > Support

Blitting Image using TexturePack

(1/2) > >>

JKumar:
HI,

      I created a texture and added a single image only for testing.

TexturePack Creation:

TexturePack mTexturePack = new TexturePack();   
int imageId = mTexturePack.addImage(((BitmapDrawable)getResources().getDrawable(R.drawable.center)).getBitmap());

Using the TexturePack
When i am using in the draw as following -

mTexturePack.blit(fb, imageId, 100, 100, true);

Nothing is displaying on the screen and also its getting out of memory. See the log below-

java.lang.OutOfMemoryError
     at com.threed.jpct.VisList.<init>(VisList.java:51)
    at com.threed.jpct.VisListManager.getVisList(VisListManager.java:59)
     at com.threed.jpct.World.renderScene(World.java:1000)
    at android.thearena.Game_old$Renderer.onDrawFrame(Game_old.java:497)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1341)
     at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1118)


What i am doing wrong ?
                  
         

raft:
unless you arent creating TexturePack every frame, this has nothing to do with TexturePack.
what is the size (dimensions) of your image?

JKumar:
Hi,

       My Image size is 8KB only and i am creating the texture pack object only in the onCreate method and not in the onDrawFrame method

I also getting the following before the Exception-

10-22 11:31:56.253: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.272: INFO/jPCT-AE(4493): Additional visibility list (2) created with size: 5000
10-22 11:31:56.292: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.322: INFO/jPCT-AE(4493): Additional visibility list (3) created with size: 5000
10-22 11:31:56.332: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.342: INFO/jPCT-AE(4493): Additional visibility list (4) created with size: 5000
10-22 11:31:56.352: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.363: INFO/jPCT-AE(4493): Additional visibility list (5) created with size: 5000
10-22 11:31:56.373: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.383: INFO/jPCT-AE(4493): Additional visibility list (6) created with size: 5000
10-22 11:31:56.392: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.412: INFO/jPCT-AE(4493): Additional visibility list (7) created with size: 5000
10-22 11:31:56.422: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.442: INFO/jPCT-AE(4493): Additional visibility list (8) created with size: 5000
10-22 11:31:56.462: INFO/jPCT-AE(4493): Drawing thread terminated!
10-22 11:31:56.462: INFO/dalvikvm(4493): Total arena pages for JIT: 12
10-22 11:31:56.482: INFO/ActivityManager(92): Displayed activity android.thearena/.Game_old: 2284 ms (total 2284 ms)
10-22 11:31:56.492: INFO/jPCT-AE(4493): Additional visibility list (9) created with size: 5000
10-22 11:31:56.502: INFO/jPCT-AE(4493): Drawing thread terminated!

JKumar:
W =  72 pix
H = 63 pix

raft:
i'm not sure what is going on here but this is not related to TexturePack.
comment the blitting line and check same error happens

Navigation

[0] Message Index

[#] Next page

Go to full version