{"action":"opened","issue":{"url":"https://api.github.com/repos/ocornut/imgui/issues/325","labels_url":"https://api.github.com/repos/ocornut/imgui/issues/325/labels{/name}","comments_url":"https://api.github.com/repos/ocornut/imgui/issues/325/comments","events_url":"https://api.github.com/repos/ocornut/imgui/issues/325/events","html_url":"https://github.com/ocornut/imgui/issues/325","id":105666537,"number":325,"title":"Crash when nothing is rendered the first time through.","user":{"login":"HardlineStudios","id":3782678,"avatar_url":"https://avatars.githubusercontent.com/u/3782678?v=3","gravatar_id":"","url":"https://api.github.com/users/HardlineStudios","html_url":"https://github.com/HardlineStudios","followers_url":"https://api.github.com/users/HardlineStudios/followers","following_url":"https://api.github.com/users/HardlineStudios/following{/other_user}","gists_url":"https://api.github.com/users/HardlineStudios/gists{/gist_id}","starred_url":"https://api.github.com/users/HardlineStudios/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HardlineStudios/subscriptions","organizations_url":"https://api.github.com/users/HardlineStudios/orgs","repos_url":"https://api.github.com/users/HardlineStudios/repos","events_url":"https://api.github.com/users/HardlineStudios/events{/privacy}","received_events_url":"https://api.github.com/users/HardlineStudios/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-09-09T19:19:12Z","updated_at":"2015-09-09T19:19:12Z","closed_at":null,"body":"My app uses ImGUI but doesn't render anything right away. With an older build, this didn't cause issues but with the latest build it does. I've recreated this using your sample code.\r\n\r\nOpen **main.cpp** in the **opengl3_example** project, go to the main loop and comment out the **ImGui::** calls. The app will crash in ```ImGui::Render()``` (line 2382) as **g.RenderDrawLists** are all **NULL**.\r\n\r\nI didn't step too deeply into see just why this happened but I'm assuming lists are initialized when they are used for the first time?\r\n\r\n```C++\r\n    // Main loop\r\n    while (!glfwWindowShouldClose(window))\r\n    {\r\n        glfwPollEvents();\r\n        ImGui_ImplGlfwGL3_NewFrame();\r\n        /*\r\n        // 1. Show a simple window\r\n        // Tip: if we don't call ImGui::Begin()/ImGui::End() the widgets appears in a window automatically called \"Debug\"\r\n        {\r\n            static float f = 0.0f;\r\n            ImGui::Text(\"Hello, world!\");\r\n            ImGui::SliderFloat(\"float\", &f, 0.0f, 1.0f);\r\n            ImGui::ColorEdit3(\"clear color\", (float*)&clear_color);\r\n            if (ImGui::Button(\"Test Window\")) show_test_window ^= 1;\r\n            if (ImGui::Button(\"Another Window\")) show_another_window ^= 1;\r\n            ImGui::Text(\"Application average %.3f ms/frame (%.1f FPS)\", 1000.0f / ImGui::GetIO().Framerate, ImGui::GetIO().Framerate);\r\n        }\r\n\r\n        // 2. Show another simple window, this time using an explicit Begin/End pair\r\n        if (show_another_window)\r\n        {\r\n            ImGui::SetNextWindowSize(ImVec2(200,100), ImGuiSetCond_FirstUseEver);\r\n            ImGui::Begin(\"Another Window\", &show_another_window);\r\n            ImGui::Text(\"Hello\");\r\n            ImGui::End();\r\n        }\r\n\r\n        // 3. Show the ImGui test window. Most of the sample code is in ImGui::ShowTestWindow()\r\n        if (show_test_window)\r\n        {\r\n            ImGui::SetNextWindowPos(ImVec2(650, 20), ImGuiSetCond_FirstUseEver);\r\n            ImGui::ShowTestWindow(&show_test_window);\r\n        }\r\n        */\r\n\r\n        // Rendering\r\n        int display_w, display_h;\r\n        glfwGetFramebufferSize(window, &display_w, &display_h);\r\n        glViewport(0, 0, display_w, display_h);\r\n        glClearColor(clear_color.x, clear_color.y, clear_color.z, clear_color.w);\r\n        glClear(GL_COLOR_BUFFER_BIT);\r\n        ImGui::Render();\r\n        glfwSwapBuffers(window);\r\n    }\r\n```"}}