diff --git a/package.json b/package.json index f770b99..ca86c15 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ponczek", - "version": "1.1.1", + "version": "1.1.2", "description": "Deep-fried game framework with sweet filling", "author": "Deseteral ", "license": "MIT", diff --git a/src/imgui/imgui-impl.ts b/src/imgui/imgui-impl.ts index f1b5788..5b4f8f2 100644 --- a/src/imgui/imgui-impl.ts +++ b/src/imgui/imgui-impl.ts @@ -484,6 +484,12 @@ export function NewFrame(time: number): void { } } +export function ClearScreen(): void { + if (!gl) throw new Error(); + gl.clearColor(0, 0, 0, 0); + gl.clear(gl.COLOR_BUFFER_BIT); +} + export function RenderDrawData(draw_data: ImGui.DrawData | null = ImGui.GetDrawData()): void { const io = ImGui.GetIO(); if (draw_data === null) { throw new Error(); } diff --git a/src/ponczek.ts b/src/ponczek.ts index 564d4a5..5cfd8e7 100644 --- a/src/ponczek.ts +++ b/src/ponczek.ts @@ -187,6 +187,7 @@ export abstract class Ponczek { if (Ponczek.renderImGui) { ImGui.EndFrame(); ImGui.Render(); + ImGuiImpl.ClearScreen(); ImGuiImpl.RenderDrawData(ImGui.GetDrawData()); }