Source

GL Profile Suite / tests / generate.lua

Full commit

local gen = {}

function gen.GetMainFilename(suiteName)
	return suiteName .. "_codegen.cpp"
end

function gen.GetSuiteClassname(suiteName)
	return suiteName .. "_suite"
end

function gen.GetTestClassname(testName)
	return testName .. "_test"
end

function gen.WritePreamble(hFile, suite_name)
	hFile:write([=[
	/* Here's some preamble text. */
	/* Here's some preamble text. */
	/* Here's some preamble text. */
	/******************************/
]=])
end

function gen.GetStandardIncludes()
	return {
		"<vector>",
		"<iostream>",
		"<fstream>",
		"<boost/range/irange.hpp>",
		"<boost/foreach.hpp>",
	}
end

function gen.GetOpenGLIncludes(majorVersion, minorVersion, bCompatibility)
	local mainGLFuncName =
		string.format("<glload/gl_%i_%i%s.h>",
			majorVersion,
			minorVersion, 
			iif(bCompatibility, "_comp", ""))

	return {
		mainGLFuncName,
		"<glload/gll.hpp>",
		"<glutil/Shader.h>",
		[["../util/util.h"]],
	}
end

function gen.GetFreeglutIncludes()
	return {
		"<GL/freeglut.h>",
	}
end

return gen