aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java10
-rw-r--r--src/nativewindow/native/ios/IOSmisc.m3
2 files changed, 13 insertions, 0 deletions
diff --git a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
index ea226b407..8ec3c0dd9 100644
--- a/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
+++ b/src/jogl/classes/jogamp/opengl/GLFBODrawableImpl.java
@@ -113,6 +113,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
final boolean useDepth = depthBits > 0;
final boolean useStencil = stencilBits > 0;
+ FBObject.ColorAttachment pCA = null;
fbo.init(gl, width, height, samples);
if(fbo.getNumSamples() != samples) {
@@ -122,6 +123,7 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
final FBObject.ColorAttachment ca = fbo.createColorAttachment(useAlpha);
if( null != colorRenderbufferStorageDef ) {
ca.setStorageDefinition(colorRenderbufferStorageDef);
+ pCA = ca;
}
fbo.attachColorbuffer(gl, 0, ca);
} else {
@@ -166,6 +168,14 @@ public class GLFBODrawableImpl extends GLDrawableImpl implements GLFBODrawable {
// Also remedy for Bug 1020, i.e. OSX/Nvidia's FBO needs to be cleared before blitting,
// otherwise first MSAA frame lacks antialiasing.
fbo.bind(gl);
+
+ if( null != pCA ) {
+ // FIXME: Apple iOS EAGLLayer doesn't show any content if the
+ // last bound RENDERBUFFER isn't the color renderbuffer,
+ // i.e. a subsequent bound DEPTH buffer has been attached.
+ gl.glBindRenderbuffer(GL.GL_RENDERBUFFER, pCA.getName());
+ }
+
if( setupViewportScissors ) {
// Surfaceless: Set initial viewport/scissors
gl.glViewport(0, 0, width, height);
diff --git a/src/nativewindow/native/ios/IOSmisc.m b/src/nativewindow/native/ios/IOSmisc.m
index 5826b9eef..49fe8325e 100644
--- a/src/nativewindow/native/ios/IOSmisc.m
+++ b/src/nativewindow/native/ios/IOSmisc.m
@@ -342,6 +342,9 @@ JNIEXPORT jlong JNICALL Java_jogamp_nativewindow_ios_IOSUtil_CreateUIWindow0
CAEAGLUIView *uiView = [[CAEAGLUIView alloc] initWithFrame:boundsView];
CAEAGLLayer* l = (CAEAGLLayer*)[uiView layer];
[l setOpaque: YES];
+ l.drawableProperties = [NSDictionary dictionaryWithObjectsAndKeys: /* defaults */
+ [NSNumber numberWithBool:NO], kEAGLDrawablePropertyRetainedBacking, kEAGLColorFormatRGBA8, kEAGLDrawablePropertyColorFormat, nil];
+
[myWindow addSubview: uiView];