summaryrefslogtreecommitdiff
path: root/engine/src/opengl/currently_bound.rs
blob: be01841fd330721d9535711927e3866670d2f4e8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
use std::marker::PhantomData;

/// A token signifying a OpenGL object is currently bound.
pub struct CurrentlyBound<'token, Object>
{
    _token: PhantomData<&'token Object>,
}

impl<'token, Object> CurrentlyBound<'token, Object>
{
    /// Returns a new `CurrentlyBound`.
    ///
    /// # Safety
    /// A object must actually be currently bound. Otherwise, UB can occur.
    #[must_use]
    pub unsafe fn new() -> Self
    {
        Self { _token: PhantomData }
    }
}