Open
Description
Summary
As outlined here, Duality will crash when attempting to create graphics resources before the graphics window has been opened. A typical example is inside the CorePlugin.InitPlugin
method.
How to reproduce
- Implement a
CorePlugin
like this:
public class SomeCorePlugin : CorePlugin
{
protected override void InitPlugin()
{
base.InitPlugin();
new Texture();
}
}
Workaround
- Instead of using the plugin's InitPlugin method, perform the required operations in the first BeforeUpdate call.
Analysis
- The graphics backend should check whether there is a graphics context available when attempting to create native resources and throw an exception if not, alerting users about the issue and allowing them to fix it.