Hi all,
My question would basically be when it is a good idea to load the models? I am playing around with a very small test App (just the MainActivity and a MyRenderer implementing Renderer). Right now, I trying to create my Object3Ds in MyRenderer's OnSurfaceCreated method. This works fine as long as I do something primitive like
model = Primitives.getBox(1.f, 1.f);
However, if I try and load an actual model like this:
InputStream in = Resources.getSystem().openRawResource(R.raw.model);
model = Loader.load3DS(in, 1.f)[0];
I run into problems:
Exception android.content.res.Resources$NotFoundException(<No current context>)
breakpoint hit in android.opengl.GLSurfaceView$GLThread at line 1244 by thread <11> GLThread 81.
Apparently, this is the case because the Resources are only available from the Activity, not from the Renderer. On the other hand, the Renderer is where my World and all the other goodness is at, so loading it from the Activity is not viable either. What is the preferred way of going about this?
Thanks in advance.