Skip to content
This repository has been archived by the owner on Jul 14, 2021. It is now read-only.

Commit

Permalink
Merge pull request #120 from Octogonapus/feature/RGB/add_exit_renderl…
Browse files Browse the repository at this point in the history
…oop_flag

Add a flag to exit the render loop early
  • Loading branch information
SimonDanisch authored Jul 14, 2020
2 parents 002c03f + 3b066c3 commit 77856e1
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name = "GLMakie"
uuid = "e9467ef8-e4e7-5192-8a1a-b1aee30e663a"
version = "0.1.7"
version = "0.1.8"

[deps]
AbstractPlotting = "537997a7-5e4e-5d89-9595-2241ea00577e"
Expand Down
8 changes: 4 additions & 4 deletions src/rendering.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

function vsynced_renderloop(screen)
while isopen(screen)
while isopen(screen) && !WINDOW_CONFIG.exit_renderloop[]
pollevents(screen) # GLFW poll
screen.render_tick[] = nothing
if WINDOW_CONFIG.pause_rendering[]
Expand All @@ -16,7 +16,7 @@ end

function fps_renderloop(screen::Screen, framerate=WINDOW_CONFIG.framerate[])
time_per_frame = 1.0 / framerate
while isopen(screen)
while isopen(screen) && !WINDOW_CONFIG.exit_renderloop[]
t = time_ns()
pollevents(screen) # GLFW poll
screen.render_tick[] = nothing
Expand Down Expand Up @@ -61,10 +61,10 @@ const WINDOW_CONFIG = (
pause_rendering = Ref(false),
focus_on_show = Ref(false),
decorated = Ref(true),
title = Ref("Makie")
title = Ref("Makie"),
exit_renderloop = Ref(false),
)


"""
set_window_config!(;
renderloop = renderloop,
Expand Down

0 comments on commit 77856e1

Please sign in to comment.