Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Topics - say-V

Pages: [1]
Support / How does a 'good' architecture for a jPCT-AE project look like?
« on: October 27, 2011, 11:47:01 am »

I develop kind of a realtime game for Android with jPCT-AE and after my project gets bigger and bigger I am very concerned about how I should partition my code. I know this is kind of a big question, but maybe there is somebody around that already did some big jPCT-AE projects and is willing to post some advices how to engineer the code/classes best. I think a lot of people would be gracefull for that.

Some words on my situation. I use a class that implements the android.opengl.GLSurfaceView.Renderer interface. In the onSurfaceCreated() method I create all my objects and world and stuff. This are already around 300 lines and it is very unclear. First I also had navigation code in this class. But after it gots soo big, I created a new class that implements Thread where I put all navigation things. But now I have a lot of cross-references and I have problems to synchronize both threads. In short, it's all a mess. No way to even think about putting something open source in this state.

I'm exited for your tipps, and thanks in advance!

Bugs / Config.maxTextures doesn't work as assumed
« on: October 25, 2011, 04:19:42 pm »
By default Conf.maxTextures = 64 that's clear. But I assumed this means that there can not be more textures than 64 at a time, but sure can be more in the whole lifecycle of the app. In my case I use a lot of textures, but not at a time, I also unload and remove old textures that I don't need anymore. I have never more than ~30 textures in use at a time, but nevertheless after some time I get an error.
ERROR: Too many textures added to the TextureManager. Adjust Config.maxTextures!

Pseudo-Code for testing:
Code: [Select]
for i = 0 ... 100
   textureName = "label" + i
   textureManager.addTexture(textureName, createTextureFromString(textureName)
   testPlane.setTexture(textureName)  // so it gets uploaded to GPU
   if (i >= 30) {
      textureManager.removeAndUnload("label" + (i - 30), fb)  // should remove and unload from GPU and TextureManager
end for

Of course I could increase Conf.maxTextures. But that doesn't change the root problem, so I thought I post it.

The manager wil increase the value if needed
there is a spelling mistake (and I think the manager doesn't increase the value, otherwise there would be no error I assume).

I'm already looking forward to finish my project and post it here on the board  :D
jPCT-AE is a great engine!!!

Pages: [1]