Liker error while trying to extend and recompile irrlicht

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.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Liker error while trying to extend and recompile irrlich

Post by CuteAlien »

It's the other way round - your event-receiver gets those events even before before the gui-elements receive them. With guiEnvironemnt->getRootGUIElement ()->getElementFromPoint(x,y) you can find out which element will receive a mouse-event.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
newbie8787
Posts: 105
Joined: Thu Jan 10, 2008 6:26 pm

Re: Liker error while trying to extend and recompile irrlich

Post by newbie8787 »

CuteAlien wrote:It's the other way round - your event-receiver gets those events even before before the gui-elements receive them. With guiEnvironemnt->getRootGUIElement ()->getElementFromPoint(x,y) you can find out which element will receive a mouse-event.
Even before I started on this whole endeavor , I checked the documentation on this method and it said :
"You should not need to use this method directly, unless you wish to reparent GUI elements to the top level. "
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Liker error while trying to extend and recompile irrlich

Post by CuteAlien »

That is indeed a confusing comment... I'll put it on my todo to remove it. There is no reason not to use this function.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
RdR
Competition winner
Posts: 273
Joined: Tue Mar 29, 2011 2:58 pm
Contact:

Re: Liker error while trying to extend and recompile irrlich

Post by RdR »

Simple example:
http://pastie.org/3611002

Dont need to recompile Irrlicht to get that working, just make sure you add the Irrlicht sources to your Includes
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Liker error while trying to extend and recompile irrlich

Post by CuteAlien »

Hm, I'm really not certain if that is a good idea RdR. Now you have 2 CGUIStaticText classes with the same name and in the same namespace in dll and in the project. I suspect with static linking it would probably even fail. I guess with dynamic linking it will probably work as they don't know about each other, but still not really sure if it's a good idea.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
RdR
Competition winner
Posts: 273
Joined: Tue Mar 29, 2011 2:58 pm
Contact:

Re: Liker error while trying to extend and recompile irrlich

Post by RdR »

CuteAlien wrote:Hm, I'm really not certain if that is a good idea RdR. Now you have 2 CGUIStaticText classes with the same name and in the same namespace in dll and in the project. I suspect with static linking it would probably even fail. I guess with dynamic linking it will probably work as they don't know about each other, but still not really sure if it's a good idea.
Dont know about static linking but linking dynamicly it works for sure.
CuteAlien
Admin
Posts: 9734
Joined: Mon Mar 06, 2006 2:25 pm
Location: Tübingen, Germany
Contact:

Re: Liker error while trying to extend and recompile irrlich

Post by CuteAlien »

My question is rather if it's correct. Often things work and are still wrong. I simply don't know if there are any guarantees for this case.
IRC: #irrlicht on irc.libera.chat
Code snippet repository: https://github.com/mzeilfelder/irr-playground-micha
Free racer made with Irrlicht: http://www.irrgheist.com/hcraftsource.htm
RdR
Competition winner
Posts: 273
Joined: Tue Mar 29, 2011 2:58 pm
Contact:

Re: Liker error while trying to extend and recompile irrlich

Post by RdR »

CuteAlien wrote:My question is rather if it's correct. Often things work and are still wrong. I simply don't know if there are any guarantees for this case.
Hmm I used the same approach for my Count Down Button (http://irrlicht.sourceforge.net/forum/v ... =9&t=45795).
So far I hadnt any weird things or problems with it.

The correct why is to change it in Irrlicht, but that requires the topic starter to recompile Irrlicht.
serengeor
Posts: 1712
Joined: Tue Jan 13, 2009 7:34 pm
Location: Lithuania

Re: Liker error while trying to extend and recompile irrlich

Post by serengeor »

RdR wrote: The correct why is to change it in Irrlicht, but that requires the topic starter to recompile Irrlicht.
The best way (in my opinion) would be to actually copy and rename it, cause if you change it in the engine it will be harder to update the engine (without loosing changes).
Working on game: Marrbles (Currently stopped).
gerdb
Posts: 194
Joined: Wed Dec 02, 2009 8:21 pm
Location: Dresden, Germany

Re: Liker error while trying to extend and recompile irrlich

Post by gerdb »

hi, why do you derive from CGUIStaticText and have a member pointer to CGUIStaticText, means that you have 2 StaticTexts now, the one you are deriving from and the one you are creating with Environment->addStaticText()?

Also you have to implement all methods you are declaring.
Post Reply