-// Copyright 2000-2005 the Contributors, as shown in the revision logs.
-// Licensed under the GNU General Public License version 2 ("the License").
-// You may not use this file except in compliance with the License.
-
+// Copyright 2004 Adam Megacz, see the COPYING file for licensing [LGPL]
// Authors: Brian Alliet and Evan Jones
package org.ibex.plat;
protected native void activateSharedContext();
}
- static abstract class CarbonSurface extends Surface.DoubleBufferedSurface {
+ static abstract class CarbonSurface extends Surface {
RawData rawWindowRef;
int modifiers;
int winWidth;
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);
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) {
reshape(winWidth,winHeight);
clear();
- Dirty(0,0,winWidth,winHeight);
+ dirty(0,0,winWidth,winHeight);
}
super.render();
flush();