java - Libgdx - OpenGL: UI design with glScissor makes animation jerky, how can I fix it? -
i'm building listview contains many items, , i've apply glscissor on each item prevent image overflowing of area. seem work fine. when drag them quickly, items moving seem glscissor don't fit image. think problem may because of glscissor took integer parameters while image moving @ floating precision, , must perform casting when using.if so, how can fix problem? in advance. here snippet code:
enablescissor((int) clippingrectangle.x, (int) (clippingrectangle.y + clippingrectangle.height), (int) clippingrectangle.width, (int) clippingrectangle.height); draw(this.itemborder, this.getabsolutex(), this.getabsolutey());//draw texture here disablescissor(); where enablescissor is:
public void enablescissor( float clipx, float clipy, float clipwidth, float clipheight) { gdx.gl.glenable(gl20.gl_scissor_test); gdx.gl.glscissor((int)(clipx), (int) (clipy), (int)(clipwidth), (int)(clipheight); } you can see implemented without glscissor enabled video: http://youtu.be/yjlho_zbufe , glscissor enabled: http://youtu.be/vgrfgynhixa?list=uu3ndtzct6vpfupz4_bm1vrq
Comments
Post a Comment