The only places where they aren't absolute are:
- when header is included from corresponding source file
- when including headers which are not part of final installation (e.g.
test-specific configuration, headers from Implementation/)
Everything what was in src/ is now in src/Corrade, everything from
src/Plugins is now in src/MagnumPlugins, everything from external/ is in
src/MagnumExternal. Added new CMakeLists.txt file and updated the other
ones for the moves, no other change was made. If MAGNUM_BUILD_DEPRECATED
is set, everything compiles and installs like previously except for the
plugins, which are now in MagnumPlugins and not in Magnum/Plugins.
We don't have extension loader for ES yet, thus we need to abort on
these to avoid undefined behavior. The only exception is NaCl, which
provides _some_ extensions without the need for extension loader. These
extensions are implemented in particular:
CHROMIUM_map_sub
EXT_occlusion_query_boolean
This extension is ubiquitous, but to make users' life even easier we
now provide no-op fallback for both Sampler::maxAnisotropy() and
Texture::setMaxAnisotropy().
Move constructor and move assignment is now noexcept and it just swaps
the data of the two instances instead of calling GL API, thus it can be
inline. Also removed unneded limitations in BufferTexture.
Move constructor and move assignment now behaves similarly to Image
(not only the buffer but also size is swapped). Added constructor taking
size + data, reordered setData() parameters to match order in Image. The
old setData() function is now alias to the new one, is marked as
deprecated and will be removed in future release.
Can't test EXT_debug_label, as that is apparently OSX 10.9-only. Added
GL tests for all implemented objects. KHR_debug is selected first, if
that is not available, fall back to EXT_debug_label. If neither is
available, the functions are no-op.
I hope EXT_debug_label gets replaced by KHR_debug later, thus it is now
only "emulated" through KHR_debug enums.
Until recently (or maybe not too recently) ES3 extension header was
"currently empty", now the extension header is shared with ES2. It's
nice to finally get rid of all the weird ifndefs.
Buffer usage is used as parameter in many functions, e.g. in
*Framebuffer::read() and *Texture::image(), but they are rather seldom
used and including whole Buffer.h file just for one enum is just
overkill. The old Buffer::Usage is now alias to BufferUsage, it is
marked as deprecated and will be removed in future release.
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.
Caused in 6ee2745503, I accidentaly
removed code that initialized the array to proper length. Again I
experienced how useful unit tests for GL functionality would be.
Renamed AbstractTexture::maxSupportedLayerCount() to maxLayers(),
which is in fact alias to Shader::maxCombinedTextureImageUnits(). Also
renamed Samples::maxSupportedAnisotropy() to maxAnisotropy(). It now
has slightly confusing naming, will fix that later. Both
original functions are now alias to new ones to retain source
compatibility, will be removed in future releases.
Also printing the values in magnum-info.
Passing pointer as function parameter will now mean that it is possible
to pass `nullptr`. Some code examples now look like the parameter is
copied instead of referenced, which is misleading. Updated the
documentation to reflect that more clearly.
Makes some cases less consistent (and some convenience shortcuts
impossible), but goes well with the attitude "don't use pointer when it
can't be null".
Avoids some nullptr-related errors and leads to simpler implementation,
as we need to only handle ImageReference and BufferImage types. All
other Image classes are implicitly convertible to ImageReference and
implicit conversion works only with references, not with pointers. The
usage might be clumsy at this point, as Trade::*Importer classes return
pointer to Trade::ImageData which then needs to be dereferenced.
Hopefully introducing C++14's std::optional (or equivalent) might help
solve that issue.
Also removed "convenience" overloads for setting e.g. 2D subdata of 3D
texture. The convenience overload doesn't cover all subdata cases (only
XY plane, not YZ or XZ ones) and overly complicates the implementation.
This can be done in the future in Image classes themselves.
It's now possible to call *Texture::setStorage() even if
OpenGL 4.2, ARB_texture_storage, OpenGL ES 3.0 or EXT_texture_storage in
ES 2.0 is not available, the function will internally use sequence of
setImage() calls as fallback.
It seems to me that this behavior is better than forcing the user to
always check for extension presence and then implementing this
functionality again and again. The huge switches for setting proper
image format and type are ugly though, but according to specs they must
be set even if we are sending no data (which is weird).
Solves another trivial choice (similar to the one with TextureFormat
etc. in 7de45c98b1), less typing and also
preparation for ARB_sampler_objects extension.
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.
If ARB_invalidate_subdata is not available, these functions do nothing,
instead of crashing on null pointer dereference. It results in more
convenient usage, enabling users to call them whenever they want,
improving performance on implementations which supports that.
Got rid of InternalFormat class, now it is all in one big enum, as each
version (desktop, ES2, ES3) has different requirements and it can't be
done that way anymore (moreover that was terribly ugly solution).