If I have an Ofelia script like below -- shouldn't the "setup" listener cause the M.setup function to run?
(The window is being created in a different [ofelia] object.)
Very confusing -- I'd assumed the listener meant "if the window isn't set up, then this will run when it's created; if it's already created, it will run it immediately." Otherwise why bother with a listener? You'd just ask something else for the window status.
hjh
if type(window) ~= "userdata" then;
window = ofWindow();
end;
;
local canvas = ofCanvas(this);
local outlet = ofOutlet(this);
local pix = ofPixels();
local path;
M.shader = ofShader();
M.image = ofFbo();
M.useFbo = 1;
ofDisableArbTex();
;
-- initialize;
function M.new();
ofWindow.addListener("setup", this);
... some stuff that's not relevant...
end;
function M.setup();
print("trying to load shader", path);
M.shader:load(path);
end;
... more stuff...