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

Add simple open_parented example #172

Merged
merged 1 commit into from
Mar 24, 2024

Conversation

prokopyl
Copy link
Member

This PR adds a simple example that allows to test and showcase the Window::open_parented method.

That example first creates a parent window using Window::open_blocking, and then creates a smaller child window using Window::open_parented.

Both window's handlers log all of their events to the console, in a similar fashion to the open_window example.

Both windows actually do rendering (unlike the open_window example for now): the parent fills its window with a grey backround, and the child fills its window with a red background.

This example also uses the softbuffer crate to perform the rendering, which allows testing it in a more portable manner and in the simplest use case possible, without having to involve OpenGL or any 3D rendering pipeline at all.

Copy link
Member

@micahrj micahrj left a comment

Choose a reason for hiding this comment

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

Looks good to me! This will definitely be useful for testing going forward.

@micahrj micahrj merged commit 998ced8 into RustAudio:master Mar 24, 2024
3 checks passed
@prokopyl prokopyl deleted the parented-example branch March 25, 2024 22:35
micahrj pushed a commit that referenced this pull request Mar 25, 2024
This PR adds code to render a basic gray background to the opened window in the `open_window` example.

This also helps making the example a bit more useful, since most users will want to render to their window.

And also it looks nicer. 🙂 

This is done using the `softbuffer` crate, in the same manner of the `open_parented` introduced in #172.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants