Invalid OpenGL Context for rendering

I’m trying to create my first EditorWindow and till now i have just this and already have an error:
“Invalid OpenGL Context for rendering”

Do you know why ? and how can i fix it?

using UnityEngine;
using UnityEditor;
using System.Collections;

public class DialogWizard : EditorWindow {

    [MenuItem ("Window/DialogSystem")]

    public static void  ShowWindow () {
        EditorWindow.GetWindow(typeof(DialogWizard));
    }

    void OnGUI () {
       
    }
}

Similar thing also happened to me. Seems like refreshing layout fixes it, just re-select your current layout from menu.

4 Likes