On Aug 14, 2012, at 10:05 AM, jvelite <[email protected]> wrote:
> Any thoughts and/or suggestions would be greatly appreciated!
https://bugzilla.xamarin.com/show_bug.cgi?id=6546#c1
One of the causes for the problem is that certain Android hardware will lie:
they'll state that a given graphics mode is supported (e.g. the
default-attempted graphics mode!), then error out when you actually attempt to
use it.
The (hopeful) solution? First, run the GLDiagnostics app:
https://github.com/xamarin/monodroid-samples/blob/master/GLDiagnostics/
Read the `adb logcat`, which should contain messages such as:
V/AndroidGraphicsMode(29481): Valid graphics mode: 489685626 red 8
green 8 blue 8 alpha 8 (32) depth 24 stencil 8 samples 0 buffers 2
Next, you'll need to override CreateFrameBuffer():
https://github.com/xamarin/monodroid-samples/blob/master/GLTriangle20/PaintingView.cs#L40
You'll need to try to use an AndroidGraphicsMode instance based upon the
GLDiagnostics output, e.g.:
protected override void CreateFrameBuffer ()
{
try {
base.CreateFrameBuffer ();
return;
} catch (Exception ex) {
Log.Warn ("AppName", "Unable to use default OpenTK
settings: {0}", ex);
}
// Repeat the following try/catch for each graphics mode you
wish to attempt to support
try {
// Use a value from GLDiagnostics output
GraphicsMode = new AndroidGraphicsMode (
display: null,
// default display
version: 1,
// 2 for OpenGLES 2.x
colorFormat: 32, //
value after the red/green/blue/alpha value, in parens
depth: 24, //
value after `depth`
stencil: 8,
// value after `stencil`
samples: 0, //
value after `samples`
buffers: 2,
// value after `buffers`
stereo: false); // I
don't know what this is used for...
base.CreateFrameBuffer();
return;
} catch (Exception ex) {
Log.Warn ("AppName", "Unable to use default OpenTK
settings: {0}", ex);
}
throw new NotSupportedException ("Unable to initialize
OpenGLES");
}
- Jon
_______________________________________________
Monodroid mailing list
[email protected]
UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid