When DirectX-SDL2 loses its device, it doesn't lose its textures,
just their contents, so we shouldn't remake the textures when we
regenerate the glyphs (that's coming next commit).
Has the same imperfections: if you regenerate the surfaces while a
text box is open (and while using Courier New I guess), the text will
regenerate with smaller spaces.
Surface-to-surface blits were broken (would draw to screen instead),
and the SDLSurface backend wouldn't even compile.
You know, I thought I tested each backend when I made those changes
to the API...
Why can't any buildsystems just be good
Like, seriously? Why does pkg-config not have an OpenGL package,
so I don't have to deal with this stupid -lopengl32/-lGL stuff?
...Why isn't there a shim libGL that just maps straight to
opengl32.lib?
Arg
This way, I can use immediate mode, which is way faster than using
buffers for some reason. Since I'm not using profiles anymore, I
dropped the minimum requirement to OpenGL 3.1. If a driver doesn't
support Legacy GL, then it can use the slow buffer code.
But seriously, I need to figure out why using buffers is so slow.
If this was a common problem, Modern OpenGL wouldn't have made it the
only option.
For some reason CPU usage is still double that of the SDLTexture
backend (SDL2 uses OpenGL 2.1, with glEnable/glDisable-style
immediate mode).
If I downgrade to OpenGL 2.1, and use VBO-less glDrawArrays, I get
great performance. I just wish I knew what the AMD driver is doing
that's so much faster.
Turns out performance is absolutely abysmal on my laptop's copy of
Windows 10 (AMD A9 APU).
This is only one of the weird bottleecks: glFramebufferTexture2D
is a CPU sinkhole, so don't call it often.
This fixes this weird thing you'd see in the enhanced branch if the
screen is scaled (happens if you resize the window).
When the screen is scaled, OpenGL uses linear interpolation. This
would cause it to fetch samples from outside the texture. IIRC, by
default, the default behaviour is GL_REPEAT, which causes it to blend
with samples from the other side of the texture, creating strange
pixels at the end of the screen.