Jan
21
2014

January updates to Magnum

IT

Since the previous October snapshot Magnum gained Visual Studio port, font conversion utility, improved text rendering along with example application, support for OpenGL debug output, documentation updates, better test coverage and many more usability improvements and fixes.

The January snapshot is available under snapshot-2014-01 tag in Corrade, Magnum, Magnum Plugins and Magnum Integration GitHub repositories. This article will describe the most important changes, for all the commits that went to master branches since the October snapshot (tagged snapshot-2013-10) see logs in Corrade, Magnum, Magnum Plugins and Magnum Integration, respectively.

For compatibility branch there is tag snapshot-2014-01-compatibility in Corrade, Magnum and Magnum Plugins repositories.

Google Groups discussion

You can now ask for help, share your work or participiate in development at the new Google Groups forum. The group is open to everyone, you just need Google account to post. In my opinion this is better than requiring everyone to create new account on some self-hosted forum.

New text rendering example

I added text rendering example to showcase new features such as text alignment and multi-line text, in addition to already existing distance-field rendering capabilities. See showcase page for live application running on both Emscripten and Native Client. I also added live Textured Triangle example.

Using absolute includes by default

All projects were switched to use absolute includes by default, i.e. headers are included this way:

#include <Magnum/Math/Vector3.h>

rather than this way:

#include <Math/Vector3.h>

This solves many problems with filename collisions (namely with Visual Studio compiler, Doxygen and possibly elsewhere), see GitHub Issue #36 for more information. As this is a very drastic change, you may need to recreate your build directories and update at least FindCorrade.cmake and FindMagnum.cmake CMake modules with new ones from modules/ subdirectory in Corrade and Magnum repositories (and possibly also other ones).

If you are building with deprecated features enabled (BUILD_DEPRECATED CMake parameter in both Corrade and Magnum), you can still use the old non-absolute includes, but you are encouraged to switch to absolute ones.

Visual Studio 2013 support

This release is the first one with experimental Visual Studio 2013 support. Because the compiler still lacks some required features (constexpr and noexcept keywords) and has some serious bugs in C++11 implementation, the support is provided only through compatibility branch. The port involves some ugly hacks and workarounds which can't be put in master, hopefully the next MSVC release will make my life easier. Snapshot of compatibility branch with MSVC 2013 support is available under snapshot-2014-01-compatibility tag in Corrade and Magnum GitHub repositories. The compatibility branch doesn't contain anything new except workarounds for said compilers.

Corrade

Dependency changes

No dependency changes in this release.

New features

Changes

  • TestSuite tests now display ?: <unknown>() in test output for test cases without any checks to make them more discoverable
  • Skipped test cases in TestSuite tests are displayed without useless file/line information (unlike failed test cases, where the information is needed)
  • All deprecated functions and types are now emitting compiler warnings to encourage updating the code
  • Various documentation and example updates and improvements

Bug fixes

  • TestSuite::Compare::*File* is comparing the files in binary mode to avoid platform-dependent EOL issues.
  • Utility::Resource now properly handles empty files when compiling resources.
  • Utility::Directory is now working properly under Windows.
  • Fixed compilation issues with Clang and libc++
  • Fixed various compilation issues under MSVC (and worked around a much larger amount of compiler bugs)

Deprecated APIs

Removed APIs

  • Removed Utility::log2() and Utility::pow2() utility functions, as they weren't used anywhere anymore (and the latter one was a bad joke)
  • Removed useless metadata from PluginManager::PluginMetadata class (author name, version, description), as they don't fit current use case anymore (they were used back in 2007 when Corrade was part of Kompas). These metadata can be easily added back as custom configuration values.
  • Removed now useless Utility::Translator class, it was used only for plugin metadata and was prime example of bad design (exposing unguarded naked pointers)

Internal changes

  • Using Jenkins Continuous Integration to maintain compilable and bug-free state of the project more easily. Currently GCC 4.8, 4.7, 4.6, 4.5, 4.4, Clang 3.3, Clang 3.3 with libc++, Emscripten, x86-32/x86-64 Native Client and MinGW32 compilers are tested with both shared and static libraries. Separately testing builds with deprecated features enabled and disabled.
  • All files from src/ directory were moved to src/Corrade, examples/ directory was moved to src/examples (required to make inter-project includes absolute, as mentioned above)

Magnum

Dependency changes

No dependency changes in this release.

New features

Changes

  • The magnum-distancefield utility is now named magnum-distancefieldconverter for consistency with other command-line utilities
  • ImageReference class now stores const data pointer instead of mutable one, modifying the data through the class interface isn't valid use case anyway
  • Added default template parameter to Buffer::data() and made *Image::data() templated to have them consistent. Note that this is source-compatible change.
  • Query::result<bool>() returns true if value is nonzero (was returning true only for value of 1 previously)
  • All functions in MeshTools namespace are now returning either Corrade::Containers::Array or std::unique_ptr instead of naked pointers to avoid accidental out-of-bounds access and memory leaks
  • All functions in Text namespace are now returning std::unique_ptr instead of naked pointers to avoid accidental memory leaks
  • Implementation of Platform::*Application::viewportEvent() is not required anymore, because in many cases the application doesn't need to react to window resize events at all
  • Textured Shaders::Flat now multiplies texture with the specified color instead of ignoring it. See also GitHub Pull Request #34
  • All deprecated functions and types are now emitting compiler warnings to encourage updating the code
  • Various documentation and example updates and improvements

