IM_ASSERT(GImGui!=NULL&&"No current context. Did you call ImGui::CreateContext() or ImGui::SetCurrentContext()?");
ImGuiContext&g=*GImGui;
#ifdef IMGUI_ENABLE_TEST_ENGINE_HOOKS
ImGuiTestEngineHook_PreNewFrame();
#endif
// Check user data
// (We pass an error message in the assert expression to make it visible to programmers who are not using a debugger, as most assert handlers display their argument)
IM_ASSERT(g.Initialized);
@ -3435,6 +3454,10 @@ void ImGui::NewFrame()
// We don't use "Debug" to avoid colliding with user trying to create a "Debug" window with custom flags.
//for (const ImWchar* s = text_begin; (s = (const ImWchar*)wcschr((const wchar_t*)s, (wchar_t)'\n')) != NULL; s++) // FIXME-OPT: Could use this when wchar_t are 16-bits