glpopmatrix / pushmatrix over and underflow

    Mar 30 2014 | 7:52 pm
    I tried around a bit to solve a problem with blending and in between and noticed a problem I need some help to understand.The following JS is just drawing two planes with the same texture. To reset the matrix I use pushmatrix and popmatrix. I did that a lot before without any problems in automatic 1 mode. Now with automatic = 0 I get the problem of stack overflow. It seems there are some pushmatrix calls I am not aware of. If I add a popmatrix() at the beginning after sketch.reset() the error messages disappear - leaving me with one more call of popmatrix than pushmatrix (should be an underflow).
    I tried alread to add a "modelview" before every matrixcall to ensure the modelview matrix is called - without any help.
    Any help? Thanks
    I am using Max 6.1.6 / OS X 10.8.5 on a MacBookPro 13" Early 2011
    //begin JS_TextGL.js
    var renderContext = "rcx";
    var myWindow = new JitterObject("jit.window", renderContext); myWindow.depthbuffer = 1; myWindow.size = [400, 200];
    var myRender = new JitterObject("", renderContext); myRender.blend_enable = 1; myRender.depth_enable = 1; myRender.erase_color = [0., 0., 0., 1.]; myRender.automatic = 0;
    var mySketch = new JitterObject("", renderContext); mySketch.blend_enable = 1; mySketch.depth_enable = 1; mySketch.automatic = 0; mySketch.lightning_enable = 0;
    var myTexture = new JitterObject("",renderContext); = "Punkt";"Punkt.png"); myTexture.adapt = 1;
    function bang() { myRender.erase();
    //    mySketch.glpopmatrix();
    mySketch.glbindtexture("Punkt"); mySketch.glpushmatrix(); mySketch.gltranslate(0.,0.,0.1); mySketch.plane(1.,1.,1.,1.); mySketch.draw(); mySketch.glpopmatrix();
    mySketch.glbindtexture("Punkt"); mySketch.glpushmatrix(); mySketch.gltranslate(0.5,0.,0.2); mySketch.plane(1,1,1,1); mySketch.draw(); mySketch.glpopmatrix();
    myRender.drawclients(); myRender.swap(); }
    //end JS_TextGL.js

    • Apr 02 2014 | 4:42 pm
      i can reproduce and will take a look, however your best bet for now is to stick with the extra popmatrix.
      thanks for the report.