Forums > Jitter

how to use to_texture with changing window sizes?

January 24, 2006 | 3:39 pm

hi,

i use the to_texture method to create some feedback of a render context, which works fine.
i get problems though after changing the size of the associated jit.window.

as jit.window and texture need to be of the same size, i would expect that a change of the dim of jit.gl.texture to the correct window size would do the job, but after the feedback is initiated once with certain dimensions, i can only get it to work in _those_ dimensions; others will produce the error message ‘jit.gl.texture: error doing screengrab!:GL Error: Invalid value’ on every bang.

if i change dimensions _before_ the to_texture is sent to the jit.gl.render for the first time, the feedback will feed back fine.

so my question is: how can i change the size of the render context & still get feedback (without having to reopen my patch ;-) ?

thanks,

jan klug

—–example patch:

#P window setfont "Sans Serif" 10.;
#P window linecount 1;
#P message 145 39 55 196618 320 240;
#P newex 139 134 71 196618 prepend size;
#P newex 227 94 70 196618 prepend dim;
#P message 139 62 55 196618 600 400;
#P newex 439 451 407 196618 jit.gl.videoplane 1_beamer @blend_enable 1 @blend_mode 6 1 @scale 0.56 0.41;
#P window setfont "Sans Serif" 9.;
#P flonum 514 372 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 514 392 42 196617 rate $1;
#P message 574 372 28 196617 read;
#P newex 439 392 21 196617 r b;
#P newex 439 429 103 196617 jit.qt.movie 320 240;
#B color 5;
#P window setfont "Sans Serif" 10.;
#P flonum 471 311 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 433 311 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 397 311 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 361 311 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 361 331 107 196618 pak color 0. 0. 0. 1.;
#P window setfont "Sans Serif" 9.;
#P newex 309 405 32 196617 sel 1;
#P toggle 50 257 15 0;
#P newex 50 310 47 196617 gate 1 0;
#P newex 109 309 47 196617 gate 1 0;
#P window setfont "Sans Serif" 10.;
#P newex 227 115 286 196618 jit.gl.texture 1_beamer @name feedback @dim 320 240;
#P newex 49 150 53 196618 t b b b b;
#P flonum 377 151 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 437 263 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 401 263 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 365 263 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 365 283 108 196618 pak position 0. 0. 0.;
#P flonum 440 216 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 404 216 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 368 216 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 368 236 93 196618 pak scale 0. 0. 0.;
#P flonum 441 173 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P flonum 405 173 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P newex 369 193 115 196618 pak rotatexyz 0. 0. 0.;
#P flonum 369 173 35 10 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P window setfont "Sans Serif" 9.;
#P flonum 213 418 35 9 0 0 0 3 0 0 0 221 221 221 222 222 222 0 0 0;
#P message 213 436 92 196617 param in2scale $1;
#P window setfont "Sans Serif" 10.;
#P message 274 481 96 196618 drawto 1_beamer;
#P window setfont "Sans Serif" 9.;
#P newex 50 457 269 196617 jit.gl.slab 1_beamer @file op.add.jxs @texrect 1. 0. 0. 1.;
#B color 5;
#P window setfont "Sans Serif" 10.;
#P message 309 435 126 196618 jit_gl_texture feedback;
#P newex 50 508 407 196618 jit.gl.videoplane 1_beamer @blend_enable 1 @blend_mode 6 1 @scale 1.11 0.83;
#P message 109 328 165 196618 usetexture feedback , to_texture;
#P window setfont "Sans Serif" 9.;
#P newex 91 172 21 196617 s b;
#P toggle 49 111 15 0;
#P newex 49 216 226 196617 jit.gl.render 1_beamer @erase_color 0. 0. 0. 1.;
#P objectname 1_render;
#P newex 49 193 66 196617 t b erase b b;
#P newex 49 130 57 196617 qmetro 40;
#P newex 139 156 177 196617 jit.window 1_beamer @size 320 240;
#P objectname 1_window;
#P user panel 129 28 89 61;
#X brgb 240 140 140;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P user panel 31 245 65 39;
#X brgb 240 140 140;
#X frgb 0 0 0;
#X border 1;
#X rounded 0;
#X shadow 0;
#X done;
#P window setfont "Sans Serif" 10.;
#P comment 100 255 100 196618 feedback enable;
#P window linecount 3;
#P comment 231 37 170 196618 < -- if these are changed AFTER feedback was enabled , it won't feed back anymore...;
#P connect 45 0 44 0;
#P fasten 20 0 18 3 446 191 461 191;
#P fasten 28 0 25 3 442 281 445 281;
#P connect 40 0 36 4;
#P fasten 24 0 21 3 445 234 448 234;
#P connect 41 0 46 0;
#P fasten 42 0 41 0 444 422 444 422;
#P fasten 43 0 41 0 579 419 444 419;
#P fasten 44 0 41 0 519 419 444 419;
#P fasten 19 0 18 2 410 191 432 191;
#P fasten 39 0 36 3 438 329 441 329;
#P fasten 27 0 25 2 406 281 420 281;
#P fasten 23 0 21 2 409 234 423 234;
#P fasten 38 0 36 2 402 329 416 329;
#P connect 29 0 22 0;
#P connect 29 0 23 0;
#P fasten 17 0 18 1 374 191 409 191;
#P fasten 26 0 25 1 370 281 395 281;
#P fasten 22 0 21 1 373 234 398 234;
#P fasten 37 0 36 1 366 329 391 329;
#P connect 12 0 13 1;
#P connect 35 0 12 0;
#P connect 34 0 33 0;
#P connect 34 0 32 0;
#P connect 34 0 35 0;
#P connect 48 0 31 0;
#P connect 47 0 48 0;
#P connect 50 0 49 0;
#P connect 50 0 48 0;
#P connect 16 0 15 0;
#P connect 6 3 32 1;
#P connect 49 0 4 0;
#P connect 47 0 49 0;
#P connect 32 0 10 0;
#P connect 30 3 9 0;
#P connect 6 2 33 1;
#P connect 36 0 11 0;
#P connect 14 0 11 0;
#P connect 25 0 11 0;
#P connect 18 0 11 0;
#P connect 21 0 11 0;
#P connect 13 0 11 0;
#P connect 33 0 13 0;
#P connect 15 0 13 0;
#P fasten 6 1 7 0 76 213 54 213;
#P connect 6 0 7 0;
#P connect 10 0 7 0;
#P connect 30 0 6 0;
#P connect 5 0 30 0;
#P connect 8 0 5 0;
#P window clipboard copycount 51;


Viewing 1 post (of 1 total)