Skip to content
This repository was archived by the owner on Apr 28, 2021. It is now read-only.

Commit 18d281a

Browse files
committed
Merge branch 'master' of git://github.com/JuliaGL/GLVisualize.jl
2 parents d60db9a + 9da71a2 commit 18d281a

File tree

15 files changed

+31
-28
lines changed

15 files changed

+31
-28
lines changed

examples/tests/minimal_test.jl

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,8 +251,8 @@ function insert_selectionquery!(name::Symbol, value::Rectangle)
251251
end
252252
function insert_selectionquery!(name::Symbol, value::Signal{Rectangle{Int}})
253253
const_lift(value) do v
254-
SELECTION_QUERIES[name] = v
255-
end
254+
SELECTION_QUERIES[name] = v
255+
end |> preserve
256256
SELECTION[name] = Input(Array(Vec{2, Int}, value.value.w, value.value.h))
257257
SELECTION[name]
258258
end
@@ -290,7 +290,7 @@ bounce{T}(range::Range{T}; t=TIMER_SIGNAL) =
290290

291291
insert_selectionquery!(:mouse_hover, const_lift(ROOT_SCREEN.inputs[:mouseposition]) do mpos
292292
Rectangle{Int}(round(Int, mpos[1]), round(Int, mpos[2]), 1,1)
293-
end)
293+
end |> preserve)
294294

295295

