Can we stop the renderer of jMonkeyEngine and restart it next ? [SOLVED]

Hello,



Maybe my question is stupid but i’m a beginner with jMonkeyEngine :

Can we stop the renderer of jMonkeyEngine and restart it next ? Like this : renderer.stop(); renderer.restart(); I searched but i didn’t find anything about that. Maybe it is not possible.



Thank you in advance,

Mecrof.

Why should you?

I have two threads. Thread of the SimpleApplication and main’s thread. I would like the main can add an object into the scene of the SimpleApplication but it doesn’t work sometimes because there are concurrent threads during the render. So when the main add something i want to stop the render and after i restart it.

I know i’m on wrong way but i don’t how to do without.

:brainsout:

Dude, just do your stuff in the update() methods… And meditate about threading a bit. Did I mention read the tutorials?

I read the tutorials but I have not found any that can help me. And again, if I ask my questions is to get some help and not a reaffirmation of what I know. I have said I am new to jMonkey. So, I do not yet know all the tricks. I searched everywhere. I tried many things but nothing works. What can I do more except ask for your help? Excuse me but I searched all day. I’m a little tired. I’m also a little tired of hearing “look at your threads” when I looked everywhere and found nothing to help me.

Its not a monkey thing, its a normal threading issue. Theres an update loop, thats your main thread. If you don’t understand that concept you should probably first improve your programming skills before you try and write games.

I know I do not know much in this environment (about threads). But in fiddling and requesting assistance to older we learn, is not it? I understand your meaning teacher. You do not want to reveal everything at once. This is legitimate. But please, do not you want me more about what I do? Maybe I’ll understand, maybe not. I do not want to program a real game, I just want to learn Jmonkey. That’s why I thought a good idea to ask my questions here on this forum.

[edit :] i think i understand this monkey thing.

http://www.youtube.com/watch?v=zCpG3ZryQAk

There is a wiki page on threading. I do not have the link handy.

Well, I will continue on my own way. Thank you again for your help Normen. I slightly changed thanks to you. Thank you to the others who were trying to help me. It was a pleasure to post messages on this help forum dedicated to the best if I understood the second to last post.

@pspeed : I read the wiki page if you think the same. I am about to try to apply what I understood.

You can’t just pause it. The engine works hand-in-hand with the graphic card. Your updates have to occur in the Update() loop.

You ask for something impossible. It would be better for you to start with small experiments, to understand the concepts of jMonkey.

I think so. But it’s a school work… I have to use this engine and finish the project before march. So, i’ll try with thread’s methods like Normen said. Thanks for your answer. :slight_smile:

I have noticed something. Always when people say they have school projects to do 3d stuff, they never seem to know anything about it. Sometimes not even basic programming stuff. How exactly do they teach this subject in schools?



When I studied math/engineering they always taught you basic stuff before going on to more advanced. They’d never tell you to build a circuit (for example) without having covered basic electronics first, and done a few simpler tasks. Pretty sure teaching works that way in most subjects/schools/countries.



Very weird.

Problem sloved thanks to Normen. A very patient guy compared to me!

here : The other topic