Skip to content

Commit

Permalink
Merge pull request #44 from Kimundi/master
Browse files Browse the repository at this point in the history
Fixed enums being the wrong size.
  • Loading branch information
brendanzab committed Nov 2, 2013
2 parents ed858ea + 1e89bd2 commit cf47f61
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/examples/managed-state/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

//! This example shows how managed objects can be accessed from callbacks

#[feature(managed_boxes)];

extern mod glfw;

use std::local_data;
Expand Down
6 changes: 6 additions & 0 deletions src/glfw/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,15 @@ pub mod ffi;
mod extfn;

#[deriving(Clone, Eq, IterBytes, ToStr)]
#[repr(int)]
pub enum Action {
Release = ffi::RELEASE as int,
Press = ffi::PRESS as int,
Repeat = ffi::REPEAT as int,
}

#[deriving(Clone, Eq, IterBytes, ToStr)]
#[repr(int)]
pub enum Key {
KeySpace = ffi::KEY_SPACE as int,
KeyApostrophe = ffi::KEY_APOSTROPHE as int,
Expand Down Expand Up @@ -169,6 +171,7 @@ pub enum Key {
}

#[deriving(Clone, Eq, IterBytes, ToStr)]
#[repr(int)]
pub enum MouseButton {
MouseButtonLeft = ffi::MOUSE_BUTTON_LEFT as int,
MouseButtonRight = ffi::MOUSE_BUTTON_RIGHT as int,
Expand All @@ -188,6 +191,7 @@ pub enum MouseButton {
// pub static MouseButtonMiddle : MouseButton = MouseButton3;

#[deriving(Clone, Eq, IterBytes, ToStr)]
#[repr(int)]
pub enum Error {
NotInitialized = ffi::NOT_INITIALIZED as int,
NoCurrentContext = ffi::NO_CURRENT_CONTEXT as int,
Expand Down Expand Up @@ -223,6 +227,7 @@ pub enum OpenGlProfile {
}

#[deriving(Clone, Eq, IterBytes, ToStr)]
#[repr(int)]
pub enum CursorMode {
CursorNormal = ffi::CURSOR_NORMAL as int,
CursorHidden = ffi::CURSOR_HIDDEN as int,
Expand Down Expand Up @@ -456,6 +461,7 @@ impl Monitor {

pub type MonitorFun = ~fn(monitor: &Monitor, event: MonitorEvent);

#[repr(int)]
pub enum MonitorEvent {
Connected = ffi::CONNECTED as int,
Disconnected = ffi::DISCONNECTED as int,
Expand Down

0 comments on commit cf47f61

Please sign in to comment.