Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

wrapper for glutSetWindowTitle #18

Merged
merged 1 commit into from Jun 10, 2013
Merged
Changes from all commits
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

wrapper for glutSetWindowTitle

  • Loading branch information
Tim Kuehn
Tim Kuehn committed Jun 7, 2013
commit 99ff1176b4f9682bd54d73b53a61da4198633bac
10 glut.rs
@@ -13,7 +13,8 @@ use glut::bindgen::{glutCreateWindow, glutDestroyWindow, glutDisplayFunc, glutMo
use glut::bindgen::{glutKeyboardFunc, glutGetModifiers, glutMotionFunc, glutPassiveMotionFunc};
use glut::bindgen::{glutGet, glutGetWindow};
use glut::bindgen::{glutInit, glutInitDisplayMode, glutPostRedisplay, glutReshapeFunc};
use glut::bindgen::{glutReshapeWindow, glutSetWindow, glutSwapBuffers, glutTimerFunc};
use glut::bindgen::{glutReshapeWindow, glutSetWindow, glutSetWindowTitle, glutSwapBuffers};
use glut::bindgen::{glutTimerFunc};
use core::libc::*;
use core::local_data::{local_data_get, local_data_set};
use core::ptr::{null, to_unsafe_ptr};
@@ -105,6 +106,13 @@ pub fn set_window(window: Window) {
}
}

pub fn set_window_title(window: Window, title: ~str) {
unsafe {
let bytes = to_bytes(title);
glutSetWindowTitle(to_ptr(bytes) as *c_char);
}
}

pub fn reshape_window(window: Window, width: c_int, height: c_int) {
unsafe {
let current_window = glutGetWindow();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.