-
Notifications
You must be signed in to change notification settings - Fork 1
Support more graphics backends #14
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
Conversation
|
Interesting! |
|
This patch relies on some WIP improvements to membrane, but it mostly works with swing. There's a few differences between how membrane.skia and membrane.java2d fire events, but they shouldn't be too hard to sort out. |
|
I think I'm pretty close to being able to merge these changes in, but I wanted to get your thoughts on a couple things:
|
|
Cool! Unless you have some reason you want to promote the use of And, very thoughtful of you to think of my WIP, but please do go ahead! |
218b4ab to
595d790
Compare
|
I've added cli args for I feel like the interface of |
| - [`--font-size`](#fonts) specify font point size (default: 12) | ||
| - [`--toolkit`](#toolkits) specify the toolkit (default: java2d) | ||
| Image format determined by filename extension, supported extensions are `.png`, `.webp`, `.jpeg` and `.jpg`. | ||
| - `--line-delay` if your play script runs a command like `lein repl`, the underlying program might not be ready to accept input immediately.\ |
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.
Probably a previous bad edit on my part, but:
Image format determined by filename extension, supported extensions are
.png,.webp,.jpegand.jpg.
Belongs to --out option.
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.
yea, I can fix that.
| <!-- generated by script/regen-screenshots.sh --> | ||
|  | ||
|
|
||
| ## Toolkits |
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.
Worth mentioning somewhere in here what toolkit supports which OSes?
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.
Currently, both java2d and skia seem to support the same OS's that membrane.term says there is support for:
Membrane.term works on macOS and Linux operating systems.
| ([opts] | ||
| (let [opts (merge default-common-opts opts) | ||
| {:keys [width height color-scheme font-family font-size]} opts | ||
| {:keys [width height color-scheme font-family font-size toolkit]} opts |
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.
It's not clear from reading the code what a toolkit is and what might be valid values.
Perhaps run-term and screenshot need docstrings.
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.
totally agree, see #28
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.
Ah, good!
| (case (int key) | ||
| ;; backspace | ||
| 259 (writec-bytes out [0x7f]) | ||
| (8 259) (writec-bytes out [0x7f]) |
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.
maybe a comment on why we match on 2 key codes?
|
The changes are much smaller than I was expecting! Very cool. |
README.md
Outdated
| com.phronemophobic.membrane/skialib-linux-x86-64 {:mvn/version "0.9.31.0-beta"} | ||
| ``` | ||
|
|
||
| If running from the skia project, you can use the `:skia` alias to add the dependency. |
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.
Did you mean to say "if running from the membrane.term project"?
Perhaps dropping an example here would be helpful, something like:
clojure -M:membrane.term:skia run-term --toolkit skia|
I assume this is known and expected, but when I run using the java2d toolkit under jdk11, I see reflective access warnings in the terminal from which I launch membrane.term: |
I thought that was a clojure issue. For other reasons, I just made an update to
|
|
Regarding the dock icon, if we really want to prevent the dock icon from appearing, we can either disable the dock icon altogether (I think it's useful when actually running the term), see https://github.com/phronmophobic/treemap-clj#fixing-the-mac-osx-dock-icon-appearing. Or we can wait to load the toolkit until after we determine if the cli command is |
Yeah, I think it is generally useful. Just found it mildly odd that it showed up when I only requested help. I only mentioned it because I noticed it. Unless it bothers you, might not be worth an issue. |
|
Yup, your guess was good! Upgrading to membrane to version |
|
The dock thing seems like it’s worth an issue. There’s no harm in documenting it. |
|
100% compatibility between toolkits is a non goal, but using the same title for the window makes sense. How about “membrane.term”? Using the same background color for the title bar also makes sense, but I’m not actually sure how to that. 🙈 |
|
Yeah membrane.term would be the perfect title, I think! |
|
I thought I'd give this a whirl under Windows. Membrane.term uses Pty4J which uses winpty... my brain is not understanding what I need to do. Do I need to be launching from Cygwin/MSYS? |
|
Unfortunately, my Windows experience is pretty useless. I did use Pty4J rather than wrapping |
Maybe I just need a tweak or two. |
|
Windows support probably deserves its own issue. |
|
whoops, https://github.com/phronmophobic/membrane/blob/master/src/membrane/java2d.clj#L918 🙈 . I guess I'll have to make quick update to membrane to fix the title issue. |
|
Ok, I think I addressed all the comments that don't have their own separate issues. Everything look good now 👍 ? |
|
My personal take? Merge it! I can extract my last finding to an issue if you agree that it is worth an issue. |
|
oof. The linux java2d rendering is pretty rough. I'll go ahead and merge for now, but an extracted issue would be great! It looks like anti-aliasing isn't turned on. Maybe it's just a simple config issue 🤞 . Edit: I just created the issue at #32. |







Currently, work in progress.