OpenGL Renderer crashes when I delete anything

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: OpenGL Renderer crashes when I delete anything

Post by CuteAlien »

Be careful - object lifetime is not related to something being in a header or source file (headers are simply files which the pre-processor copy-pastes into your sources at the place where you wrote #include, so by the time they reach the compiler they are part of your .cpp files). If you put an eventreceiver variable in your GraphicsSubsystem class it's instance will exist as long as your GraphicsSubsystem instance lives.

Understanding object lifetimes in memory can take a bit. But no worries, we all start out by writing every possible bug out there at first - only real way to learn ;-)
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
Post Reply