2004/01/19 21:03:59
[org.ibex.core.git] / src / org / xwt / plat / Darwin.java
index f3dd670..fdd5e50 100644 (file)
@@ -10,6 +10,7 @@ import org.xwt.*;
 import java.util.*;
 
 public class Darwin extends POSIX {
+    public static void main(String[] s) throws Exception { Main.main(s); }
     static Darwin singleton;
     private CarbonOpenGL openGL;
     boolean jaguar; // true if we are on OS X >= 10.2
@@ -91,6 +92,7 @@ public class Darwin extends POSIX {
         natInit();
     }
     
+    protected Scheduler _getScheduler() { return new DarwinScheduler(); }
     protected native void runApplicationEventLoop();
     private class DarwinScheduler extends org.xwt.Scheduler {
         public void run() {
@@ -101,20 +103,20 @@ public class Darwin extends POSIX {
     
     private final class CarbonOpenGL extends OpenGL {
         public RawData rawPixelFormat;
-        public RawData rawSharedInterpreter;
+        public RawData rawSharedContext;
         public int maxAglSurfaceTexSize;
         public int maxSurfaceWidth;
         public int maxSurfaceHeight;
         
         private native boolean initPixelFormat();
-        private native void initSharedInterpreter();
+        private native void initSharedContext();
         
         public CarbonOpenGL() throws NotSupportedException {
             if(!jaguar)
                 throw new NotSupportedException("OpenGL requires Mac OS X 10.2 or greater");
             if(!initPixelFormat())
                 throw new NotSupportedException("Couldn't get an acceptable pixel format");
-            initSharedInterpreter();
+            initSharedContext();
         }
         
         public void init() throws NotSupportedException {
@@ -126,7 +128,7 @@ public class Darwin extends POSIX {
             }
             maxSurfaceWidth = maxSurfaceHeight = maxAglSurfaceTexSize;
         }
-        protected native void activateSharedInterpreter();
+        protected native void activateSharedContext();
     }
     
     static abstract class CarbonSurface extends Surface.DoubleBufferedSurface {  
@@ -219,7 +221,7 @@ public class Darwin extends POSIX {
             CarbonMessage.add(new CarbonMessage() { public void perform() { GLCarbonPixelBuffer.this.natInit(); sem.release(); } });
             sem.block();
         }
-        public native void activateInterpreter();
+        public native void activateContext();
         protected void finalize() {
             CarbonMessage.add(new CarbonMessage() { public void perform() { natCleanup(rawWindowRef,rawCTX); } });
             gl.deleteTexture(textureName);
@@ -261,19 +263,22 @@ public class Darwin extends POSIX {
         
         // 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);