GUI[resolved] and MAP[waiting]?

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

GUI[resolved] and MAP[waiting]?

Post by pelonzudo »

Hello people, I'm here again. After getting my client/server working and some useful stuff there I got a some questions....

1) Could I get a pointer to an IGUIElement back? What I mean

Code: Select all

IGUIEnvironment * gui= device->getGUIEnvironment ();
gui->addSomeGuiElementHere(......IDENTIFIER...);
...
some code here
...
and later
...
gui->giveMeBack(...IENTIFIER...);
I know that you get a pointer when you add the element, but what I want is get the pointer back in some class that don't know the pointer.
I was thinking in a class that manage all gui elements. Any suggestion about impelenting GUI?

2)As I have a server and a client... How could I get both maps sincronized? Here I explain. I could desing a 3D world with (for example) Blender and render it in my client. Now, what I need is get all maps (not textures, only geometry) in the server.

I had been reading about that, and the mesh get in the info what I need. Isn't it? Any help here?

Thanks in advance :)
Last edited by pelonzudo on Tue May 27, 2008 10:28 am, edited 1 time in total.
radical-dev
Posts: 45
Joined: Thu Apr 24, 2008 7:54 pm
Location: Wickede, Germany

Post by radical-dev »

Hi pelonzudo!

To get a pointer from a gui element just call this:

Code: Select all

IGUIEnvironment->getRootGuiElement()->getElementFromId(s32 id)
To your other question i can't answer you ;-)

Greetings
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

Thanks, that was what I need for poit 1. I couldn't find it becouse I was looking into the incoorect way. Now I got a problem solved. ^.^

Anything about point 2?
Masterhawk
Posts: 299
Joined: Mon Nov 27, 2006 6:52 pm
Location: GERMANY
Contact:

Post by Masterhawk »

2)As I have a server and a client... How could I get both maps sincronized? Here I explain. I could desing a 3D world with (for example) Blender and render it in my client. Now, what I need is get all maps (not textures, only geometry) in the server.
I understand your problem in that way: The client loads a geometry the server can't know. The server needs this geometry for whatever. That's right?
If your server really needs to have the geometry I think you have to send it the data piece by piece. I guess this won't work in realtime. Maybe you can realize an upload to the server.

If you just want to synchronize client and server it's maybe enough to deal with positions of the players or something and synchronizes them. This would cost much less capaticity.
Image
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

could you not just send the server the filename to open and then it can open it itself (of course the map file would have to be installed on the server as well).
Image Image Image
pelonzudo
Posts: 20
Joined: Wed May 07, 2008 11:14 am

Post by pelonzudo »

I think in the way that JP said. I had the files in the server and the client. But what I need know if what kind of files I must have (the server only load geometry and the client geometry and textures) and how load that kind of files in the server.
JP
Posts: 4526
Joined: Tue Sep 13, 2005 2:56 pm
Location: UK
Contact:

Post by JP »

You could have two versions of the map, one has the textures removed, the other doesn't. Or you setup your server prog to ignore textures being loaded somehow.

The first option there is probably the easiest but maybe the most prone to error as you may forget to update both versions of the map or something (but then that could happen anyway due to having the map on both client and server)

The second option would probably require some editing of Irrlicht to provide an option to disable texture loading.
Image Image Image
Masterhawk
Posts: 299
Joined: Mon Nov 27, 2006 6:52 pm
Location: GERMANY
Contact:

Post by Masterhawk »

Indeed, if the file are present on both systems you should submit the the filename only.
Image
Post Reply