#N canvas 597 250 1243 650 10;
#X declare -lib Gem;
#X obj 438 310 alpha;
#X obj 438 360 square 4;
#X msg 450 214 print;
#X obj 438 334 colorRGB 1 1 1 1;
#X obj 411 489 rectangle;
#X floatatom 441 442 5 0 0 0 - - - 0;
#X floatatom 496 443 5 0 0 0 - - - 0;
#X obj 441 461 / 100;
#X obj 496 464 / 100;
#X text 142 91 <----- 1;
#N canvas 87 154 247 179 Gem.init 0;
#X obj 118 46 loadbang;
#X msg 118 81 reset;
#X obj 118 113 outlet;
#X connect 0 0 1 0;
#X connect 1 0 2 0;
#X restore 49 42 pd Gem.init;
#N canvas 340 107 682 322 gemwin 0;
#X obj 102 122 tgl 15 0 \$0-gemstart \$0-gemstart empty 17 7 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 102 161 r \$0-gemstart;
#X obj 102 182 select 1 0;
#X msg 102 214 create \, 1;
#X msg 177 215 destroy;
#X obj 102 239 t a;
#X obj 318 54 inlet;
#X obj 318 255 gemwin;
#X obj 318 100 t a a;
#X obj 318 287 outlet;
#X obj 350 128 route create destroy;
#X obj 350 150 t b;
#X msg 350 172 1;
#X obj 390 150 t b;
#X msg 390 172 0;
#X obj 350 195 t f;
#X msg 350 219 set \$1;
#X text 118 122 rendering;
#X connect 1 0 2 0;
#X connect 2 0 3 0;
#X connect 2 1 4 0;
#X connect 3 0 5 0;
#X connect 4 0 5 0;
#X connect 5 0 8 0;
#X connect 6 0 8 0;
#X connect 7 0 9 0;
#X connect 8 0 7 0;
#X connect 8 1 10 0;
#X connect 10 0 11 0;
#X connect 10 1 13 0;
#X connect 11 0 12 0;
#X connect 12 0 15 0;
#X connect 13 0 14 0;
#X connect 14 0 15 0;
#X connect 15 0 16 0;
#X connect 16 0 0 0;
#X coords 0 -1 1 1 85 40 1 100 100;
#X restore 49 68 pd gemwin;
#X obj 47 8 declare -lib Gem;
#X obj 438 236 glsl shader/game;
#X obj 411 70 gemframebuffer \; dimen 500 500 \; rectangle 0;
#X obj 438 186 translateXYZ 0 0 -4;
#X obj 411 42 gemhead 10;
#X obj 411 414 spigot 0;
#X obj 456 389 tgl 18 0 empty empty empty 0 -9 0 10 #fcfcfc #000000 #000000 0 1;
#X obj 736 266 square 4;
#X obj 736 127 gemframebuffer \; dimen 500 500 \; rectangle 0;
#X obj 736 185 translateXYZ 0 0 -4;
#X obj 736 96 gemhead 20;
#X obj 438 272 pix_texture \; rectangle 0;
#X obj 736 218 pix_texture \; rectangle 0;
#X obj 882 481 square 4;
#X obj 882 433 pix_texture \; rectangle 0;
#X obj 882 311 gemhead 30;
#X text 43 129 This is the same as previous example \, but it uses a framebuffer to avoid the slow snap2text object, f 50;
#X text 45 178 Rendering is made in a framebuffer that is used as texture to render in an other framebuffer \, that is used as a texture for next frame (it is not possible to use the rendering framebuffer as a texture to the render because it is cleared before the rendering), f 52;
#X obj 411 120 t a a;
#X text 483 390 <- render any primitive to initialize the process;
#X text 816 96 feedback;
#X text 958 310 rendering in the Gem window;
#X text 462 124 The trigger allows us to detach the texture for the 2nd part of the rendering, f 39;
#X connect 0 0 3 0;
#X connect 2 0 13 0;
#X connect 3 0 1 0;
#X connect 5 0 7 0;
#X connect 6 0 8 0;
#X connect 7 0 4 1;
#X connect 8 0 4 2;
#X connect 10 0 11 0;
#X connect 13 0 23 0;
#X connect 14 0 30 0;
#X connect 14 1 24 1;
#X connect 15 0 13 0;
#X connect 16 0 14 0;
#X connect 17 0 4 0;
#X connect 18 0 17 1;
#X connect 20 0 21 0;
#X connect 20 1 23 1;
#X connect 20 1 26 1;
#X connect 21 0 24 0;
#X connect 22 0 20 0;
#X connect 23 0 0 0;
#X connect 24 0 19 0;
#X connect 26 0 25 0;
#X connect 27 0 26 0;
#X connect 30 0 17 0;
#X connect 30 1 15 0;
