raylib-rs icon indicating copy to clipboard operation
raylib-rs copied to clipboard

WIP: 4.5.0 + various redesign

Open TSnake41 opened this issue 2 years ago • 3 comments

Built on top of https://github.com/deltaphc/raylib-rs/tree/4.2.0

Along with 4.5.0 support (albeit without its added features), this branches features this :

  • add make_bound_thin_wrapper! to create raylib objects that has a shorter lifetime than RaylibHandle, port relevant types to this, including appropriate lifetime parameters
    • it forbids using a raylib object (e.g font) after RaylibHandle is dropped
  • try to make update_audio_stream a bit safer
  • use RaylibBuffer<T> instead of "rslices"
  • redesign get_dropped_files with iterators
  • make compress_data/decompress_data less leaky using RaylibBuffer<T>
  • fix get_window_state
  • add a experimental closure-based RaylibRenderLoop to manage RaylibDrawHandle
    • may be better for web support, but a bit more complex, it was the only thing that worked for me with lifetime changes
    • did some other changes to avoid mutable borrows that drove me crazy without sacrificing safety

and probably some other things

Samples still need to be updated.

TSnake41 avatar Jan 28 '23 22:01 TSnake41

How is the status of this? Is it usable right now?

I would love to have this merged and usable.

Rucadi avatar Apr 14 '23 13:04 Rucadi

How is the status of this? Is it usable right now?

I would love to have this merged and usable.

It is somewhat usable (not thoroughly tested). You can check https://github.com/tsnake41/raylib-rs-games for some examples.

TSnake41 avatar Apr 14 '23 18:04 TSnake41

it is outdated, right?

MatejMagat305 avatar Jun 13 '24 12:06 MatejMagat305