fmod/core/geometry/
mod.rs

1// Copyright (c) 2024 Lily Lyons
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
7use fmod_sys::*;
8
9mod general;
10mod polygons;
11mod spatialization;
12
13#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
14#[repr(transparent)] // so we can transmute between types
15pub struct Geometry {
16    pub(crate) inner: *mut FMOD_GEOMETRY,
17}
18
19unsafe impl Send for Geometry {}
20unsafe impl Sync for Geometry {}
21
22impl From<*mut FMOD_GEOMETRY> for Geometry {
23    fn from(value: *mut FMOD_GEOMETRY) -> Self {
24        Geometry { inner: value }
25    }
26}
27
28impl From<Geometry> for *mut FMOD_GEOMETRY {
29    fn from(value: Geometry) -> Self {
30        value.inner
31    }
32}