Skip to content

v6.2.0

Latest

Choose a tag to compare

@brettchalupa brettchalupa released this 02 Jun 17:08
· 2 commits to main since this release
Immutable release. Only release title and notes can be modified.
f925efe

BREAKING

  • RaylibHandle::load_shader and load_shader_from_memory are now fallible
    (#51). Both return Result<Shader, Error> instead of Shader. raylib
    silently logs a warning and substitutes the default shader when a file is
    missing or a shader fails to compile, so the old signatures made those
    failures look like success. load_shader now also checks each provided path
    exists before calling raylib, necessary because a missing file comes back as
    the (valid, non-zero) default shader id and is otherwise undetectable. This is
    a breaking signature change, but a loud, compile-time one: add ? or
    .unwrap() at the call site.

    // before
    let shader = rl.load_shader(&thread, None, Some("grayscale.fs"));
    // after
    let shader = rl.load_shader(&thread, None, Some("grayscale.fs"))?;

    Caveat: a vertex/fragment pair that compiles individually but fails to link
    still slips through, since raylib reassigns the default shader id internally
    and the failure can't be observed from the binding.

  • Image::load_image_anim and load_image_anim_from_memory are now
    fallible
    (#51). Both return Result<Image, Error> instead of Image,
    checking for the null data raylib hands back on failure. This brings them in
    line with their non-animated siblings (load_image, load_image_raw,
    load_image_from_mem), which already returned Result. Add ? or
    .unwrap() at the call site.

Added

  • RaylibHandle::request_quit. Programmatic quit for the
    sola_raylib::core::game_loop::run helper (and any hand-rolled
    while !rl.window_should_close() loop). Wire it up to a quit menu item,
    gamepad button, "game over" transition, etc. window_should_close returns
    true on the next check; on emscripten the registered main loop is cancelled on
    the next frame. The default ESC / window-close-button paths still work exactly
    as before. The existing set_exit_key API remains the way to change or
    disable the default exit key.

Fixed

  • Windows MSVC builds now work from a plain shell (#56). When
    configure_windows_cmake_generator picked Ninja (auto-selected when ninja
    is on PATH), cmake invoked cl.exe directly and failed to find
    <windows.h> unless you'd launched cargo from a Developer Command Prompt or
    run vcvars*.bat first. The build script now uses
    cc::windows_registry::find_tool to locate the MSVC toolchain and injects its
    INCLUDE / LIB / PATH into the build env. No-op if you're already in a
    vcvars shell (INCLUDE is set) or targeting a non-msvc target. Thanks to
    @lofcz.
  • The sdl feature now links the correct SDL version on Windows (#57).
    The build script decided between SDL2 and SDL3 by probing pkg-config, which
    Windows does not ship, so it always fell through to linking SDL2 regardless of
    what raylib's CMake actually compiled against. It now reads raylib's resolved
    choice from the generated raylib-config.cmake (find_dependency(SDL3 ...)
    vs SDL2) and links the matching library, on every platform and with no
    pkg-config dependency.