natInit();
}
+ protected Scheduler _getScheduler() { return new DarwinScheduler(); }
protected native void runApplicationEventLoop();
private class DarwinScheduler extends org.xwt.Scheduler {
public void run() {
// 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);
return oglp.realPicture;
}
- public Picture _createPicture(JS r, boolean alphaOnly) { return new OpenGLPicture(r, alphaOnly); }
+ public Picture _createPicture(JS r, boolean alphaOnly) { return new OpenGLPicture(r, false); }
public static class OpenGLPicture extends Picture {
public OpenGLPicture(JS r, boolean a) { super(r); alphaOnly = a; }
GLPicture realPicture = null;
}
- public Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new OpenGLGlyph(f, c); }
+ public Font.Glyph _createGlyph(org.xwt.Font f, char c) { return new org.xwt.Platform.DefaultGlyph(f, c); }
- public static class OpenGLGlyph extends Font.Glyph {
- private Picture p = null;
- public OpenGLGlyph(org.xwt.Font f, char c) { super(f, c); }
- Picture getPicture() {
- if (p == null && isLoaded) {
- p = new OpenGLPicture(null, true);
- p.data = new int[data.length];
- for(int i=0; i<data.length; i++) p.data[i] = (data[i] & 0xff) << 24;
- data = null;
- p.width = this.width;
- p.height = this.height;
- }
- return p;
- }
- }
-
private native void natDeleteTexture(int tex);
public void deleteTexture(final int tex) {
// CHECKME: Is this safe to do from finalize()?