mirror of
https://github.com/ggerganov/ggwave.git
synced 2026-03-18 09:06:07 +08:00
ggwave-gui : minor
This commit is contained in:
@@ -4,8 +4,6 @@
|
||||
|
||||
#include "ggwave-common.h"
|
||||
|
||||
#include <imgui-extra/imgui_impl.h>
|
||||
|
||||
#include <SDL_opengl.h>
|
||||
|
||||
#include <chrono>
|
||||
@@ -282,33 +280,3 @@ bool GGWave_deinit() {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ImGui_beginFrame(SDL_Window * window) {
|
||||
SDL_Event event;
|
||||
while (SDL_PollEvent(&event))
|
||||
{
|
||||
ImGui_ProcessEvent(&event);
|
||||
if (event.type == SDL_QUIT) return false;
|
||||
if (event.type == SDL_WINDOWEVENT && event.window.event == SDL_WINDOWEVENT_CLOSE && event.window.windowID == SDL_GetWindowID(window)) return false;
|
||||
}
|
||||
|
||||
ImGui_NewFrame(window);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ImGui_endFrame(SDL_Window * window) {
|
||||
// Rendering
|
||||
int display_w, display_h;
|
||||
SDL_GetWindowSize(window, &display_w, &display_h);
|
||||
glViewport(0, 0, display_w, display_h);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.4f);
|
||||
glClear(GL_COLOR_BUFFER_BIT);
|
||||
|
||||
ImGui::Render();
|
||||
ImGui_RenderDrawData(ImGui::GetDrawData());
|
||||
|
||||
SDL_GL_SwapWindow(window);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user