296296
global const RENDER_FRAMEBUFFER = glGenFramebuffers()
@@ -318,7 +318,8 @@ const_lift(ROOT_SCREEN.inputs[:framebuffer_size]) do window_size
318318
glBindRenderbuffer(GL_RENDERBUFFER, rboDepthStencil[1])
319319
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT32, (window_size)...)
320320
end
321-
end
321+
end |> preserve
322+
322323
function postprocess(screen_texture, screen)
323324
data = merge(Dict(
324325
:resolution => const_lift(Vec2f0, screen.inputs[:framebuffer_size]),

src/camera.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ function cubecamera(
153153
robj = visualize(p, model=model, preferred_camera=:cube_cam)
154154
start_colors = p.attributes
155155
color_tex = robj[:attributes]
156-
const_lift(cubeside_color, id, h, Input(start_colors), Input(color_tex))
156+
preserve(const_lift(cubeside_color, id, h, Input(start_colors), Input(color_tex)))
157157

158158
push!(id, robj.id)
159159
view(robj, cubescreen);

src/display/renderloop.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ insert_selectionquery(value, selectionquery, name) = selectionquery[name] = valu
1414

1515

1616
function insert_selectionquery!(name::Symbol, value::Signal{Rectangle{Int}}, selection, selectionquery)
17-
const_lift(insert_selectionquery, value, selectionquery, name)
17+
preserve(const_lift(insert_selectionquery, value, selectionquery, name))
1818
selection[name] = Input(Array(Vec{2, Int}, value.value.w, value.value.h))
1919
selection[name]
2020
end
@@ -69,7 +69,7 @@ function GLFramebuffer(framebuffsize::Signal{Vec{2, Int}})
6969
glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT32, buffersize...)
7070
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, db)
7171
fb = GLFramebuffer(render_framebuffer, color_buffer, objectid_buffer, db)
72-
const_lift(resizebuffers, framebuffsize, fb)
72+
preserve(const_lift(resizebuffers, framebuffsize, fb))
7373
fb
7474
end
7575

src/edit/line_edit.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ function edit_line(
5050
drag0, index0 = mousedrag_index.value
5151
diff_signal = foldl(mouse_drag_diff, (index0, Vec2f0(0), drag0), mousedrag_index)
5252
diff_signal = droprepeats(const_lift(getindex, diff_signal, 1:2)) #throw away drag, tmp
53-
const_lift(gpu_diff_set!, point_gpu, diff_signal, direction_restriction, clampto)
53+
preserve(const_lift(gpu_diff_set!, point_gpu, diff_signal, direction_restriction, clampto))
5454
points[:visible] = lift(OR, hovering_lines, hovering_points)
5555
Context(line_robj, points), diff_signal
5656
end
@@ -94,7 +94,7 @@ function vizzedit(colors::Vector{RGBA{U8}}, window)
9494
for i=1:4
9595
c_channel = points2f0(Float32[p.(i)*scale_factor for p in colors], range)
9696
c_i, diff = edit_line(c_channel, dir_restrict, (0, scale_factor), window, color=channel_color(i, 0.8f0))
97-
const_lift(edit_color, color_tex, colors, diff, i, Float32(scale_factor))
97+
preserve(const_lift(edit_color, color_tex, colors, diff, i, Float32(scale_factor)))
9898
push!(c, c_i)
9999
end
100100
c, color_tex

src/edit/numbers.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ function vizzedit(range::Range, inputs, numberwidth=5; startvalue=middle(range))
6060
new_num = const_lift(slide, startvalue, addition_vec, range)
6161

6262
new_num_gl = const_lift(num2glstring, new_num, numberwidth)
63-
const_lift(update!, vizz[:glyphs], new_num_gl)
63+
preserve(const_lift(update!, vizz[:glyphs], new_num_gl))
6464
return new_num, vizz
6565
end

src/utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ macro visualize_gen(input, target, S)
2020

2121
function visualize(signal::Signal{$input}, s::$S, customizations=visualize_default(signal.value, s))
2222
tex = $target(signal.value)
23-
const_lift(update!, Input(tex), signal)
23+
preserve(const_lift(update!, Input(tex), signal))
2424
visualize(tex, s, customizations)
2525
end
2626
end)
@@ -32,7 +32,7 @@ texture_or_scalar(x) = x
3232
texture_or_scalar(x::Array) = Texture(x)
3333
function texture_or_scalar{A <: Array}(x::Signal{A})
3434
tex = Texture(x.value)
35-
const_lift(update!, tex, x)
35+
preserve(const_lift(update!, tex, x))
3636
tex
3737
end
3838

src/visualize/2dparticles.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ visualize(locations::Vector{Point{2, Float32}}, s::Style, customizations=visuali
1717

1818
function visualize(locations::Signal{Vector{Point2f0}}, s::Style, customizations=visualize_default(locations.value, s))
1919
start_val = texture_buffer(locations.value)
20-
const_lift(update!, start_val, locations)
20+
preserve(const_lift(update!, start_val, locations))
2121
visualize(start_val, s, customizations)
2222
end
2323

src/visualize/colormap.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ visualize{T <: Colorant}(img::Array{T, 1}, s::Style, customizations=visualize_de
1313

1414
function visualize{T <: Colorant}(img::Signal{Array{T, 1}}, s::Style, customizations=visualize_default(img.value, s))
1515
tex = Texture(img.value)
16-
lift(update!, tex, img)
16+
preserve(map(update!, tex, img))
1717
visualize(tex, s, customizations)
1818
end
1919

src/visualize/containers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,9 @@ function visualize{T <: Composable}(list::Vector{T}, s::Style, customizations=vi
3939
x_align = const_lift(first, const_lift(minimum, bb_s))
4040
for elem in list[2:end]
4141
bb_s = boundingbox(elem)
42-
transformation(elem, const_lift(list_translation, y_start, x_align, bb_s))
42+
transformation(elem, preserve(const_lift(list_translation, y_start, x_align, bb_s)))
4343
y_width = const_lift(y_coord, const_lift(width, bb_s))
4444
y_start = const_lift(-, y_start, const_lift(+, y_width, gap))
4545
end
4646
Context(list...)
47-
end
47+
end

src/visualize/image.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ visualize{T <: Colorant}(img::Array{T, 2}, s::Style, customizations=visualize_de
1111

1212
function visualize{T <: Colorant}(img::Signal{Array{T, 2}}, s::Style, customizations=visualize_default(img.value, s))
1313
tex = Texture(img.value)
14-
const_lift(update!, tex, img)
14+
preserve(const_lift(update!, tex, img))
1515
visualize(tex, s, customizations)
1616
end
1717

0 commit comments

Comments
 (0)