xamarin-macios/tests/monotouch-test/CoreAnimation/CAOpenGLLayer.cs

44 строки
1.0 KiB
C#
Исходник Обычный вид История

#if __MACOS__
using System;
2016-05-26 16:06:52 +03:00
using NUnit.Framework;
using AppKit;
using Foundation;
using CoreAnimation;
using OpenGL;
using ObjCRuntime;
namespace Xamarin.Mac.Tests {
2016-05-26 16:06:52 +03:00
[TestFixture]
[Preserve (AllMembers = true)]
public class CAOpenGLLayerTest {
#if !DYNAMIC_REGISTRAR
[Ignore ("https://github.com/xamarin/xamarin-macios/issues/10284")]
#endif
2016-05-26 16:06:52 +03:00
[Test]
public void SubclassedTest ()
{
TestRuntime.AssertNotVirtualMachine ();
2016-05-26 16:06:52 +03:00
using (var layer = new OpenGLLayer ()) {
Messaging.IntPtr_objc_msgSend (layer.Handle, Selector.GetHandle ("copyCGLPixelFormatForDisplayMask:"));
}
}
}
public partial class OpenGLLayer : CAOpenGLLayer {
2016-05-26 16:06:52 +03:00
public override CGLPixelFormat CopyCGLPixelFormatForDisplayMask (uint mask)
{
var attribs = new object [] {
CGLPixelFormatAttribute.Accelerated,
CGLPixelFormatAttribute.DoubleBuffer,
CGLPixelFormatAttribute.ColorSize, 24,
2016-05-26 16:06:52 +03:00
CGLPixelFormatAttribute.DepthSize, 16 };
CGLPixelFormat pixelFormat = new CGLPixelFormat (attribs);
return pixelFormat;
}
}
}
#endif // __MACOS__