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

RaylibHandle and other, &self only instead of &mut self

Open SrMordred opened this issue 3 years ago • 1 comments

(I´m Rust noob so bear with me)

Any particular reason to make Raylib functions be &mut self instead of &self, since it didn´t have any state ? I found it easier to extends RaylibDraw functionality when its only &self (experimented changing the source, and it worked fine for me )

SrMordred avatar Jan 21 '22 03:01 SrMordred

Two reasons. 1) So you can't use those functions in two separate threads. 2) So you know which functions mutate the underlying raylib state.

Dacode45 avatar Jan 21 '22 12:01 Dacode45