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

Experimental #15

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Experimental #15

wants to merge 6 commits into from

Conversation

njazz
Copy link
Contributor

@njazz njazz commented Mar 2, 2019

added Context.IsActive() to be able determine if the window is currently focused.
this is a workaround for some cases on OS X when the window that is not focused causes high CPU usage of windowserver process

added:
drag_int()
drag_float()
add_bezier_curve()
is_window_focused()
is_window_hovered()

fixed:
menu_item()
image()
color_edit()
color_picker()

@podgorskiy
Copy link
Owner

Could you please explain what keep_frame does?

@njazz
Copy link
Contributor Author

njazz commented Jul 6, 2019

Hello!
Sorry for late reply

The idea behind these additions was to have the reduced framerate on macOS when the app is in the background. It seems that otherwise it runs the main new_frame()-render() loop as fast as possible instead of usual screen-synced 60 fps.

i've made this 'keep_frame()' as fast workaround. maybe there can be a better option for this.

now i'm actually not using this and just making the slower frame rate with code like this:

ctx.new_frame()
# draw commands ...
if not ctx.is_active():
    sleep(0.1)
ctx.render()

it would be better to be able to skip all drawing commands

Thanks!

Regards,
Alex

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.

None yet

2 participants