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

Create some traits for swapping/flushing screen buffers #118

Merged
merged 23 commits into from
May 4, 2023

Conversation

ian-h-chamberlain
Copy link
Member

Coming from #116 (comment)

I tried to implement this, it seems to work mostly for compile time checks at least, but I haven't tested that it actually works as expected when running. Let me know what you think, maybe this is a slightly better API to make it clearer that both left + right top screen buffers have to be swapped at once?

Oops! The argument to `gfxScreenSwapBuffers` is gfxScreen_t, not
gfx3dSide_t ! Unfortunately they are both alias to libc::c_uint so we
didn't get any help from the Rust compiler when passing the screen side
into this function.
Rename to flush_buffers, and just have TopScreen3D's impl do both. This
still allows individual flushing of left and right if needed but most
people would probably just use `TopScreen3D::flush_buffers`.
@ian-h-chamberlain ian-h-chamberlain marked this pull request as ready for review April 14, 2023 17:44
Clarify the behavior of `swap_buffers` for single buffering mode and
update bitmap example to prove that this is actually how it works.
@ian-h-chamberlain ian-h-chamberlain force-pushed the feat/flush-swap-screen-traits branch from 353992a to b239fb8 Compare April 14, 2023 17:46
@Meziu Meziu merged commit 20a8094 into improve/api May 4, 2023
@Meziu Meziu deleted the feat/flush-swap-screen-traits branch May 4, 2023 12:24
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.

3 participants