Advantages:
* The enums were large (600-800 lines) and they polluted the header,
now they are in separate files (except for BufferTexture, which has
the enum small enough to be left in the same file).
* Image classes now don't need to include OpenGL headers, as they were
needed only for the enum values. With advantage of C++11's forward
enum declarations there is no need to include the enum headers
anywhere in implementation, only when particular values are needed.
* The values are now less verbose:
AbstractTexture::InternalFormat::RGB8 // before
TextureFormat::RGB8 // now
* Resolved another "trivial choice" problem (thanks @JanDupal for
introducing this term to me): how to specify the format if there are
ten ways to do it (some being massively confusing):
Image2D::Format f = AbstractImage::Format::RGB; // too long...
Image2D::Format f = Image3D::Format::RGBA; // why 3D? this works?
Image2D::Format f = BufferImage1D::Format::RGBA; // wat?
It is even worse (and more verbose) with textures:
Texture2D::InternalFormat f =
CubeMapTextureArray::InternalFormat::RGB8; // this is allowed?
To have consistent naming this change was done also with
BufferTexture::InternalFormat (now BufferTextureFormat), although there
were no trivial choice issues and the enum isn't too large. But at least
it is now less typing.
There will be more parameters like row length etc. which would need to
be passed too. This function now expects properly formatted empty image
which it fills with data.
Robust *Framebuffer::read() access, ability to query robust buffer
access behavior in Context::flags(), ability to check graphics reset
status and reset notification policy in Renderer.
Moved all instantiation into instantiation.cpp and removed the rest
(~200 lines of mainly license headers). Saves another ~3 seconds (4:06
before, 4:03 now). I'm done with these micro-optimizations for now.
Moved almost everything into one file, instead of compiling ~50k LOC
seven times it is now compiling 56k LOC only once. This saves another ~5
seconds of compilation time (before ~4:11, now ~4:06).
Also explicitly saying that we are instantiating Float version of all
classes. In the future we might have compile switch for building also
Double one, this helps with consistency.
Constructor, destructor and all virtual functions are moved into
implementation file, so they don't need to be recreated and add into
binary on every usage. Should save a bit on resulting file size.
Created less-templated base for FeatureGroup and moved its
implementation into *.hpp file, allowing to remove <algorithm> header
from FeatureGroup.h (and meanwhile removing forgotten one also from
AbstractGroupedFeature.h). Saved another ~10 seconds of compilation time
(previously ~4:21, now ~4:11).
31ce072f39 was wrong, this header is
harmful. This beast includes ~46k LOC, much more than <*stream> class of
headers. Rewritten min() and max() manually, which surprisingly leads to
shorter implementation than previously. Compilation time on my machine
reduced from ~4:30 to ~4:21, not bad.
Rudely written to work only with fairly recent extensions and nothing
less than GLSL 3.30. It requires geometry shaders for wireframe
rendering, without it it behaves the same as Shaders::Flat.
Now using const reference to the shape instead of non-const one, also
removed some duplicated code and unneeded includes from the switch,
these operations are done in renderer implementations themselves.
The feature is now templated on shape type, which makes it actually
useful, as it is possible to conveniently query shape parameters from
it. It has now non-templated base and ObjectShapeGroup operates only
with it.
Allows to use them in (future) ObjectShape construction without unneded
verbosity:
new Physics::ObjectShape<Physics::Point2D>(o, {{1.0f, -2.5f}});
instead of:
new Physics::ObjectShape<Physics::Point2D>(o, Physics::Point2D(...));
This class now stores the tree in flat array, making it easier for user
to query the contents, but the internals are much more complicated. This
solution already reduces allocation count by count of nodes in the tree,
future work might remove the per-shape allocation altogether by using
large typeless array and placement-new etc.