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); }); } }
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); }); } }
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); }); } }
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")); }); } }
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")); }); } }
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(); } } }