diff --git a/File_Format_Library/GUI/BFRES/BfresEditor.cs b/File_Format_Library/GUI/BFRES/BfresEditor.cs index b01e61a0..2cee52f0 100644 --- a/File_Format_Library/GUI/BFRES/BfresEditor.cs +++ b/File_Format_Library/GUI/BFRES/BfresEditor.cs @@ -99,11 +99,14 @@ namespace FirstPlugin.Forms stTabControl2.myBackColor = FormThemes.BaseTheme.FormBackColor; //Always create an instance of the viewport unless opengl is disabled - if (viewport == null && Runtime.UseOpenGL || viewport.IsDisposed && Runtime.UseOpenGL) + if (Runtime.UseOpenGL) { - viewport = new Viewport(ObjectEditor.GetDrawableContainers()); - viewport.Dock = DockStyle.Fill; - viewport.DisplayAll = DisplayAll; + if (viewport == null || (viewport != null && viewport.IsDisposed)) + { + viewport = new Viewport(ObjectEditor.GetDrawableContainers()); + viewport.Dock = DockStyle.Fill; + viewport.DisplayAll = DisplayAll; + } } //If the option is enabled by settings, and it has models display the viewport