diff --git a/src/tvgWindow.cpp b/src/tvgWindow.cpp index 25afc7a..7d9b113 100644 --- a/src/tvgWindow.cpp +++ b/src/tvgWindow.cpp @@ -276,8 +276,10 @@ void GlWindow::resize() Window::resize(); // set the canvas target and draw on it. - // TODO: When using SDL3, EGLDisplay and EGLSurface may need to be passed as arguments to target(). - CHECK(static_cast(canvas)->target(nullptr, nullptr, context, 0, size.w, size.h, tvg::ColorSpace::ABGR8888S)); + auto display = SDL_EGL_GetCurrentDisplay(); + auto surface = display ? SDL_EGL_GetWindowSurface(window) : nullptr; + + CHECK(static_cast(canvas)->target(display, surface, context, 0, size.w, size.h, tvg::ColorSpace::ABGR8888S)); } void GlWindow::refresh()