Commit graph

62 commits

Author SHA1 Message Date
Clownacy
e094f2ff68 Renderer backend fixes
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...
2019-08-11 05:22:02 +00:00
Clownacy
85f58d7d39 Rendering backend API naming improvements 2019-08-10 19:50:10 +01:00
Clownacy
2b86db32a0 Backend_Blit always uses a colour key 2019-08-10 19:31:45 +01:00
Clownacy
8acd46bce6 Move the font gamma-correction up to Font.cpp
Reduces duplicate code
2019-08-08 05:04:08 +00:00
Clownacy
7e926451de Optimise the gamma-correction
I should probably create a Common.cpp file or something
2019-08-08 02:59:02 +00:00
Clownacy
6a040c2248 Add missing #includes to rendering backends 2019-08-01 13:32:27 +00:00
Clownacy
42765792bc Shut up some warnings 2019-07-31 04:41:46 +00:00
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
6a7fd14833 Font refactor part 2: SDL_Surface
No per-component alpha support here
2019-07-23 17:20:56 +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
f1e6103a46 ...Actually add the SDL_Surface renderer file 2019-07-17 16:35:33 +01:00