p5py / p5

p5 is a Python package based on the core ideas of Processing.
https://p5.readthedocs.io
GNU General Public License v3.0
724 stars 120 forks source link

vsync() userspace function #26

Open cjayross opened 6 years ago

cjayross commented 6 years ago

As brought up in a previous issue I had posted (at p5/issues/25), I was having an issue with flickering and graphical errors on my laptop. I discovered that the solution was to turn on Vsync, but this can only be done by editing the module and cannot be done in userspace.

innovationchef commented 6 years ago

Hey @Manindra29 @lajaybird @abhikpal I tried this with the same shape_primitives.py file and realized that flickering occurs when vsync is assigned True and behave as expected when assigned with None or False. Could you please describe the enhancement you are expecting?

vsync is kept False in the current version of p5 and the script runs perfectly without flickering issues on my system.

abhikpal commented 6 years ago

@lajaybird,

I discovered that the solution was to turn on Vsync, but this can only be done by editing the module and cannot be done in userspace.

Ideally we would want something like to be an internal setting that we don't expose to the userspace. Ideally, sketches shouldn't flicker at all.

Hey @innovationchef

I tried this with the same shape_primitives.py file and realized that flickering occurs when vsync is assigned True and behave as expected when assigned with None or False. Could you please describe the enhancement you are expecting?

As I just mentioned, the goal is to not have any flickering.

vsync is kept False in the current version of p5 and the script runs perfectly without flickering issues on my system.

That's the thing, we want a fix that works on all machines and this configuration should happen internally and not from the userspace.

innovationchef commented 6 years ago

I am not very sure about this. Just a thought: Could it be something related to preparing the next frame before and outside the update(dt) function? Something similar to preloading the image in opengl instead of calling it in update(dt) function (refactoring)?