-
Notifications
You must be signed in to change notification settings - Fork 19
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
Port 3ds-Example: graphics bitmap #29
Port 3ds-Example: graphics bitmap #29
Conversation
A struct would be nice, yeah.
Cargo doesn't automatically infer examples unless they're in the If there are examples with more than just one file though, they can be in sub folders with a |
ctru-rs/src/gfx.rs
Outdated
/// Note that the pointer returned by this function can change after each call to this function | ||
/// if double buffering is enabled | ||
pub fn get_raw_framebuffer(&mut self, side: Side) -> (*mut u8, u16, u16) { | ||
let mut width: u16 = 0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Just a personal preference, but you don't need any of the local variable types in these functions. They get inferred from the return type.
I also found weird things with Luma and Console printing. It was just a black screen for me, like your top screen. |
This looks more correct on the device to my eye and is a bit simpler.
We can't make directories for examples. We can only group them by name (instead of a folder, put the folder name as a prefix to the file). It's not a big issue anyways. |
I chose the name RawFrameBuffer in case we'd like to provide a "safer" alternative API at some point.
Ah, I forgot these details... I suppose if it gets out of hand we could make New changes I'm pushing:
ScreenshotsBeforeAfterI'll open a new issue for the Luma screenshot thing, since I think it might be something we can workaround on the |
Keep RawFrameBuffer alive as long as the Screen is, to ensure the Gfx is not dropped while the FrameBuffer is alive.
Ref #18
I modified the framebuffer API a bit since I don't think it makes sense to allow arbitrary
Side
for the bottom screen.Also, the frame buffer returning a tuple
(*mut u8, u16, u16)
seems a little odd to me and maybe a struct would be preferable? Let me know what you think.Finally – do we want to roughly match the directory structure of 3ds-examples? There are a lot of graphics examples and it might make sense to group them in a directory, as long as they still have unique names I think they are still easily runnable with
cargo 3ds link --example $name
. If so I can move this to a subdirectory.Edit: screenshot! The colors on my device look a bit off, so I might try to play around with it to get a cleaner looking output... Also, for some reason, Luma screenshot isn't capturing the text on the top screen, but it is displayed there. Will investigate that.