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

Commit

Permalink
Merge 70b46b8 into 7bda78e
Browse files Browse the repository at this point in the history
  • Loading branch information
SimiDCI committed Mar 7, 2017
2 parents 7bda78e + 70b46b8 commit 5435847
Show file tree
Hide file tree
Showing 14 changed files with 215 additions and 855 deletions.
23 changes: 0 additions & 23 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions assets/shader/particles.vert
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ vec3 _scale(vec3 scale, Nothing scale_x, Nothing scale_y, Nothing scale_z, int i
{{color_norm_type}} color_norm;
// constant color!
vec4 _color(vec4 color, Nothing intensity, Nothing color_map, Nothing color_norm, int index, int len);
vec4 _color(vec3 color, Nothing intensity, Nothing color_map, Nothing color_norm, int index, int len);
// only a samplerBuffer, this means we have a color per particle
vec4 _color(samplerBuffer color, Nothing intensity, Nothing color_map, Nothing color_norm, int index, int len);
// no color, but intensities a color map and color norm. Color will be based on intensity!
Expand Down
4 changes: 4 additions & 0 deletions assets/shader/standard.frag
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ flat in uvec2 o_id;

{{color_type}} color;

vec4 get_color(vec3 color, vec2 uv){
return vec4(color, 1.0 + (0.0 * uv)); // we must prohibit uv from getting into dead variable removal
}

vec4 get_color(vec4 color, vec2 uv){
return color + uv.x * 0.0; // we must prohibit uv from getting into dead variable removal
}
Expand Down
39 changes: 34 additions & 5 deletions examples/ExampleRunner.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module ExampleRunner
using GLAbstraction, GLWindow, GLVisualize
using FileIO, GeometryTypes, Reactive, Images
export RunnerConfig
import GLVisualize: toggle_button, slider, button, mm
import GLVisualize: toggle_button, slider, button, mm, create_video_stream, add_frame!

import Compat: String, UTF8String

Expand All @@ -19,7 +19,7 @@ include("mouse.jl")

const installed_pkgs = Pkg.installed()

const hasplots = get(installed_pkgs, "Plots", v"0") > v"0.9.3"
const hasplots = false# get(installed_pkgs, "Plots", v"0") > v"0.9.3"
const is_04 = VERSION.minor == 4

if !hasplots
Expand Down Expand Up @@ -67,6 +67,7 @@ type RunnerConfig
resampling
screencast_folder
record
record_image
thumbnail
rootscreen
window
Expand Down Expand Up @@ -256,6 +257,7 @@ function RunnerConfig(;
resampling = 0,
screencast_folder = pwd(),
record = true,
record_image = false,
thumbnail = true,
rootscreen = glscreen(resolution=resolution)
)
Expand Down Expand Up @@ -290,6 +292,7 @@ function RunnerConfig(;
resampling,
screencast_folder,
record,
record_image,
thumbnail,
rootscreen,
view_screen,
Expand Down Expand Up @@ -414,7 +417,8 @@ import GLWindow: poll_reactive, poll_glfw, sleep_pessimistic

function make_tests(config)
i = 1; frames = 0; window = config.window; break_loop = false
runthrough = 0 # -1, backwards, 0 no running, 1 forward
# start in run through when recording images
runthrough = config.record_image ? 1 : 0 # -1, backwards, 0 no running, 1 forward

function increase(x = runthrough)
x = x == 0 ? 1 : x
Expand Down Expand Up @@ -444,14 +448,29 @@ function make_tests(config)
end)
failed = fill(false, length(config.files))
Reactive.stop() # stop Reactive! We be pollin' ourselves!
io = nothing
while i <= length(config.files) && isopen(config.rootscreen)
path = config.files[i]
try
test_module = _test_include(path, config)

display_msg(test_module, config)
timings = Float64[]
frames = 0
frames = 0;
poll_glfw()
poll_reactive()
poll_reactive()
yield()

io, buffer = if config.record
name = basename(config.current_file)[1:end-3]
name = name * ".mkv"
name = joinpath(config.screencast_folder, name)
create_video_stream(name, config.rootscreen)
else
nothing, nothing
end

while !break_loop && isopen(config.rootscreen)
tic()
poll_glfw()
Expand All @@ -460,13 +479,20 @@ function make_tests(config)
poll_reactive() # two times for secondary signals
render_frame(config.rootscreen)
swapbuffers(config.rootscreen)
yield() # yield in timings? Seems fair
end
frames += 1
t = toq()
if length(timings) < 1000 && frames > 2
push!(timings, t)
end
if config.record_image
name = basename(config.current_file)[1:end-3]
name = joinpath(config.screencast_folder, name * ".png")
GLWindow.screenshot(config.rootscreen, path = name)
break
end
config.record && add_frame!(io, config.rootscreen, buffer)
yield() # yield in timings? Seems fair
GLWindow.sleep_pessimistic((1/60) - t)
(runthrough != 0 && frames > 20) && break
end
Expand All @@ -489,6 +515,9 @@ function make_tests(config)
config[:success] = false
config[:exception] = ex
finally
if config.record && io != nothing
close(io)
end
empty!(window)
empty!(config.buttons[:timesignal].actions)
window.color = RGBA{Float32}(1,1,1,1)
Expand Down
2 changes: 1 addition & 1 deletion examples/gui/buttons.jl
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ N = n1*n2
args = map(value, (w[:a], w[:b], w[:c], w[:d]))
v0 = lorenz(zeros(Point3f0, N), args...)
positions = foldp(lorenz, v0, w[:a], w[:b], w[:c], w[:d])
scales = const_lift(Vec3f0, w[:scale])
scales = map(Vec3f0, w[:scale])
rotations = map(diff, positions)
rotations = map(x-> push!(x, x[end]), rotations)
cmap = map((a,b)->[a,b], w[:colora], w[:colorb])
Expand Down
2 changes: 2 additions & 0 deletions examples/plots/lines_scatter.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ else
(800, 500)
end



description = """
Showing off different line types and marker types,
like 3D meshes, characters and images.
Expand Down
1 change: 1 addition & 0 deletions src/StructsOfArrays.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ immutable StructOfArrays{T,N,U<:Tuple} <: AbstractArray{T,N}
arrays::U
end


type ScalarRepeat{T}
scalar::T
end
Expand Down
Loading

0 comments on commit 5435847

Please sign in to comment.