Author Topic: texture loading problem  (Read 1627 times)

Offline BeerMonkey88

  • byte
  • *
  • Posts: 2
    • View Profile
texture loading problem
« on: April 16, 2012, 05:26:07 pm »
Hey guys im pretty new to android and jpct and im having some problems loading textures
i have 6.png files in my res/raw and im loading them into the texturemanager like this..

Code: [Select]
TextureManager tx = TextureManager.getInstance();
Resources res = getResources();

tx.flush();
tx.addTexture("left", new Texture(res.openRawResource(R.raw.left)));
tx.addTexture("front", new Texture(res.openRawResource(R.raw.front)));
tx.addTexture("right", new Texture(res.openRawResource(R.raw.right)));
tx.addTexture("back", new Texture(res.openRawResource(R.raw.back)));
tx.addTexture("up", new Texture(res.openRawResource(R.raw.up)));
tx.addTexture("down", new Texture(res.openRawResource(R.raw.down)));

Code: [Select]
04-16 16:03:16.610: I/jPCT-AE(30229): onSurfaceCreated
04-16 16:03:16.730: D/dalvikvm(30229): GC_FOR_ALLOC freed 345K, 6% free 6764K/7175K, paused 45ms
04-16 16:03:16.730: I/jPCT-AE(30229): Loading Texture...
04-16 16:03:16.740: W/ResourceType(30229): getEntry failing because entryIndex 3 is beyond type entryCount 2
04-16 16:03:16.740: W/ResourceType(30229): Failure getting entry for 0x7f040003 (t=3 e=3) in package 0 (error -2147483647)
04-16 16:03:16.790: W/dalvikvm(30229): threadid=9: thread exiting with uncaught exception (group=0x401a3760)
04-16 16:03:16.800: E/AndroidRuntime(30229): FATAL EXCEPTION: GLThread 10
04-16 16:03:16.800: E/AndroidRuntime(30229): android.content.res.Resources$NotFoundException: Resource ID #0x7f040003
04-16 16:03:16.800: E/AndroidRuntime(30229): at android.content.res.Resources.getValue(Resources.java:1010)
04-16 16:03:16.800: E/AndroidRuntime(30229): at android.content.res.Resources.openRawResource(Resources.java:935)
04-16 16:03:16.800: E/AndroidRuntime(30229): at android.content.res.Resources.openRawResource(Resources.java:917)
04-16 16:03:16.800: E/AndroidRuntime(30229): at com.jkh8.animationstudio.AnimationStudio$MyRenderer.onSurfaceCreated(AnimationStudio.java:373)
04-16 16:03:16.800: E/AndroidRuntime(30229): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1414)
04-16 16:03:16.800: E/AndroidRuntime(30229): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1184)

Getting a resource not found exception but the files are there?
this is to load to a skybox btw if that makes any difference.?
any help would be great thanks.

Josh

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12011
    • View Profile
    • http://www.jpct.net
Re: texture loading problem
« Reply #1 on: April 16, 2012, 10:43:37 pm »
Looks like as if your resources are not part of your APK....try a clean on the project in Eclipse...

Offline BeerMonkey88

  • byte
  • *
  • Posts: 2
    • View Profile
Re: texture loading problem
« Reply #2 on: April 17, 2012, 03:02:38 am »
Awsome that worked :D at least it wasnt something with my code :)

Thanks