use crate::core::drawing::RaylibDraw;
use crate::ffi;
#[repr(i32)]
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum MatrixMode {
ModelView = ffi::RL_MODELVIEW as i32,
Projection = ffi::RL_PROJECTION as i32,
Texture = ffi::RL_TEXTURE as i32,
}
pub struct RlMatrix<'a, T: RaylibDraw>(&'a mut T);
impl<T: RaylibDraw> Drop for RlMatrix<'_, T> {
fn drop(&mut self) {
unsafe { ffi::rlPopMatrix() }
}
}
impl<T: RaylibDraw> std::ops::Deref for RlMatrix<'_, T> {
type Target = T;
fn deref(&self) -> &T {
self.0
}
}
impl<T: RaylibDraw> std::ops::DerefMut for RlMatrix<'_, T> {
fn deref_mut(&mut self) -> &mut T {
self.0
}
}
impl<'a, T: RaylibDraw> RlMatrix<'a, T> {
pub(crate) fn new(parent: &'a mut T) -> Self {
RlMatrix(parent)
}
}