aboutsummaryrefslogtreecommitdiffstats
path: root/src/win32/mod.rs
diff options
context:
space:
mode:
authorTomaka17 <pierre.krieger1708@gmail.com>2014-08-22 11:21:12 +0200
committerTomaka17 <pierre.krieger1708@gmail.com>2014-08-22 11:21:12 +0200
commit5c925874421c016d7c975491494035f78b14566a (patch)
treea00c32e9c95f13c1e075218fe8a897340dd0e7b3 /src/win32/mod.rs
parent6b45d1ca25e2d4cafa8b0ca9441eaeeadd5ff37d (diff)
downloadglutin-5c925874421c016d7c975491494035f78b14566a.tar.gz
glutin-5c925874421c016d7c975491494035f78b14566a.zip
Fix & add some comments for win32
Diffstat (limited to 'src/win32/mod.rs')
-rw-r--r--src/win32/mod.rs28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/win32/mod.rs b/src/win32/mod.rs
index 78d9e96..cf889cb 100644
--- a/src/win32/mod.rs
+++ b/src/win32/mod.rs
@@ -34,18 +34,18 @@ pub struct Window {
}
impl Window {
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn new(builder: WindowBuilder) -> Result<Window, String> {
init::new_window(builder)
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn is_closed(&self) -> bool {
use std::sync::atomics::Relaxed;
self.is_closed.load(Relaxed)
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
///
/// Calls SetWindowText on the HWND.
pub fn set_title(&self, text: &str) {
@@ -55,7 +55,7 @@ impl Window {
}
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn get_position(&self) -> Option<(int, int)> {
use std::mem;
@@ -70,7 +70,7 @@ impl Window {
Some((rect.left as int, rect.top as int))
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn set_position(&self, x: int, y: int) {
use libc;
@@ -81,7 +81,7 @@ impl Window {
}
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn get_inner_size(&self) -> Option<(uint, uint)> {
use std::mem;
let mut rect: ffi::RECT = unsafe { mem::uninitialized() };
@@ -96,7 +96,7 @@ impl Window {
))
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn get_outer_size(&self) -> Option<(uint, uint)> {
use std::mem;
let mut rect: ffi::RECT = unsafe { mem::uninitialized() };
@@ -111,7 +111,7 @@ impl Window {
))
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn set_inner_size(&self, x: uint, y: uint) {
use libc;
@@ -122,7 +122,7 @@ impl Window {
}
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
// TODO: return iterator
pub fn poll_events(&self) -> Vec<Event> {
let mut events = Vec::new();
@@ -142,7 +142,7 @@ impl Window {
events
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
// TODO: return iterator
pub fn wait_events(&self) -> Vec<Event> {
match self.events_receiver.recv_opt() {
@@ -170,12 +170,12 @@ impl Window {
}
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub unsafe fn make_current(&self) {
ffi::wglMakeCurrent(self.hdc, self.context)
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn get_proc_address(&self, addr: &str) -> *const () {
use std::c_str::ToCStr;
@@ -188,10 +188,12 @@ impl Window {
}
}
- /// See the docs if the crate root file.
+ /// See the docs in the crate root file.
pub fn swap_buffers(&self) {
unsafe {
+ // calling glFlush is necessary on Windows 8
ffi::glFlush();
+
ffi::SwapBuffers(self.hdc);
}
}