New to jPCT-AE, some clearances needed.

Started by aur8l, July 02, 2011, 07:58:32 PM

Previous topic - Next topic

aur8l

Hello everybody.
I downloaded the jPCT-AE packages to start coding 3D stuff on my Eee Transformer. I'm (or have been, actually) pretty used to Android dev, and familiar with3D programming (I used ogre3D in some -far away, it seems- past). Anyway, jPCT seemed pretty easy to learn, so I decided to go with it. Still, I'm a bit confused...
I started looking at the HelloWorld example (from the jPCT wiki), and I understanded it all pretty much. As I started to look into the jPCT-AE HelloWorld, it began less clearer.

Hence the question(s) :
- the example does not seem to show any rendering loop (to me, at least), I was looking for some as in the jPCT example.
- I assume that the onDrawFrame() method is acting as the rendering loop. It tries on 'stop', but the stop() method is not invoked any where in the code.

These might seem some pretty basics questions for you all, but whether I'm completely missing something here, or I'm a bit rusty, which would explain the first.

Anyway, thank you for taking the time for reading my first post.

Peace.

[edit]
Another question has been hitting my mind. The x:y values for the frame buffer doesn't seem to bet set anywhere. Adds to the confusion.
Sorry again for the [stupid maybe] questions.
[/edit]

EgonOlsen

You should try to get familiar with the Activity concept of Android and how the GLSurfaceView works. jPCT-AE itself doesn't make any assumptions about the environment it's running in. The frame buffer's size for example, is set by Android when the GLSurfaceView calls the onSurfaceChanged-method. It also ensures that the onDrawMethod is being called for example 60times/second, which makes it the actual "render loop".

aur8l

#2
Thank you for the reply Egon.
In fact, I was disturbed by the example for jPCT, and the fact that there's a difference with the jPCT-AE example. I spent some time looking in-depth of the HelloWorld code, and things became a little clearer.
Anyway, I must admit that the concept of the onDrawMethod being called 60 times a sec was unknown to me, what explained the questions.
There's one that still hangs in my mind though :
When is the stop() function being called ?

[edit]
OK, I guess this is Activity related, but... Man, I'm lost.
[/edit]

EgonOlsen

The Activity should call it...i'm not 100% that it really does. Maybe one has to do it himself in the onStop()-method of the Activity.

aur8l

So it IS not clear !!  ;)
Well, simple question : how does one exit the HelloWorld (jPCT-AE version) demo ?

aur8l

Okay, I managed to make it out somehow.
Guess I got the basics. Keep you informed in other threads maybe ;).