NO OTHER CHANGES. This WILL NOT compile with SDL3.
This intermediate commit designed to make it easier to visualize the meaningful channges commit in the next commit.
This is (kind of) an OpenGL-only function, which should be avoided when SDL2 isn't using OpenGL.
The only alternative that is recommended is SDL_GetRendererOutputSize, which limits this fix to the SDL_Renderer backend. Still, I think it's better than nothing.
I say that SDL_GL_GetDrawableSize is "kind of" OpenGL-only because it does technically work even when SDL2 isn't using OpenGL.
It's just that it becomes a shim to SDL_GetWindowSize, which is not suitable for high-DPI usage because it reflects the size of the window in screen coordinates, not actual pixels, so it really should be avoided when not using OpenGL.
Currently, the implementation headers don't include the imgui.h header.
Which means that the compilation will fail if the implementation header
was included before the imgui.h header in the compilation unit. For
instance, a compilation unit with the following will work:
#include "imgui.h"
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
But a compilation unit with the following will fail because IMGUI_IMPL_API
and possibly other symbols will not be defined:
#include "imgui_impl_glfw.h"
#include "imgui_impl_opengl3.h"
#include "imgui.h"
This patch includes imgui.h in the implementation headers to make
inclusions order-invariant, which is a recommended practice.
Read examples/README.txt for some details.
ImDrawData: Added DisplayPos, DisplaySize fields honored by all backends (not strictly necessary to honor just now, but doing it to be ahead)