Skip to content
This repository has been archived by the owner on Jun 8, 2021. It is now read-only.

Add GLContext widget #75

Merged
merged 2 commits into from
Oct 5, 2015
Merged

Add GLContext widget #75

merged 2 commits into from
Oct 5, 2015

Conversation

GuillaumeGomez
Copy link
Member

No description provided.

@gkoz
Copy link
Member

gkoz commented Oct 3, 2015

It's a shame you had to do this manually cuz there's nothing here the generator couldn't do (remember gdk is "reformed" already).

/// Retrieves the OpenGL version of the context.
///
/// The context must be realized prior to calling this function.
pub fn get_version(&self, major: &mut i32, minor: &mut i32) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The generator will return these in a tuple so to avoid breakage I'd suggest doing the same.
Example: gtk-rs/gir#122 (comment)

@gkoz gkoz mentioned this pull request Oct 3, 2015
@GuillaumeGomez
Copy link
Member Author

It does ?! Impressive !

@gkoz
Copy link
Member

gkoz commented Oct 3, 2015

Well, I have to admit it doesn't add the docs yet. Also Error but you didn't handle it either :-P

@GuillaumeGomez
Copy link
Member Author

Too bad. Well, I think we'll still need to add it ourselves. (Updated btw)

/// The context must be realized prior to calling this function.
pub fn get_version(&self) -> (i32, i32) {
let major = 0;
let minor = 0;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mut?

@GuillaumeGomez
Copy link
Member Author

That's why I hate writing without having the possibility to test it...

@gkoz
Copy link
Member

gkoz commented Oct 3, 2015

Looks like we'll have to learn to build this stuff from source anyway. And a chroot is not too difficult to set up.

@gkoz
Copy link
Member

gkoz commented Oct 3, 2015

It's not an Object, till you've implemented StaticType for it like this.

I know, this boilerplate begs for a macro. I was hoping to avoid them previously. Looks like macros impl_traitWidget style are winning after all. But for now that's how it is.

}

/// Retrieves the GLContext that this context share data with.
pub fn get_shared_context(&self) -> Option<Window> {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This returns Option<GLContext> perhaps?

gkoz added a commit that referenced this pull request Oct 5, 2015
@gkoz gkoz merged commit cc7a42c into gtk-rs:master Oct 5, 2015
@gkoz
Copy link
Member

gkoz commented Oct 5, 2015

This is good at last! :)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants