Java Code Examples for com.jogamp.opengl.GL4#GL_TESS_CONTROL_SHADER

The following examples show how to use com.jogamp.opengl.GL4#GL_TESS_CONTROL_SHADER . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ShaderTest.java    From plugins with GNU General Public License v3.0 4 votes vote down vote up
private void verify(Template template, Shader shader) throws Exception
{
	File folder = temp.newFolder();
	List<String> args = new ArrayList<>();
	args.add(System.getProperty("glslang.path"));
	args.add("-l");
	for (Shader.Unit u : shader.units)
	{
		String contents = template.load(u.getFilename());
		String ext;
		switch (u.getType())
		{
			case GL4.GL_VERTEX_SHADER:
				ext = "vert";
				break;
			case GL4.GL_TESS_CONTROL_SHADER:
				ext = "tesc";
				break;
			case GL4.GL_TESS_EVALUATION_SHADER:
				ext = "tese";
				break;
			case GL4.GL_GEOMETRY_SHADER:
				ext = "geom";
				break;
			case GL4.GL_FRAGMENT_SHADER:
				ext = "frag";
				break;
			case GL4.GL_COMPUTE_SHADER:
				ext = "comp";
				break;
			default:
				throw new IllegalArgumentException(u.getType() + "");
		}
		File file = new File(folder, u.getFilename() + "." + ext);
		Files.write(file.toPath(), contents.getBytes(StandardCharsets.UTF_8));
		args.add(file.getAbsolutePath());
	}

	ProcessBuilder pb = new ProcessBuilder(args.toArray(new String[0]));
	pb.inheritIO();
	Process proc = pb.start();
	if (proc.waitFor() != 0)
	{
		Assert.fail();
	}
}
 
Example 2
Source File: ShaderTest.java    From runelite with BSD 2-Clause "Simplified" License 4 votes vote down vote up
private void verify(Template template, Shader shader) throws Exception
{
	File folder = temp.newFolder();
	List<String> args = new ArrayList<>();
	args.add(System.getProperty("glslang.path"));
	args.add("-l");
	for (Shader.Unit u : shader.units)
	{
		String contents = template.load(u.getFilename());
		String ext;
		switch (u.getType())
		{
			case GL4.GL_VERTEX_SHADER:
				ext = "vert";
				break;
			case GL4.GL_TESS_CONTROL_SHADER:
				ext = "tesc";
				break;
			case GL4.GL_TESS_EVALUATION_SHADER:
				ext = "tese";
				break;
			case GL4.GL_GEOMETRY_SHADER:
				ext = "geom";
				break;
			case GL4.GL_FRAGMENT_SHADER:
				ext = "frag";
				break;
			case GL4.GL_COMPUTE_SHADER:
				ext = "comp";
				break;
			default:
				throw new IllegalArgumentException(u.getType() + "");
		}
		File file = new File(folder, u.getFilename() + "." + ext);
		Files.write(file.toPath(), contents.getBytes(StandardCharsets.UTF_8));
		args.add(file.getAbsolutePath());
	}

	ProcessBuilder pb = new ProcessBuilder(args.toArray(new String[0]));
	pb.inheritIO();
	Process proc = pb.start();
	if (proc.waitFor() != 0)
	{
		Assert.fail();
	}
}