Skip to content

dgm-lib v3.0.0

Choose a tag to compare

@nerudaj nerudaj released this 06 Jun 09:54
· 41 commits to main since this release
719098d

dgm-lib v3.0.0

  • Library target has been renamed to dgm-lib and a dgm::dgm-lib alias has been added. Use that for linking
  • You can now use find_package on a downloaded release to easily link the library. See docs/integration for details
  • You can force dgm-lib to use an external installation / clone of SFML to maintain a consistent version with other libraries. See docs/integration for details
  • dgm::AppStateConfig marked as final
  • dgm::Clip is now nodiscard and final
  • dgm::Camera is now final
  • dgm::Error replaces dgm::ErrorMessage
    • Contains message and a stacktrace
    • This is a std::expected version of dgm::Exception
  • dgm::ResourceManager has been streamlined
    • get and getMutable are now throwing so they can return references directly
      • No more .value().get() pattern
      • Resource not present is treated as a precondition fail
    • LoadCallback now returns std::expected<T, dgm::Error> instead of having an inout T parameter
      • Resources no longer have to be default-constructible (yay, RAII), but they have to be movable
      • Two moves are issued per resource load, but that's a price I am willing to pay for RAII
    • loadResourcesFromDirectory is no longer recursive because Android NDK is shit
    • All dgm::Utility::load* functions have been adjusted
    • dgm::ParticleSystemInterface is now explicit
  • Previously deprecated default constructors were removed (dgm::Clip, dgm::TileMap, dgm::Path)
  • Moved PreallocatedMemoryAmount from dgm::DynamicBuffer template parameters to the constructor parameters
    • Also made the whole thing explicit
  • Added examples
    • example-08-pathfinding showcasing dgm::NavMesh
    • example-09-collisions showcasing dgm::Collision
    • example-10-camera-minimap showcasing how to use multiple dgm::Camera objects
    • example-11-appstate showcasing how to use dgm::App and implement custom dgm::AppState derivates
  • Default constructor of dgm::Animation was removed
  • dgm::Animation is nodiscard and final, most of the interface is noexcept
  • dgm::Time is nodiscard
  • dgm::Window::getWindowContext renamed to getSfmlWindowContext
  • dgm::Window::beginDraw renamed to clear
  • dgm::Window::endDraw renamed to display
  • dgm::Controller completely revamped
    • No longer dependent on xinput
    • getInputValue/isInputToggled replaced with readAnalog/readDigital
    • update method was removed
  • dgm::GenericMesh has deleted copy constructor and an explicit clonemethod
  • dgm::GeneralMesh constructor accepting vector of bools has been removed
  • Compilation for Android is supported
  • SFML bumped to v3.0.0
    • dgm::Camera dropped all methods that used separate x, y coordinates in favor of sf::Vector versions
    • setRotation/rotateGradually now accepts sf::Angle instead of float
    • dgm::Window::pollEvent now returns std::optional<sf::Event> and accepts no parameters
    • Math utils migrated to use sf::Angle
      • polarToCartesian overload accepting PolarCoords struct was removed
      • cartesianToPolar overload accepting two floats was removed
    • dgm::Cone migrated to use sf::Angle
    • dgm::Particle migrated to use sf::Angle
    • dgm::Math::map removed
    • dgm::Math::getRotated removed, replaced by sf::Vector2::rotateBy
    • dgm::Math::getDotProduct removed, replaced by sf::Vector2::dot
    • dgm::Math::getSize removed, replaced by sf::Vector2::length
    • dgm::Math::polarToCartesian removed, replaced by sf::Vector2 constructor accepting length and angle
    • dgm::Particle and related particle system classes now internally allocate 6 vertices instead of 4, because sf::PrimitiveType::Quads was removed.