Fonts: Fix calling ClearTexData() (clearing CPU side font data) triggering an assert in NewFrame(). (#3487) + Backends: added additional assert to facilitate detecting user understand they haven't initialized a backend.

This commit is contained in:
ocornut
2021-06-29 17:53:41 +02:00
parent 4cec3a0467
commit 23a15834fa
14 changed files with 29 additions and 1 deletions

View File

@ -381,6 +381,7 @@ void ImGui_ImplSDL2_NewFrame(SDL_Window* window)
{
ImGuiIO& io = ImGui::GetIO();
ImGui_ImplSDL2_Data* bd = ImGui_ImplSDL2_GetBackendData();
IM_ASSERT(bd != NULL && "Did you call ImGui_ImplSDL2_Init()?");
IM_ASSERT(bd->Window == window); // FIXME: Should remove parameter from ImGui_ImplSDL2_NewFrame()
// Setup display size (every frame to accommodate for window resizing)