seclerp / OxyEngine

:video_game: OxyEngine - 2D full-featured open-source crossplatform game engine

Home Page:http://oxyengine.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

NullReferenceException when creating FigureComponent post Load

rufuszero opened this issue · comments

FigureComponent retrieves GraphicsManager instance on Load event.
Since Load event fires once before game loop starts, creating instances of FigureComponent subclasses after Load event, in the Update, throws NullReferenceException because GraphicsManager was never retrieved for this instance.


Possible fix - creating any FigureComponent subclass adds it to the queue so it will be loaded on the next game loop iteration