Bug fixes

  • Fixed CubeMapTextureArray::image() function (more precisely it wasn't working at all). See also GitHub Issue #31.
  • Fixed wrong assertion in Texture::setWrapping() for rectangle textures
  • Fixed wrong assertion in AbstractImage::pixelSize() when computing size of separate depth and stencil formats
  • Mesh::addVertexBuffer() now properly computes offsets for matrix attributes
  • Taking index buffer offset into account in MeshView class
  • Fixed various issues with textured Shaders::Flat shader (actually the textured version was not working at all)
  • Various OS X-related fixes in Shaders library. See also GitHub Issue #27.
  • Fixed building issues when both SDL1 and SDL2 is installed on OS X. See also GitHub Issue #25.
  • Fixed building issues with CMake-generated XCode project on OS X. See also GitHub Issue #37.
  • Proper and failsafe OpenGL 3 context creation on OS X (3.0 is implemented only as core context, thus requesting 2.1 won't expose newer features). See also GitHub Issue #26 and #35.
  • Fixed compilation issues with Clang and libc++
  • Fixed various compilation issues under MSVC (and worked around an insane amount of compiler bugs)

Deprecated APIs

  • Buffer::Usage enum is deprecated to reduce header dependencies, use global BufferUsage enum instead
  • Mesh::Primitive enum is deprecated to reduce header dependencies, use global MeshPrimitive enum instead
  • Sampler::maxAnisotropy() is deprecated to avoid naming conflict with *Texture::setMaxAnisotropy(), use Sampler::maxMaxAnisotropy() instead
  • Magnum::Geometry::Rectangle class (and Rectangle* typedefs) is deprecated, use more generic and feature-rich Math::Range instead.
  • Platform::Sdl2Application::Configuration::setFlags() function and related enum is deprecated to avoid naming conflict in the future, use Platform::Sdl2Application::Configuration::setWindowFlags() instead
  • SceneGraph::Animable::group() is deprecated, use non-ambiguous SceneGraph::Animable::animables() instead
  • Magnum/Shaders/magnumShadersResourceImport.hpp header is deprecated in favor of less verbose Magnum/Shaders/resourceImport.hpp
  • Text::TextRenderer class (and Text::TextRenderer2D, Text::TextRenderer3D typedefs) is deprecated, use less redundant name Text::Renderer instead

Removed APIs

  • Removed SceneGraph::*Transformation::move() from 2D transformation classes. It was originally meant for modifying draw order, but as the draw order is managed by SceneGraph::DrawableGroup class and not by parent object, this function is essentially useless.

Internal changes

  • Added thorough tests for all core OpenGL functionality to make refactoring easier
  • Various internal optimizations and cleanup to make maintenance easier
  • Using Jenkins Continuous Integration to maintain compilable and bug-free state of the project more easily. Currently GCC 4.8, 4.7, 4.6, 4.5, 4.4, Clang 3.3, Clang 3.3 with libc++, Emscripten, x86-32/x86-64 Native Client and MinGW32 compilers are tested with both shared and static libraries. Separately testing builds with deprecated features enabled and disabled. Also explicitly testing desktop OpenGL, OpenGL ES 2.0, desktop OpenGL ES 2.0 emulation, OpenGL ES 3.0 and desktop OpenGL ES 3.0 emulation.
  • All files from src/ directory were moved to src/Magnum, external/ directory was moved to src/MagnumExternal (required to make inter-project includes absolute, as mentioned above)

Magnum Bootstrap

  • Added new base-sdl2 bootstrap application so you can start using SDL2 easier
  • Adapted all bootstrap applications to Magnum improvements

Magnum Plugins

Dependency changes

No dependency changes in this release.

New features

  • All classes in documentation are now shown with corresponding #include path

Changes

Internal changes

  • Using Jenkins Continuous Integration to maintain compilable and bug-free state of the project more easily. Currently GCC 4.8, 4.7, 4.6, 4.5, 4.4, Clang 3.3, Clang 3.3 with libc++, Emscripten, x86-32/x86-64 Native Client and MinGW32 compilers are tested with both shared and static libraries. Separately testing builds with deprecated features enabled and disabled. Also explicitly testing desktop OpenGL, OpenGL ES 2.0, desktop OpenGL ES 2.0 emulation, OpenGL ES 3.0 and desktop OpenGL ES 3.0 emulation.
  • All files from src/ directory were moved to src/MagnumPlugins (required to make inter-project includes absolute, as mentioned above)

Magnum Integration

Dependency changes

No dependency changes in this release.

New features

  • Initial documentation
  • All classes in documentation are now shown with corresponding #include path

Deprecated APIs

No API was deprecated in this release.

Removed APIs

No deprecated API was removed in this release.

Internal changes

  • All files from src/ directory were moved to src/Magnum (required to make inter-project includes absolute, as mentioned above)
» Add comment

Discussion: 0 comments

No comments yet.