File tree Expand file tree Collapse file tree
core/src/processing/opengl Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -961,7 +961,16 @@ private void createFBOLayer() {
961961 createDepthAndStencilBuffer (true , depthBits , stencilBits , packed );
962962 }
963963
964- validateFramebuffer ();
964+ int status = validateFramebuffer ();
965+
966+ if (status == FRAMEBUFFER_INCOMPLETE_MULTISAMPLE && 1 < numSamples ) {
967+ System .err .println ("Continuing with multisampling disabled" );
968+ reqNumSamples = 1 ;
969+ destroyFBOLayer ();
970+ // try again
971+ createFBOLayer ();
972+ return ;
973+ }
965974
966975 // Clear all buffers.
967976 clearDepth (1 );
@@ -2048,10 +2057,10 @@ protected boolean linked(int program) {
20482057 }
20492058
20502059
2051- protected boolean validateFramebuffer () {
2060+ protected int validateFramebuffer () {
20522061 int status = checkFramebufferStatus (FRAMEBUFFER );
20532062 if (status == FRAMEBUFFER_COMPLETE ) {
2054- return true ;
2063+ return 0 ;
20552064 } else if (status == FRAMEBUFFER_UNDEFINED ) {
20562065 System .err .println (String .format (FRAMEBUFFER_ERROR ,
20572066 "framebuffer undefined" ));
@@ -2086,7 +2095,7 @@ protected boolean validateFramebuffer() {
20862095 System .err .println (String .format (FRAMEBUFFER_ERROR ,
20872096 "unknown error " + status ));
20882097 }
2089- return false ;
2098+ return status ;
20902099 }
20912100
20922101 protected boolean isES () {
You can’t perform that action at this time.
0 commit comments