Commit graph

12 commits

Author SHA1 Message Date
Clownacy
145864cf2d Added sanity checks to the backends
This fixes the Texture backend bug that made the program take forever
to shut down:

The problem was that the font system would try to load a glyph that's
0 pixels wide/tall (likely the space character), which SDL2 didn't
like, so it would fail to allocate the texture, causing
Backend_CreateSurface, and by extension Backend_CreateGlyph, to
return a NULL. Later, upon shutdown, the font system would pass this
NULL to Backend_FreeGlyph, causing NULL pointer dereferences that
make the program take forever to shut down.

Personally, I think passing NULLs to the backend is valid behaviour,
so I've added a bunch of sanity checks to make sure they're never
dereferenced.
2019-07-24 23:34:16 +01:00
Clownacy
9948fa8b07 Move the SDL_Window creation to the rendering backends
Whoops, didn't mean to commit the Main.cpp edit way back when I made
the OpenGL 2.1 backend.
2019-07-24 20:20:06 +01:00
Clownacy
0ce05e1837 Move a function 2019-07-23 23:13:57 +01:00
Clownacy
e170485849 Document a "bug" in the SDL_Texture backend 2019-07-23 23:11:24 +01:00
Clownacy
e2054918a6 Font refactor part 3: SDL_Texture
Getting kinda messy, having to maintain two different ways of
drawing - colour-key and alpha-blending. In the enhanced branch,
which uses alpha-blending for everything, these can be merged.

I'm noticing a huge delay in shutdown time. There's probably a bug
in here.
2019-07-23 21:49:40 +01:00
Clownacy
74c9931ebb Change the renderer backend API for uploading pixels
Also fix some blatant build errors. I must be going mad - I swear
I've fixed that typedef thing like twice already.
2019-07-19 08:45:59 +01:00
Clownacy
44456e4a25 Add an SDL_Surface-based renderer
Ha, my custom software renderer is faster!
2019-07-17 16:09:18 +01:00
Clownacy
f21f17f4c2 Cleanup 2019-07-17 14:13:49 +01:00
Clownacy
7c12e7817c Use SDL_ALPHA_OPAQUE 2019-07-16 00:37:31 +01:00
Clownacy
81eb438482 Fixes and tweaks 2019-07-16 00:15:20 +01:00
Clownacy
6a4f4e0df3 Added handlers for render target loss/window resize
These only really happen when you use exclusive fullscreen and
alt-tab out. Or, at least, it does on Windows with SDL2 in DirectX
mode.
2019-07-15 17:47:22 +01:00
Clownacy
b84661d88a Move the backend files around a bit 2019-07-15 17:01:42 +01:00
Renamed from src/Backends/SDLTexture.cpp (Browse further)