aboutsummaryrefslogtreecommitdiffstats
path: root/src/api/emscripten
diff options
context:
space:
mode:
authorPierre Krieger <pierre.krieger1708@gmail.com>2015-09-21 14:42:05 +0200
committerPierre Krieger <pierre.krieger1708@gmail.com>2015-09-23 13:11:47 +0200
commitaa9cb99929ee1893699184ded888b2586455f016 (patch)
treeb16503dbfe2248beeed0f7d82b150e64e6453043 /src/api/emscripten
parent3820d307a3f23828790e8a46a9c46849592104d6 (diff)
downloadglutin-aa9cb99929ee1893699184ded888b2586455f016.tar.gz
glutin-aa9cb99929ee1893699184ded888b2586455f016.zip
Add #[inline] attributes
Diffstat (limited to 'src/api/emscripten')
-rw-r--r--src/api/emscripten/mod.rs29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/api/emscripten/mod.rs b/src/api/emscripten/mod.rs
index e6f51e3..0913623 100644
--- a/src/api/emscripten/mod.rs
+++ b/src/api/emscripten/mod.rs
@@ -23,6 +23,7 @@ pub struct PollEventsIterator<'a> {
impl<'a> Iterator for PollEventsIterator<'a> {
type Item = Event;
+ #[inline]
fn next(&mut self) -> Option<Event> {
None
}
@@ -35,6 +36,7 @@ pub struct WaitEventsIterator<'a> {
impl<'a> Iterator for WaitEventsIterator<'a> {
type Item = Event;
+ #[inline]
fn next(&mut self) -> Option<Event> {
None
}
@@ -44,6 +46,7 @@ impl<'a> Iterator for WaitEventsIterator<'a> {
pub struct WindowProxy;
impl WindowProxy {
+ #[inline]
pub fn wakeup_event_loop(&self) {
unimplemented!()
}
@@ -51,21 +54,25 @@ impl WindowProxy {
pub struct MonitorID;
+#[inline]
pub fn get_available_monitors() -> VecDeque<MonitorID> {
let mut list = VecDeque::new();
list.push_back(MonitorID);
list
}
+#[inline]
pub fn get_primary_monitor() -> MonitorID {
MonitorID
}
impl MonitorID {
+ #[inline]
pub fn get_name(&self) -> Option<String> {
- Some("Canvas".to_string())
+ Some("Canvas".to_owned())
}
+ #[inline]
pub fn get_dimensions(&self) -> (u32, u32) {
unimplemented!()
}
@@ -109,13 +116,16 @@ impl Window {
})
}
+ #[inline]
pub fn set_title(&self, _title: &str) {
}
+ #[inline]
pub fn get_position(&self) -> Option<(i32, i32)> {
Some((0, 0))
}
+ #[inline]
pub fn set_position(&self, _: i32, _: i32) {
}
@@ -135,10 +145,12 @@ impl Window {
}
}
+ #[inline]
pub fn get_outer_size(&self) -> Option<(u32, u32)> {
self.get_inner_size()
}
+ #[inline]
pub fn set_inner_size(&self, width: u32, height: u32) {
unsafe {
use std::ptr;
@@ -147,52 +159,64 @@ impl Window {
}
}
+ #[inline]
pub fn poll_events(&self) -> PollEventsIterator {
PollEventsIterator {
window: self,
}
}
+ #[inline]
pub fn wait_events(&self) -> WaitEventsIterator {
WaitEventsIterator {
window: self,
}
}
+ #[inline]
pub fn create_window_proxy(&self) -> WindowProxy {
WindowProxy
}
+ #[inline]
pub fn show(&self) {}
+ #[inline]
pub fn hide(&self) {}
+ #[inline]
pub fn platform_display(&self) -> *mut libc::c_void {
unimplemented!()
}
+ #[inline]
pub fn platform_window(&self) -> *mut libc::c_void {
unimplemented!()
}
+ #[inline]
pub fn set_window_resize_callback(&mut self, _: Option<fn(u32, u32)>) {
}
+ #[inline]
pub fn set_cursor(&self, _cursor: MouseCursor) {
unimplemented!()
}
+ #[inline]
pub fn hidpi_factor(&self) -> f32 {
1.0
}
}
impl GlContext for Window {
+ #[inline]
unsafe fn make_current(&self) -> Result<(), ContextError> {
// TOOD: check if == EMSCRIPTEN_RESULT
ffi::emscripten_webgl_make_context_current(self.context);
Ok(())
}
+ #[inline]
fn is_current(&self) -> bool {
true // FIXME:
}
@@ -206,15 +230,18 @@ impl GlContext for Window {
}
}
+ #[inline]
fn swap_buffers(&self) -> Result<(), ContextError> {
unsafe { ffi::emscripten_sleep(1); } // FIXME:
Ok(())
}
+ #[inline]
fn get_api(&self) -> Api {
Api::WebGl
}
+ #[inline]
fn get_pixel_format(&self) -> PixelFormat {
unimplemented!();
}