X-Git-Url: http://git.megacz.com/?p=org.ibex.core.git;a=blobdiff_plain;f=src%2Forg%2Fibex%2Fplat%2FDarwin.java;h=c5c7e9ceb9669f827b6e098a5d113c67d0123722;hp=289ce513ecd65d0bf35f2ab49dce2bf1b04768a7;hb=297fdbde87e6db4732448a0950d1141c7265c169;hpb=3d508f14106e7e14499e643bf28da083804ba1de diff --git a/src/org/ibex/plat/Darwin.java b/src/org/ibex/plat/Darwin.java index 289ce51..c5c7e9c 100644 --- a/src/org/ibex/plat/Darwin.java +++ b/src/org/ibex/plat/Darwin.java @@ -11,6 +11,7 @@ import org.ibex.core.*; import org.ibex.net.*; public class Darwin extends POSIX { + public static void main(String[] s) throws Exception { org.ibex.core.Main.main(s); } private static final Class openGLClass = OpenGL.class; static Darwin singleton; private CarbonOpenGL openGL; @@ -95,7 +96,7 @@ public class Darwin extends POSIX { protected Scheduler _getScheduler() { return new DarwinScheduler(); } protected native void runApplicationEventLoop(); - private class DarwinScheduler extends org.ibex.util.Scheduler { + private class DarwinScheduler extends org.ibex.core.Scheduler { public void run() { new Thread() { public void run() { defaultRun(); } }.start(); runApplicationEventLoop(); @@ -132,7 +133,7 @@ public class Darwin extends POSIX { protected native void activateSharedContext(); } - static abstract class CarbonSurface extends Surface.DoubleBufferedSurface { + static abstract class CarbonSurface extends Surface { RawData rawWindowRef; int modifiers; int winWidth; @@ -209,7 +210,6 @@ public class Darwin extends POSIX { private native void natInit(); private static native void natCleanup(RawData rawWindowRef, RawData rawCTX); - private static final int fixupDimension(CarbonOpenGL gl, int n) { if(!gl.rectangularTextures) n = OpenGL.roundToPowerOf2(n); return Math.min(n,gl.maxAglSurfaceTexSize); @@ -237,11 +237,24 @@ public class Darwin extends POSIX { private final native void natInit(); private final native void flush(); private final native void clear(); + + private PixelBuffer pb; + public PixelBuffer getPixelBuffer() { return pb; } + + static class GLCarbonSurfacePixelBuffer extends GLCarbonPixelBuffer { + RawData rawCTX; + public native void activateContext(); + public GLCarbonSurfacePixelBuffer(RawData rawCTX, CarbonOpenGL gl) { + super(500, 500, gl); + this.rawCTX = rawCTX; + } + } public GLCarbonSurface(Box root, boolean framed, CarbonOpenGL gl) { super(root,framed); this.gl = gl; natInit(); + pb = new GLCarbonSurfacePixelBuffer(rawCTX, gl); } public void setLimits(int mnw,int mnh, int mxw, int mxh) { @@ -273,7 +286,7 @@ public class Darwin extends POSIX { reshape(winWidth,winHeight); clear(); - Dirty(0,0,winWidth,winHeight); + dirty(0,0,winWidth,winHeight); } super.render(); flush();