imgui_sdl.h 803 B

1234567891011121314151617181920
  1. #ifndef IMGUI_SDL_H
  2. #define IMGUI_SDL_H
  3. struct ImDrawData;
  4. struct SDL_Renderer;
  5. namespace ImGuiSDL {
  6. // Call this to initialize the SDL renderer device that is internally used by the renderer.
  7. void Initialize(SDL_Renderer* renderer, int windowWidth, int windowHeight);
  8. // Call this before destroying your SDL renderer or ImGui to ensure that proper cleanup is done. This doesn't do anything critically important though,
  9. // so if you're fine with small memory leaks at the end of your application, you can even omit this.
  10. void Deinitialize();
  11. // Call this every frame after ImGui::Render with ImGui::GetDrawData(). This will use the SDL_Renderer provided to the interfrace with Initialize
  12. // to draw the contents of the draw data to the screen.
  13. void Render(ImDrawData* drawData);
  14. }
  15. #endif