示例#1
0
        private GlContext GetGlContext()
        {
            using (var glCalculatorHelper = new GlCalculatorHelper()) {
                glCalculatorHelper.InitializeForTest(GpuResources.Create().Value());

                return(glCalculatorHelper.GetGlContext());
            }
        }
示例#2
0
        public void GetGlContext_ShouldReturnCurrentContext()
        {
            using (var glCalculatorHelper = new GlCalculatorHelper()) {
                glCalculatorHelper.InitializeForTest(GpuResources.Create().Value());

                var glContext = glCalculatorHelper.GetGlContext();
#if UNITY_EDITOR_LINUX || UNITY_STANDALONE_LINUX || UNITY_ANDROID
                Assert.AreNotEqual(glContext.eglContext, IntPtr.Zero);
#elif UNITY_STANDALONE_OSX
                Assert.AreNotEqual(glContext.nsglContext, IntPtr.Zero);
#elif UNITY_IOS
                Assert.AreNotEqual(glContext.eaglContext, IntPtr.Zero);
#endif
            }
        }