#N canvas 1046 201 427 171 10;
#X obj 123 73 ofelia define -k \$0-Conway;
#A __set if type(window) ~= "userdata" then \; window = ofWindow() \;
end \; \; local canvas = ofCanvas(this) \; local clock = ofClock(this
\, "setup") \; local shaderDir = canvas:getDir() .. "/data/" \; local
shader = ofShader() \; local fbo = ofFbo() \; \; function ofelia.new()
\; ofWindow.addListener("setup" \, this) \; ofWindow.addListener("draw"
\, this) \; ofWindow.addListener("exit" \, this) \; window:setPosition(30
\, 100) \; window:setSize(800 \, 800) \; if type(window) ~= "userdata"
then \; window = ofWindow() \; end \; window:create() \; if ofWindow.exists
then \; clock:delay(0) \; end \; end \; \; function ofelia.free() \;
window:destroy() \; ofWindow.removeListener("setup" \, this) \; ofWindow.removeListener("draw"
\, this) \; ofWindow.removeListener("exit" \, this) \; end \; \; function
ofelia.setup() \; ofSetWindowTitle("GLSL") \; ofBackground(0 \, 0 \,
0 \, 255) \; fbo:allocate(800 \, 800) \; fbo:beginFbo() \; ofClear(255
\, 255 \, 255 \, 0) \; fbo:endFbo() \; shader:load(shaderDir .. "test15")
\; end \; \; function ofelia.draw() \; ofSetColor(255) \; local resolution
= ofGetWindowSize() \; local mouseX = ofGetMouseX() \; local mouseY
= ofGetMouseY() \; local mouse = ofGetMousePressed() \; if mouse ==
true then \; mouse =1 \; else \; mouse = 0 \; end \; shader:beginShader()
\; shader:setUniformTexture("backbuffer" \, fbo:getTexture() \, 1)
\; shader:setUniform1f("mousePressed" \, mouse) \; shader:setUniform2f("resolution"
\, resolution) \; shader:setUniform2f("mouse" \, mouseX \, mouseY)
\; fbo:beginFbo() \; fbo:draw(0 \, 0 \, 800 \, 800) \; fbo:endFbo()
\; fbo:draw(0 \, 0 \, 800 \, 800) \; shader:endShader() \; end \; \;
function ofelia.exit() \; shader:unload() \; end \;;
