Пример #1
0
		public void TestVertex()
		{
			using (ShaderObject shaderObject = new ShaderObject(ShaderStage.Vertex)) {
				// Load source
				Assert.DoesNotThrow(delegate() { shaderObject.LoadSource("OpenGL.Shaders.Line.Vertex.glsl"); });
				// Compile
				Assert.DoesNotThrow(delegate() { shaderObject.Create(_Context); });
			}
		}
Пример #2
0
		public void TestGeometry()
		{
			if (!_Context.Caps.GlExtensions.GeometryShader4_ARB && !_Context.Caps.GlExtensions.GeometryShader4_EXT)
				Assert.Inconclusive("geometry shader not supported");

			using (ShaderObject shaderObject = new ShaderObject(ShaderStage.Geometry)) {
				// Load source
				Assert.DoesNotThrow(delegate () { shaderObject.LoadSource("OpenGL.Shaders.Line.Geometry.glsl"); });
				// Compile
				Assert.DoesNotThrow(delegate () { shaderObject.Create(_Context); });
			}
		}
Пример #3
0
        public void TestGeometry()
        {
            if (!_Context.Caps.GlExtensions.GeometryShader4_ARB && !_Context.Caps.GlExtensions.GeometryShader4_EXT)
            {
                Assert.Inconclusive("geometry shader not supported");
            }

            using (ShaderObject shaderObject = new ShaderObject(ShaderStage.Geometry)) {
                // Load source
                Assert.DoesNotThrow(delegate() { shaderObject.LoadSource("OpenGL.Shaders.Line.Geometry.glsl"); });
                // Compile
                Assert.DoesNotThrow(delegate() { shaderObject.Create(_Context); });
            }
        }
Пример #4
0
		public void TestFragment()
		{
			using (ShaderObject shaderObject = new ShaderObject(ShaderStage.Fragment)) {
				// Load source
				Assert.DoesNotThrow(delegate () { shaderObject.LoadSource("OpenGL.Shaders.Line.Fragment.glsl"); });
				// Compile
				Assert.DoesNotThrow(delegate () { shaderObject.Create(_Context); });
			}

			using (ShaderObject shaderObject = new ShaderObject(ShaderStage.Fragment)) {
				// Load source
				Assert.DoesNotThrow(delegate () { shaderObject.LoadSource("OpenGL.Shaders.Line.Fragment.glsl"); });
				// Compile
				Assert.DoesNotThrow(delegate () { shaderObject.Create(_Context, new ShaderCompilerContext("HAL_COLOR_PER_VERTEX")); });
			}
		}
Пример #5
0
        public void TestFragment()
        {
            using (ShaderObject shaderObject = new ShaderObject(ShaderStage.Fragment)) {
                // Load source
                Assert.DoesNotThrow(delegate() { shaderObject.LoadSource("OpenGL.Shaders.Line.Fragment.glsl"); });
                // Compile
                Assert.DoesNotThrow(delegate() { shaderObject.Create(_Context); });
            }

            using (ShaderObject shaderObject = new ShaderObject(ShaderStage.Fragment)) {
                // Load source
                Assert.DoesNotThrow(delegate() { shaderObject.LoadSource("OpenGL.Shaders.Line.Fragment.glsl"); });
                // Compile
                Assert.DoesNotThrow(delegate() { shaderObject.Create(_Context, new ShaderCompilerContext("HAL_COLOR_PER_VERTEX")); });
            }
        }
Пример #6
0
        public void TestCreateObject(string objectId)
        {
            ShadersLibrary.Object shaderObjectInfo = ShadersLibrary.Instance.GetObject(objectId);
            Assert.IsNotNull(shaderObjectInfo);

            ShaderObject shaderObject = shaderObjectInfo.Create();

            try {
                Assert.IsNotNull(shaderObject);
                Assert.DoesNotThrow(delegate { shaderObject.Create(_Context); });
            } finally {
                if (shaderObject != null)
                {
                    shaderObject.Dispose();
                }
            }
        }