+ // The blit_lock ensures the window size does not change through the entire blit operation.
+ public void render() {
+ blitLock();
+ while(pendingResize) blitWait();
+ if(needsReshape) {
+ needsReshape = false;
+
+ reshape(winWidth,winHeight);
+ clear();
+ Dirty(0,0,winWidth,winHeight);
+ //Dirty(0,0,getWidth(),getHeight());
+ }
+ super.render();
+ flush();
+ blitUnlock();
+ }
+
+ private native void reshape(int w, int h);
+ // blit_lock is assumed to be held
+ public void needsReshape() { needsReshape = true; }
+