calling visualize() after renderloop() #170
Comments
No worries! |
Yeah I know it's blocking, but the function function_that_might_call_visualize_and__view, since is in a foreach = preserve(map()) get called. Is the fact that it's called that blocks completely the rendering (the scene that was moving, freezes as soon as "condition_is_true" is true). |
Ah sorry didn't look closely enough... Btw, are you sure that you want to visualize something every 1/50 seconds ??? That's not how GLVisualize is intended to be used. |
I can reproduce your problem and on first sight it looks like a bug... |
@async + yield() did the tricks however, thanks :) About fps(), 50Hz is approximately the refresh rate of the monitor, so I thought for a "video game" is the right value. Which frame rate would you use? it works well at this value |
No, that's not what I meant, but So you should rather do something like this: x = _view(visualize(...));
function update_loop()
GLAbstraction.set_arg!(x, :color, newcolor)
end
# or
color = Signal(color)
x = _view(visualize(..., color = color))
function update_loop()
push!(color, newcolor)
end |
But condition_is_true is a keypress, so it's true rarely. However, there is something strange. |
Ideally, you can create all objects you want to view upfront and then just manipulate those... But of course you can also dynamically insert/delete objects at runtime, as you can see now that your example is working. x = visualize(...)
delete!(window, x.children[]) The x.children is because I didn't implement it for my nested visualize objects. function Base.delete!(window::Screen, obj::Composable)
for child in obj.children
delete!(window, child)
end
end |
My example is not exactly working, just sometimes. I still do not have the behavior I need. |
well, did you try restructuring your code as I explained? |
I'm creating it before with a scale of 0.0 and then pushing to the scale matrix the value 1.0, but I am still not able to dynamically create them |
After some more investigation, I think this must be a Reactive bug! Will look into it today |
Be sure you test the new Reactive (aka |
I think it did indeed...needs more testing though |
I think I found a possible problem on Reactive master... |
Cool, thanks for working on this |
Please try on Reactive master again! A lot of bugs have been fixed ;) |
Hi, sorry to bother again, but I can't understand a thing.
example code:
In this trivial example, as soon as condition_is_true, the rendering freezes, and "called" is never printed. However if I call visualize and _view before renderloop, they do work.
How am I supposed to add new elements? I can't find an example doing this
Thanks, Nicolò
The text was updated successfully, but these errors were encountered: