Sorry that it took ages. Oh, actually, I'm not able to test this AT ALL
because my awesomely amazing NVidia Optimus laptop CANNOT (what?!) do
VSync because of some bad design decisions from previous century that
led to the disaster that we now know as X11 and as I heard it is
impossible to work around that or something. Ugh.
This was a leftover from some not-well-thought-out design decision. The
function is now used exclusively for binding for draw, as all
framebuffer reading functions (blit(), read()) are doing the read
binding internally. Moreover it required the user to be extra careful on
ES2, because in many cases there are no separate binding points for
reading and drawing.
The function is now parameter-less and always bind the framebuffer for
drawing. The logic for internal binding was also simplified and on ES2
there are separate implementations for single/separate binding points.
For *Framebuffer::checkStatus() the documentation was updated to explain
the meaning of the parameter on ES2 implementation. Also removed the
need for FramebufferTarget::ReadDraw binding, as it was rather
confusing.
Old *Framebuffer::bind(FramebufferTarget) is now just an alias to the
parameter-less function, ignoring the parameter. Along with
FramebufferTarget::ReadDraw it is marked as deprecated and will be
removed in some future release.
I'm not exactly sure where was the actual problem, but it seems to
be related to definition of templated function with static member
variables in header file in combination with dynamic libraries, causing
multiple definitions of a symbol which did or did not lead to compile
error and/or things breaking in horribly unpredictable way.
Previously it was done via (undocumented) macros, depending on include
order, which is great until it breaks horribly after random unrelated
changes. Currently it is done via black template magic and I'm
still afraid of including it in the public documentation.
There should be no visible change to the end user except for possibly
one less randomly weird bug (#79? couldn't reproduce).
... well, looking at the diff, the solution is still an ugly **********,
but at least it seems to work.
It is often annoying to write e.g. this, especially in generic code:
T dot = Math::Vector<size, T>::dot(a, b);
When this is more than enough and the compiler can infer the rest from
the context:
T dot = Math::dot(a, b);
There are more downsides and confusing cases (you can call
Math::Vector<3, T>::dot(), Math::Vector3<T>::dot() and Color3::dot() and
it is still the same function), so I made these as free functions in
Math namespace. You can now also abuse ADL for the calls, but I would
advise against that for better readability:
T d = dot(a, b); // dot?! what on earth is dot? and what is a?
The only downside found when porting is that you need to specify the
type somehow when having both parameters as initializer lists:
T d = dot({2.0f, -1.5f}, {1.0f, 2.5f}); // error
T d = dot(Complex{2.0f, -1.5f}, {1.0f, 2.5f}); // okay
But that's probably reasonable (and it's also highly corner case,
the functions were used this way only in tests).
The original static member functions are of course still present, but
marked as deprecated and will be removed at some point in future.