Skip to content

Commit

Permalink
Drop gl specific view hints as we don't support OpenGL yet
Browse files Browse the repository at this point in the history
  • Loading branch information
johannes-mueller committed Nov 1, 2020
1 parent 9011e84 commit b88db2c
Showing 1 changed file with 0 additions and 66 deletions.
66 changes: 0 additions & 66 deletions src/view.rs
Original file line number Diff line number Diff line change
Expand Up @@ -197,33 +197,6 @@ pub trait PuglViewTrait {
}
}

fn is_using_compat_profile(&self) -> ViewHintBool {
unsafe {
ViewHintBool::from(p::puglGetViewHint(self.view(), p::PuglViewHint_PUGL_USE_COMPAT_PROFILE))
}
}

fn set_use_compat_profile(&self, value: ViewHintBool) -> Status {
unsafe {
Status::from(p::puglSetViewHint(
self.view(),
p::PuglViewHint_PUGL_USE_COMPAT_PROFILE,
p::PuglViewHintValue::from(value)))
}
}

fn opengl_context_version_major(&self) -> u32 {
unsafe {
p::puglGetViewHint(self.view(), p::PuglViewHint_PUGL_CONTEXT_VERSION_MAJOR) as u32
}
}

fn opengl_context_version_minor(&self) -> u32 {
unsafe {
p::puglGetViewHint(self.view(), p::PuglViewHint_PUGL_CONTEXT_VERSION_MINOR) as u32
}
}

fn red_bits(&self) -> u32 {
unsafe {
p::puglGetViewHint(self.view(), p::PuglViewHint_PUGL_RED_BITS) as u32
Expand Down Expand Up @@ -628,45 +601,6 @@ mod test {
assert_eq!(ui.is_ignoring_key_repeats(), ViewHintBool::True);
}

#[test]
#[serial]
fn use_compat_profile() {
let mut view = PuglView::<UI>::new(std::ptr::null_mut(), |pv| UI::new(pv));
let ui = view.handle();

ui.set_default_size(42, 23);
ui.show_window();
assert_eq!(ui.is_using_compat_profile(), ViewHintBool::True);
}

#[test]
#[serial]
fn not_use_compat_profile() {
let mut view = PuglView::<UI>::new(std::ptr::null_mut(), |pv| UI::new(pv));
let ui = view.handle();

ui.set_default_size(42, 23);
ui.set_use_compat_profile(ViewHintBool::False);
ui.show_window();
assert_eq!(ui.is_using_compat_profile(), ViewHintBool::False);
}

#[test]
#[serial]
fn opengl_context_version_major() {
let mut view = PuglView::<UI>::new(std::ptr::null_mut(), |pv| UI::new(pv));
let ui = view.handle();
assert_eq!(ui.opengl_context_version_major(), 2);
}

#[test]
#[serial]
fn opengl_context_version_minor() {
let mut view = PuglView::<UI>::new(std::ptr::null_mut(), |pv| UI::new(pv));
let ui = view.handle();
assert_eq!(ui.opengl_context_version_minor(), 0);
}

#[serial]
#[test]
fn red_bits() {
Expand Down

0 comments on commit b88db2c

Please sign in to comment.