diff options
author | Matthew Michelotti <michelotti.matthew@gmail.com> | 2018-06-14 20:55:34 -0500 |
---|---|---|
committer | Matthew Michelotti <michelotti.matthew@gmail.com> | 2018-06-14 20:55:34 -0500 |
commit | ca053dde0f0835476ab10d7ea19128392331ef57 (patch) | |
tree | 7131854df9801017c749a4f0b3d1fdf00b93c42b | |
parent | f7e382cb8747998c4807380f55cb8d853d0b1fbd (diff) |
updated doc comments
-rw-r--r-- | gate/src/app_context.rs | 5 | ||||
-rw-r--r-- | gate/src/core/sdl/mod.rs | 4 | ||||
-rw-r--r-- | gate/src/core/wasm/wasm_exports.rs | 4 | ||||
-rw-r--r-- | gate/src/renderer/renderer.rs | 3 |
4 files changed, 15 insertions, 1 deletions
diff --git a/gate/src/app_context.rs b/gate/src/app_context.rs index a2ed560..ac21747 100644 --- a/gate/src/app_context.rs +++ b/gate/src/app_context.rs @@ -71,7 +71,7 @@ impl<A: AppAssetId> AppContext<A> { /// This value will always be at most 1. pub fn native_px(&self) -> f64 { self.native_px } - /// Convenience method for aligning an `(x, y)` position to native pixels. + /// Convenience method for aligning an `(x, y)` position to the nearest native pixel boundaries. /// /// This is typically used to align a camera position. /// See also `self.native_px()`. @@ -83,6 +83,9 @@ impl<A: AppAssetId> AppContext<A> { } /// Closes the app entirely. + /// + /// When compiling to `wasm32-unknown-unknown`, the app may be resumed after it is closed + /// via invoking a JavaScript method. pub fn close(&mut self) { self.close_requested = true; } pub(crate) fn take_close_request(&mut self) -> bool { diff --git a/gate/src/core/sdl/mod.rs b/gate/src/core/sdl/mod.rs index 0fbc97b..55d5710 100644 --- a/gate/src/core/sdl/mod.rs +++ b/gate/src/core/sdl/mod.rs @@ -44,6 +44,10 @@ use self::app_clock::AppClock; use self::event_handler::EventHandler; use super::mark_app_created_flag; +/// Macro to be placed in the `main.rs` file for a Gate app. +/// +/// Currently, the only use this macro has is to export WASM functions for the app +/// when compiling to the `wasm32-unknown-unknown` target. #[macro_export] macro_rules! gate_header { () => {}; diff --git a/gate/src/core/wasm/wasm_exports.rs b/gate/src/core/wasm/wasm_exports.rs index 9b4d9d9..b95c980 100644 --- a/gate/src/core/wasm/wasm_exports.rs +++ b/gate/src/core/wasm/wasm_exports.rs @@ -84,6 +84,10 @@ pub fn gateWasmOnRestart() { app_runner_borrow_mut().on_restart(); } +/// Macro to be placed in the `main.rs` file for a Gate app. +/// +/// Currently, the only use this macro has is to export WASM functions for the app +/// when compiling to the `wasm32-unknown-unknown` target. #[macro_export] macro_rules! gate_header { () => { diff --git a/gate/src/renderer/renderer.rs b/gate/src/renderer/renderer.rs index 6cc837d..ef2de71 100644 --- a/gate/src/renderer/renderer.rs +++ b/gate/src/renderer/renderer.rs @@ -35,6 +35,9 @@ use super::core_renderer::CoreRenderer; /// Switching between different modes (or the same mode with different parameters) /// can be expensive, since it involves flushing graphics data and switching shaders, /// so try to minimize these switches. +/// +/// Note: due to recent refactorings, there is currently only one render mode, the "sprite mode". +/// This will likely change in the near future. pub struct Renderer<A: AppAssetId> { b: RenderBuffer, c: CoreRenderer, phantom: PhantomData<A> } impl<A: AppAssetId> Renderer<A> { |