summaryrefslogtreecommitdiff
path: root/engine/src/currently_bound.rs
diff options
context:
space:
mode:
Diffstat (limited to 'engine/src/currently_bound.rs')
-rw-r--r--engine/src/currently_bound.rs22
1 files changed, 22 insertions, 0 deletions
diff --git a/engine/src/currently_bound.rs b/engine/src/currently_bound.rs
new file mode 100644
index 0000000..eefa239
--- /dev/null
+++ b/engine/src/currently_bound.rs
@@ -0,0 +1,22 @@
+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,
+ }
+ }
+}