mirror of
https://github.com/italicsjenga/agb.git
synced 2025-01-26 00:56:38 +11:00
Update the rust doc
This commit is contained in:
parent
f3e3782699
commit
040ff2eb0c
1 changed files with 5 additions and 21 deletions
|
@ -114,7 +114,7 @@ pub use agb_image_converter::include_gfx;
|
||||||
|
|
||||||
/// This macro declares the entry point to your game written using `agb`.
|
/// This macro declares the entry point to your game written using `agb`.
|
||||||
///
|
///
|
||||||
/// It is already included in the template, but your `main` function must be annotated with `#[agb::entry]`, take no arguments and never return.
|
/// It is already included in the template, but your `main` function must be annotated with `#[agb::entry]`, takes 1 argument and never returns.
|
||||||
/// Doing this will ensure that `agb` can correctly set up the environment to call your rust function on start up.
|
/// Doing this will ensure that `agb` can correctly set up the environment to call your rust function on start up.
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
|
@ -125,9 +125,7 @@ pub use agb_image_converter::include_gfx;
|
||||||
/// use agb::Gba;
|
/// use agb::Gba;
|
||||||
///
|
///
|
||||||
/// #[agb::entry]
|
/// #[agb::entry]
|
||||||
/// fn main() -> ! {
|
/// fn main(mut gba: Gba) -> ! {
|
||||||
/// let mut gba = Gba::new();
|
|
||||||
///
|
|
||||||
/// loop {}
|
/// loop {}
|
||||||
/// }
|
/// }
|
||||||
/// ```
|
/// ```
|
||||||
|
@ -180,13 +178,7 @@ static mut GBASINGLE: single::Singleton<Gba> = single::Singleton::new(unsafe { G
|
||||||
/// The Gba struct is used to control access to the Game Boy Advance's hardware in a way which makes it the
|
/// The Gba struct is used to control access to the Game Boy Advance's hardware in a way which makes it the
|
||||||
/// borrow checker's responsibility to ensure no clashes of global resources.
|
/// borrow checker's responsibility to ensure no clashes of global resources.
|
||||||
///
|
///
|
||||||
/// This is typically created once at the start of the main function and then the various fields are used
|
/// This is will be created for you via the #[agb::entry] attribute.
|
||||||
/// to ensure mutually exclusive use of the various hardware registers. It provides a gateway into the main
|
|
||||||
/// usage of `agb` library.
|
|
||||||
///
|
|
||||||
/// # Panics
|
|
||||||
///
|
|
||||||
/// Calling this twice will panic.
|
|
||||||
///
|
///
|
||||||
/// # Examples
|
/// # Examples
|
||||||
///
|
///
|
||||||
|
@ -197,9 +189,7 @@ static mut GBASINGLE: single::Singleton<Gba> = single::Singleton::new(unsafe { G
|
||||||
/// use agb::Gba;
|
/// use agb::Gba;
|
||||||
///
|
///
|
||||||
/// #[agb::entry]
|
/// #[agb::entry]
|
||||||
/// fn main() -> ! {
|
/// fn main(mut gba: Gba) -> !
|
||||||
/// let mut gba = Gba::new();
|
|
||||||
///
|
|
||||||
/// // Do whatever you need to do with gba
|
/// // Do whatever you need to do with gba
|
||||||
///
|
///
|
||||||
/// loop {}
|
/// loop {}
|
||||||
|
@ -219,13 +209,7 @@ pub struct Gba {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Gba {
|
impl Gba {
|
||||||
/// Creates a new instance of the Gba struct.
|
#[doc(hidden)]
|
||||||
///
|
|
||||||
/// Note that you can only create 1 instance, and trying to create a second will panic.
|
|
||||||
///
|
|
||||||
/// # Panics
|
|
||||||
///
|
|
||||||
/// Panics if you try to create the second instance.
|
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
unsafe { GBASINGLE.take() }
|
unsafe { GBASINGLE.take() }
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue