Register a callback with a priority. Returns an ID for removal. Lower priority numbers run first (matching R3F convention).
(&mut self, priority: i32, callback: extern "C" fn(f64))
| 34 | /// Register a callback with a priority. Returns an ID for removal. |
| 35 | /// Lower priority numbers run first (matching R3F convention). |
| 36 | pub fn register(&mut self, priority: i32, callback: extern "C" fn(f64)) -> u64 { |
| 37 | let id = self.next_id; |
| 38 | self.next_id += 1; |
| 39 | self.callbacks.push(FrameCallback { |
| 40 | priority, |
| 41 | callback, |
| 42 | active: true, |
| 43 | }); |
| 44 | self.ids.push(id); |
| 45 | self.sorted = false; |
| 46 | id |
| 47 | } |
| 48 | |
| 49 | /// Unregister a callback by ID. |
| 50 | pub fn unregister(&mut self, id: u64) { |
no test coverage detected