diff options
author | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-09-21 14:42:05 +0200 |
---|---|---|
committer | Pierre Krieger <pierre.krieger1708@gmail.com> | 2015-09-23 13:11:47 +0200 |
commit | aa9cb99929ee1893699184ded888b2586455f016 (patch) | |
tree | b16503dbfe2248beeed0f7d82b150e64e6453043 /src/api/wgl | |
parent | 3820d307a3f23828790e8a46a9c46849592104d6 (diff) | |
download | glutin-aa9cb99929ee1893699184ded888b2586455f016.tar.gz glutin-aa9cb99929ee1893699184ded888b2586455f016.zip |
Add #[inline] attributes
Diffstat (limited to 'src/api/wgl')
-rw-r--r-- | src/api/wgl/mod.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/api/wgl/mod.rs b/src/api/wgl/mod.rs index c8a1910..e118931 100644 --- a/src/api/wgl/mod.rs +++ b/src/api/wgl/mod.rs @@ -49,6 +49,7 @@ pub struct Context { struct WindowWrapper(winapi::HWND, winapi::HDC); impl Drop for WindowWrapper { + #[inline] fn drop(&mut self) { unsafe { user32::DestroyWindow(self.0); @@ -60,6 +61,7 @@ impl Drop for WindowWrapper { struct ContextWrapper(winapi::HGLRC); impl Drop for ContextWrapper { + #[inline] fn drop(&mut self) { unsafe { gl::wgl::DeleteContext(self.0 as *const _); @@ -150,12 +152,14 @@ impl Context { } /// Returns the raw HGLRC. + #[inline] pub fn get_hglrc(&self) -> winapi::HGLRC { self.context.0 } } impl GlContext for Context { + #[inline] unsafe fn make_current(&self) -> Result<(), ContextError> { if gl::wgl::MakeCurrent(self.hdc as *const _, self.context.0 as *const _) != 0 { Ok(()) @@ -164,6 +168,7 @@ impl GlContext for Context { } } + #[inline] fn is_current(&self) -> bool { unsafe { gl::wgl::GetCurrentContext() == self.context.0 as *const libc::c_void } } @@ -179,6 +184,7 @@ impl GlContext for Context { } } + #[inline] fn swap_buffers(&self) -> Result<(), ContextError> { // TODO: decide how to handle the error /*if unsafe { gdi32::SwapBuffers(self.hdc) } != 0 { @@ -190,11 +196,13 @@ impl GlContext for Context { Ok(()) } + #[inline] fn get_api(&self) -> Api { // FIXME: can be opengl es Api::OpenGl } + #[inline] fn get_pixel_format(&self) -> PixelFormat { self.pixel_format.clone() } |