-
Notifications
You must be signed in to change notification settings - Fork 67
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
:copy-pixels t flickers between 2 canvases with incorrect backgrounds #75
Comments
How do we get bots banned here? If the post above is our future, dear lord it is going to be horrific. |
to the OP, I have not seen that issue at all. I was playing with the brownian example and testing it out and it draws exactly as it is supposed to. I increased the weight of the stroke to see what is going on and it is as expected. I am running Linux so I assume that the issue is:
(make-instance 'brownian :width 600 :w 600) That starts up two copies of brownian and what you might be seeing is two windows overlapping and some weirdness with how things are rendered under that scenario. In fact, you should have those two lines there. Your brownian example should look like this: https://github.com/vydd/sketch/blob/master/examples/brownian.lisp |
I am running into the exact same issue described by @swapneils; I don't even need the double call to MAKE-INSTANCE: one is enough to make it flicker. Here is another minimal repro example (tested on a M2 Mac): run the below command, and you should get a window alternating between a full-black canvas (???), and one with white background and random circles drawn on it:
Does anyone have any clue where that second canvas might be coming from? I am just getting started with Sketch, but if there is anything else I should do to aid the investigation, please let me know. |
Just to help you with the debugging process, I just updated everything, ran sketch and your code and there is no flicker on my machine. I am running an Intel i5 cpu + AMD video card with open source drivers on Debian Linux. Not terribly helpful but it will help eliminate some variables. I don't have one of the new macs to test on. |
This is most probably due to double buffering. As it was mentioned in #7, the proper fix would be implementing |
When running the brownian example, the canvas was flickering wildly between 2 separate colors and the line was dotted instead of continuous.
Editing the "background" value in the
setup
method and adding (sleep 0.5) to the end of thedefsketch
showed that one color was always black, while the other took the provided color's rgb values and turned them up to 255 (i.e. (rgb 20 0 1) would make a vivid purple background equivalent to (rgb 255 0 255)). The foreground pen was alternating between these two canvases, resulting in each one having a different set of dotted lines which together would make the actual brownian path.Incidentally, I also noticed that execution of multiple simultaneous instances seemed to be single-threaded. Even if the make-instance calls were enclosed in
bt:make-thread
, the rendering would sleep for the specified time and then choose one of them to update, rather than updating both at the specified rate independently of each other. I'm uncertain if this is a separate issue, or indicative of an erroneous setup causing the above problem.Reproduced with MSYS, Git Bash over MINGW, and Windows Powershell on Windows. libffi-6.dll copied from a working Coq installation, SDL installed as specified in the README.
Code for the above, with colors and the
(sleep 0.5)
being the only differences from the original brownian example sketch (I ran this in the REPL, but to my knowledge it should work as a .lisp file too):The text was updated successfully, but these errors were encountered: