This is source-incompatible change, but this function probably wasn't
used much in user code, rather its Mesh/Buffer convenience overload.
Actually Containers::Array<char> has _implicit_ conversion operator to
char*, but this should not be an issue, as the conversion is not allowed
on rvalue references, thus the following code shouldn't compile at all.
Not available on GCC < 4.8.1, though.
// ...
char* data;
std::tie(..., data) = MeshTools::compressIndices(...);
Makes the copying code simpler. Also added assertion that we copy into
available memory and not somewhere out of bounds. The test now fails the
assertion.
GL_NONE is fortunately zero, so we can skip std::fill_n altogether and
replace it with zero-initialized allocation. Added just-in-case
static_assert to check that.
Makes the lines shorter, the conversions are mainly from strongly-typed
enums to underlying type, so nothing potentially harmful which should be
marked with static_cast.
We have std::memset for that. What the hell I was thinking back then.
Found when trying to get rid of as many naked allocations and deletions
as possible. Also improved the test with some ASCII-art documentation.
The original code assumed that the text bounds lower left corner is
always at origin. It is now not the case with multi-line text. All tests
now pass again.
All three rendering functions (separated, interleaved with upload to GPU,
interleaved with mapping to GPU) are now using common code and then they
reorder the data to fit particular requirements. The data shuffling might
slow down things a bit, but it is optimized for the most common path (we
are rendering to interleaved array, which then get unpacked if needed,
not the other way around), so it shouldn't be an issue. No premature
optimization again, please.
The virtual method is moved to doRenderGlyph(), for plugin implementers
it means that the function only needs to be renamed (and moved to private
section) and plugin version interface needs to be updated.
The common layouting code allows to remove many redundant code from
Renderer and also ability to test cursor position/bounding rectangle
updated properly. Rectangle updating now treats rectangle with zero size
as invalid and replaces it with glyph quad instead of merging the two. It
means that the returned rectangle now wraps the text more tightly and
does not always contain origin.
Got finally pissed with the requirement of setting AbstractFont::_size
manually and took this as opportunity to rework the internal plugin API
in a better way. Bumped the interface version, as this is binary
incompatible. MagnumFont doesn't support lineHeight yet.
The loader now doesn't attempt to check for extensions and just loads the
function pointers. It was doing that for all core functions anyway, so a
few more DSA functions won't hurt the loading times too much. Should fix
issues with core-only contexts on OSX.
No redundant naming. Text::Renderer2D and Text::Renderer3D is typedef'd
to old name, the typedefs are deprecated and will be removed in some
future release.