Commits

Anonymous committed 9762947

Caps: Better caps system, with extension checking.

  • Participants
  • Parent commits edfc61a

Comments (0)

Files changed (4)

caps/CapsList.lua

 	{
 		{
 			cat = "Image Limits",
-			{"GL_MAX_TEXTURE_SIZE", "Texture Size", "int"},
-			{"GL_MAX_3D_TEXTURE_SIZE", "3D Texture Size", "int"},
-			{"GL_MAX_CUBE_MAP_TEXTURE_SIZE", "Cubemap Texture Size", "int"},
-			{"GL_MAX_RENDERBUFFER_SIZE", "Renderbuffer Size", "int"},
-			{"GL_MAX_RECTANGLE_TEXTURE_SIZE", "Rectangle Texture Size", "int"},
-			{"GL_MAX_ARRAY_TEXTURE_LAYERS", "Texture Layers", "int"},
-			{"GL_MAX_TEXTURE_BUFFER_SIZE", "Texture Buffer Size", "int"},
+			{
+				name="GL_MAX_TEXTURE_SIZE", desc="Texture Size",
+				type="int",
+			},
+			{
+				name="GL_MAX_3D_TEXTURE_SIZE", desc="3D Texture Size",
+				type="int",
+			},
+			{
+				name="GL_MAX_CUBE_MAP_TEXTURE_SIZE", desc="Cubemap Texture Size",
+				type="int",
+			},
+			{
+				name="GL_MAX_RENDERBUFFER_SIZE", desc="Renderbuffer Size",
+				type="int",
+				version="3.0", ext="ARB_framebuffer_object",
+			},
+			{
+				name="GL_MAX_RECTANGLE_TEXTURE_SIZE", desc="Rectangle Texture Size",
+				type="int",
+			},
+			{
+				name="GL_MAX_ARRAY_TEXTURE_LAYERS", desc="Texture Layers",
+				type="int",
+				version="3.0", 
+			},
+			{
+				name="GL_MAX_TEXTURE_BUFFER_SIZE", desc="Texture Buffer Size",
+				type="int",
+				version="3.1", ext="ARB_texture_buffer_object",
+			},
 		},
 		{
 			cat = "Viewport Limits",
-			{"GL_MAX_VIEWPORT_DIMS", "Viewport Dimensions", "float", 2},
-			{"GL_MAX_VIEWPORTS", "Num Viewports", "int"},
-			{"GL_VIEWPORT_BOUNDS_RANGE", "Largest Viewport Size", "float", 2},
-			{"GL_VIEWPORT_SUBPIXEL_BITS", "Viewport Range Subpixel Bits", "int"},
+			{
+				name="GL_MAX_VIEWPORT_DIMS", desc="Maximum Viewport Dimensions",
+				type="float", numcomps=2
+			},
+			{
+				name="GL_MAX_VIEWPORTS", desc="Maximum Number of Viewports",
+				type="int",
+				version="4.1", ext="ARB_viewport_array",
+			},
+			{
+				name="GL_VIEWPORT_BOUNDS_RANGE", desc="Largest Viewport Size",
+				type="float", numcomps=2,
+				version="4.1", ext="ARB_viewport_array",
+			},
+			{
+				name="GL_VIEWPORT_SUBPIXEL_BITS", desc="Viewport Range Subpixel Bits",
+				type="int",
+				version="4.1", ext="ARB_viewport_array",
+			},
 		},
 		{
 			cat = "Binary Programs",
-			{"GL_NUM_PROGRAM_BINARY_FORMATS", "Number of Binary Formats", "int"},
-			{"GL_PROGRAM_BINARY_FORMATS", "Binary Formats", "hex", "GL_NUM_PROGRAM_BINARY_FORMATS"},
-			{"GL_NUM_SHADER_BINARY_FORMATS", "Number of Shader Formats", "int"},
---			{"GL_SHADER_BINARY_FORMATS", "Shader Formats", "hex", "GL_NUM_SHADER_BINARY_FORMATS"},
+			{
+				name="GL_NUM_PROGRAM_BINARY_FORMATS", desc="Number of Binary Formats",
+				type="int",
+				version="4.1", ext="ARB_get_program_binary",
+			},
+			{
+				name="GL_PROGRAM_BINARY_FORMATS", desc="Binary Formats",
+				type="hex", numcomps="GL_NUM_PROGRAM_BINARY_FORMATS",
+				version="4.1", ext="ARB_get_program_binary",
+			},
+			
+			{
+				name="GL_NUM_SHADER_BINARY_FORMATS", desc="Number of Shader Formats",
+				type="int",
+				version="4.1", ext="ARB_ES2_compatibility",
+			},
+			{
+				name="GL_SHADER_BINARY_FORMATS", desc="Shader Formats",
+				type="hex", numcomps="GL_NUM_SHADER_BINARY_FORMATS",
+				version="4.1", ext="ARB_ES2_compatibility",
+			},
 		},
 		{
 			cat = "Vertex Shader Limits",
-			{"GL_MAX_VERTEX_ATTRIBS", "Vertex Attributes", "int"},
-			{"GL_MAX_VERTEX_UNIFORM_COMPONENTS", "Uniform Components", "int"},
-			{"GL_MAX_VERTEX_UNIFORM_VECTORS", "Uniform Vectors", "int"},
-			{"GL_MAX_VERTEX_UNIFORM_BLOCKS", "Uniform Blocks", "int"},
-			{"GL_MAX_VERTEX_OUTPUT_COMPONENTS", "Output Components", "int"},
-			{"GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS", "Texture Units", "int"},
+			{
+				name="GL_MAX_VERTEX_ATTRIBS", desc="Vertex Attributes",
+				type="int",
+				version="2.0",
+			},
+			{
+				name="GL_MAX_VERTEX_UNIFORM_COMPONENTS", desc="Uniform Components", 
+				type="int",
+				version="2.0",
+			},
+			{
+				name="GL_MAX_VERTEX_UNIFORM_VECTORS", desc="Uniform Vectors",
+				type="int",
+				version="4.1", ext="ARB_ES2_compatibility",
+			},
+			{
+				name="GL_MAX_VERTEX_UNIFORM_BLOCKS", desc="Uniform Blocks",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
+			{
+				name="GL_MAX_VERTEX_OUTPUT_COMPONENTS", desc="Output Components", 
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS", desc="Texture Units",
+				type="int",
+				version="2.0",
+			},
 		},
 		{
 			cat = "Tessellation Shader Limits",
-			{"GL_MAX_TESS_GEN_LEVEL", "Number of tessellation levels", "int"},
-			{"GL_MAX_PATCH_VERTICES", "Vertices per patch", "int"},
+			{
+				name="GL_MAX_TESS_GEN_LEVEL", desc="Number of tessellation levels",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_PATCH_VERTICES", desc="Vertices per patch",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
 		},
 		{
 			cat = "Tessellation Control Shader Limits",
-			{"GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS", "Uniform Components", "int"},
-			{"GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS", "Texture Units", "int"},
-			{"GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS", "Per vertex output components", "int"},
-			{"GL_MAX_TESS_PATCH_COMPONENTS", "Components output per patch", "int"},
-			{"GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS", "Output Components", "int"},
-			{"GL_MAX_TESS_CONTROL_INPUT_COMPONENTS", "Input Components", "int"},
-			{"GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS", "Uniform Blocks", "int"},
+			{
+				name="GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS", desc="Uniform Components",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS", desc="Texture Units",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS", desc="Per vertex output components",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_PATCH_COMPONENTS", desc="Components output per patch",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS", desc="Output Components",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_CONTROL_INPUT_COMPONENTS", desc="Input Components",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS", desc="Uniform Blocks",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
 		},
 		{
 			cat = "Tessellation Evaluation Shader Limits",
-			{"GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS", "Uniform Components", "int"},
-			{"GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS", "Texture Units", "int"},
-			{"GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS", "Output Components", "int"},
-			{"GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS", "Input Components", "int"},
-			{"GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS", "Uniform Blocks", "int"},
+			{
+				name="GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS", desc="Uniform Components",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS", desc="Texture Units",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS", desc="Output Components",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS", desc="Input Components",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS", desc="Uniform Blocks",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
 		},
 		{
 			cat = "Geometry Shader Limits",
-			{"GL_MAX_GEOMETRY_UNIFORM_COMPONENTS", "Uniform Components", "int"},
-			{"GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS", "Texture Units", "int"},
-			{"GL_MAX_GEOMETRY_OUTPUT_COMPONENTS", "Per vertex output components", "int"},
-			{"GL_MAX_GEOMETRY_OUTPUT_VERTICES", "Output Vertices", "int"},
-			{"GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS", "Total component output", "int"},
-			{"GL_MAX_GEOMETRY_INPUT_COMPONENTS", "Input Components", "int"},
-			{"GL_MAX_GEOMETRY_UNIFORM_BLOCKS", "Uniform Blocks", "int"},
-			{"GL_MAX_VERTEX_STREAMS", "Vertex Streams", "int"},
+			{
+				name="GL_MAX_GEOMETRY_UNIFORM_COMPONENTS", desc="Uniform Components",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS", desc="Texture Units",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_GEOMETRY_OUTPUT_COMPONENTS", desc="Per vertex output components",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_GEOMETRY_OUTPUT_VERTICES", desc="Output Vertices",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS", desc="Total component output",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_GEOMETRY_INPUT_COMPONENTS", desc="Input Components",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_GEOMETRY_UNIFORM_BLOCKS", desc="Uniform Blocks",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_VERTEX_STREAMS", desc="Vertex Streams",
+				type="int",
+				version="3.2",
+			},
 		},
 		{
 			cat = "Fragment Shader Limits",
-			{"GL_MAX_FRAGMENT_UNIFORM_COMPONENTS", "Uniform Components", "int"},
-			{"GL_MAX_FRAGMENT_UNIFORM_VECTORS", "Uniform Vectors", "int"},
-			{"GL_MAX_TEXTURE_IMAGE_UNITS", "Texture Units", "int"},
-			{"GL_MAX_FRAGMENT_INPUT_COMPONENTS", "Input Components", "int"},
-			{"GL_MAX_FRAGMENT_UNIFORM_BLOCKS", "Uniform Blocks", "int"},
+			{
+				name="GL_MAX_FRAGMENT_UNIFORM_COMPONENTS", desc="Uniform Components",
+				type="int",
+				version="2.0",
+			},
+			{
+				name="GL_MAX_FRAGMENT_UNIFORM_VECTORS", desc="Uniform Vectors",
+				type="int",
+				version="4.1", ext="ARB_ES2_compatibility",
+			},
+			{
+				name="GL_MAX_TEXTURE_IMAGE_UNITS", desc="Texture Units",
+				type="int",
+				version="2.0",
+			},
+			{
+				name="GL_MAX_FRAGMENT_INPUT_COMPONENTS", desc="Input Components",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_FRAGMENT_UNIFORM_BLOCKS", desc="Uniform Blocks",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
 		},
 		{
 			cat = "Combined Shader Limits",
-			{"GL_MAX_UNIFORM_BUFFER_BINDINGS", "Total number of uniform buffer binding points", "int"},
-			{"GL_MAX_UNIFORM_BLOCK_SIZE", "Size in bytes of a block", "int"},
-			{"GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT", "Minimum alignment for uniform buffer sizes/offsets", "int"},
-			{"GL_MAX_COMBINED_UNIFORM_BLOCKS", "Number of uniform buffers per program", "int"},
-			{"GL_MAX_VARYING_COMPONENTS", "Number of varying components per program.", "int"},
-			{"GL_MAX_VARYING_VECTORS", "Number of varying vectors per program", "int"},
-			{"GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS", "Total number of texture image units", "int"},
-			{"GL_MAX_SUBROUTINES", "Number of Subroutines", "int"},
-			{"GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS", "Maximum subroutines per stage.", "int"},
+			{
+				name="GL_MAX_UNIFORM_BUFFER_BINDINGS", desc="Total number of uniform buffer binding points",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
+			{
+				name="GL_MAX_UNIFORM_BLOCK_SIZE", desc="Size in bytes of a block",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
+			{
+				name="GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT", desc="Minimum alignment for uniform buffer sizes/offsets",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
+			{
+				name="GL_MAX_COMBINED_UNIFORM_BLOCKS", desc="Number of uniform buffers per program",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
+			{
+				name="GL_MAX_VARYING_COMPONENTS", desc="Number of varying components per program.",
+				type="int",
+				version="2.0",
+			},
+			{
+				name="GL_MAX_VARYING_VECTORS", desc="Number of varying vectors per program",
+				type="int",
+			},
+			{
+				name="GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS", desc="Total number of texture image units",
+				type="int",
+				version="2.0",
+			},
+			{
+				name="GL_MAX_SUBROUTINES", desc="Number of Subroutines",
+				type="int",
+				version="4.0", ext="ARB_shader_subroutine",
+			},
+			{
+				name="GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS", desc="Maximum subroutines per stage.",
+				type="int",
+				version="4.0", ext="ARB_shader_subroutine",
+			},
 
-			{"GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", "Total vertex stage uniforms", "int"},
-			{"GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS", "Total tess control stage uniforms", "int"},
-			{"GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS", "Total tex eval stage uniforms", "int"},
-			{"GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", "Total geometry stage uniforms", "int"},
-			{"GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", "Total fragment stage uniforms", "int"},
+			{
+				name="GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS", desc="Total vertex stage uniforms",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
+			{
+				name="GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS", desc="Total tess control stage uniforms",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS", desc="Total tex eval stage uniforms",
+				type="int",
+				version="4.0", ext="ARB_tessellation_shader",
+			},
+			{
+				name="GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS", desc="Total geometry stage uniforms",
+				type="int",
+				version="3.2",
+			},
+			{
+				name="GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS", desc="Total fragment stage uniforms",
+				type="int",
+				version="3.1", ext="ARB_uniform_buffer_object",
+			},
 		},
 		{
 			cat = "Texture Access Limits",
-			{"GL_MAX_TEXTURE_LOD_BIAS", "LOD Bias", "float"},
-			{"GL_MIN_PROGRAM_TEXEL_OFFSET", "Minimum texel offset", "int"},
-			{"GL_MAX_PROGRAM_TEXEL_OFFSET", "Maximum texel offset", "int"},
-			{"GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET", "Minimum texture gather offset", "int"},
-			{"GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET", "Maximum texture gather offset", "int"},
+			{
+				name="GL_MAX_TEXTURE_LOD_BIAS", desc="LOD Bias",
+				type="float",
+			},
+			{
+				name="GL_MIN_PROGRAM_TEXEL_OFFSET", desc="Minimum texel offset",
+				type="int",
+				version="3.0",
+			},
+			{
+				name="GL_MAX_PROGRAM_TEXEL_OFFSET", desc="Maximum texel offset",
+				type="int",
+				version="3.0",
+			},
+			{
+				name="GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET", desc="Minimum texture gather offset",
+				type="int",
+				version="4.0", ext="ARB_texture_gather",
+			},
+			{
+				name="GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET", desc="Maximum texture gather offset",
+				type="int",
+				version="4.0", ext="ARB_texture_gather",
+			},
 		},
 		{
 			cat = "Transform Feeback Limits",
-			{"GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", "Components written while interleaved", "int"},
-			{"GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", "Num separate attributes", "int"},
-			{"GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", "Num components per attribute while separate", "int"},
-			{"GL_MAX_TRANSFORM_FEEDBACK_BUFFERS", "Num buffers written to", "int"},
+			{
+				name="GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS", desc="Components written while interleaved",
+				type="int",
+				version="3.0",
+			},
+			{
+				name="GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS", desc="Num separate attributes",
+				type="int",
+				version="3.0",
+			},
+			{
+				name="GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS", desc="Num components per attribute while separate",
+				type="int",
+				version="3.0",
+			},
+			{
+				name="GL_MAX_TRANSFORM_FEEDBACK_BUFFERS", desc="Num buffers written to",
+				type="int",
+				version="4.0", ext="ARB_transform_feedback3"
+			},
 		},
 		{
 			cat = "Framebuffer Limits",
-			{"GL_MAX_DRAW_BUFFERS", "Num active FBO color attachments", "int"},
-			{"GL_MAX_DUAL_SOURCE_DRAW_BUFFERS", "Num active FBO color attachments when dual source", "int"},
+			{
+				name="GL_MAX_DRAW_BUFFERS", desc="Num active FBO color attachments",
+				type="int",
+				version="3.0", ext="ARB_framebuffer_object"
+			},
+			{
+				name="GL_MAX_DUAL_SOURCE_DRAW_BUFFERS", desc="Num active FBO color attachments when dual source",
+				type="int",
+				version="3.2", ext="ARB_blend_func_extended"
+			},
 		},
 		{
 			cat = "Multisample Limits",
-			{"GL_MAX_COLOR_TEXTURE_SAMPLES", "Samples per color texture", "int"},
-			{"GL_MAX_DEPTH_TEXTURE_SAMPLES", "Samples per depth/stencil texture", "int"},
-			{"GL_MAX_INTEGER_SAMPLES", "Samples per integer buffer", "int"},
+			{
+				name="GL_MAX_COLOR_TEXTURE_SAMPLES", desc="Samples per color texture",
+				type="int",
+			},
+			{
+				name="GL_MAX_DEPTH_TEXTURE_SAMPLES", desc="Samples per depth/stencil texture",
+				type="int",
+			},
+			{
+				name="GL_MAX_INTEGER_SAMPLES", desc="Samples per integer buffer",
+				type="int",
+			},
 		},
 		{
 			cat = "Drawing Limits",
-			{"GL_MAX_ELEMENTS_INDICES", "Recommended max index count for glDrawRange*", "int"},
-			{"GL_MAX_ELEMENTS_VERTICES", "Recommended max vertex count for glDrawRange*", "int"},
+			{
+				name="GL_MAX_ELEMENTS_INDICES", desc="Recommended max index count for glDrawRange*",
+				type="int",
+			},
+			{
+				name="GL_MAX_ELEMENTS_VERTICES", desc="Recommended max vertex count for glDrawRange*",
+				type="int",
+			},
 		},
 	}
 
 	float = {"%f", "glGetFloatv", "floats", "GLfloat"},
 }
 
-local function WriteNumericLimits(hFile)
-	hFile:write("printf(\"== Numeric Limits ==\\n\\n\");\n");
+local function TabManager()
+	local tm = { tabs = "", tabcnt = 0 }
+	
+	function tm:Enter()
+		self.tabcnt = self.tabcnt + 1
+		self.tabs = string.rep("\t", self.tabcnt);
+		return self;
+	end
+
+	function tm:Exit()
+		self.tabcnt = self.tabcnt - 1
+		self.tabs = string.rep("\t", self.tabcnt);
+		return self;
+	end
+	
+	local tmMeta =
+	{
+		__call = function(tm) return tm.tabs end
+	}
+	
+	setmetatable(tm, tmMeta);
+	return tm;
+end
+
+local function PrintLimitNamed(hFile, limit, t)
+	local numComponents = limit.numcomps or 1;
+	local typeInfo = typeData[limit.type];
+	
+	if(limit.version or limit.ext) then
+		hFile:write(t(), "if(")
+		if(limit.version) then
+			local major, minor = limit.version:match("(%d+)%.(%d+)");
+			hFile:write(string.format("IsVersionGEQ(%i, %i)", major, minor))
+		end
+		if(limit.ext) then
+			if(limit.version) then
+				hFile:write(" || ")
+			end
+			if(type(limit.ext) == "table") then
+				for i, ext in ipairs(limit.ext) do
+					hFile:write("glext_", ext)
+					if(i ~= #limit.ext) then
+						hFile:write(" || ")
+					end
+				end
+			else
+				hFile:write("glext_", limit.ext)
+			end
+		end
+		hFile:write(")\n")
+		hFile:write(t(), "{\n");
+		t:Enter()
+	end
+	
+	if(type(numComponents) == "string") then
+		if(not(limit.version or limit.ext)) then
+			hFile:write(t, "{\n")
+			t:Enter()
+		end
+		hFile:write(t(), "GLint iCount = 0;\n");
+		hFile:write(t(), "glGetIntegerv(", numComponents, ", &iCount);\n");
+		hFile:write(t(), "if(iCount)\n")
+		hFile:write(t(), "{\n")
+		t:Enter()		
+		hFile:write(t(), typeInfo[4],  "*pData = new ", typeInfo[4], "[iCount];\n")
+		hFile:write(t(), typeInfo[2], string.format("(%s, pData);\n", limit.name));
+		hFile:write(t(), "if(glGetError() == GL_NO_ERROR)\n");
+		hFile:write(t(), "{\n");
+		t:Enter()
+		hFile:write(t(), "printf(\"* ", limit.desc, "(%i): \", iCount);\n");
+		hFile:write(t(), "for(int iLoop = 0; iLoop < iCount; iLoop++)\n");
+		hFile:write(t(), "{\n");
+		t:Enter()
+		hFile:write(t(), "printf(\"", typeInfo[1], "\", pData[iLoop]);\n");
+		hFile:write(t(), "if(iLoop != iCount - 1)\n\t\t\t\t\tprintf(\", \");\n")
+		t:Exit()
+		hFile:write(t(), "}\n")
+		hFile:write(t(), "printf(\"\\n\");\n");
+		t:Exit()
+		hFile:write(t(), "}\n");
+		hFile:write(t(), "delete[] pData;\n")
+		t:Exit()
+		hFile:write(t(), "}\n")
+		if(not(limit.version or limit.ext)) then
+			t:Exit()
+			hFile:write(t(), "}\n");
+		end
+	else
+		hFile:write(t(), typeInfo[2], string.format("(%s, %s);\n", limit.name, typeInfo[3]));
+
+		hFile:write(t(), "if(glGetError() == GL_NO_ERROR)\n");
+		t:Enter()
+		hFile:write(t(), "printf(\"* ", limit.desc, ": ");
+		hFile:write(RepSep(typeInfo[1], numComponents, ", "));
+		hFile:write("\\n\", ");
+		for k = 1, numComponents do
+			hFile:write(typeInfo[3], "[", k - 1, "]");
+			if(k ~= numComponents) then hFile:write(", "); end
+		end
+		hFile:write(");\n");
+		t:Exit()
+	end
+
+	if(limit.version or limit.ext) then
+		t:Exit()
+		hFile:write(t(), "}\n");
+	end
+end
+
+local function WriteNumericLimits(hFile, t)
+	hFile:write(t(), "printf(\"== Numeric Limits ==\\n\\n\");\n");
 	
 	local limits = caps.limits
 	
 	for i, cat in ipairs(limits) do
-		hFile:write("printf(\"=== ");
-		hFile:write(cat.cat);
-		hFile:write(" ===\\n\\n\");\n");
+		hFile:write(t(), "printf(\"=== ", cat.cat, " ===\\n\\n\");\n");
 		
 		for j, limit in ipairs(cat) do
-			local numComponents = limit[4] or 1;
-			local typeInfo = typeData[limit[3]];
-			
-			if(type(numComponents) == "string") then
-				hFile:write("{\n", "\tint iCount = 0;\n");
-				hFile:write("\tglGetIntegerv(", numComponents, ", &iCount);\n");
-				hFile:write("\tif(iCount)\n\t{\n")
-				
-				hFile:write("\t\t", typeInfo[4],  "*pData = new ", typeInfo[4], "[iCount];\n")
-				hFile:write("\t\t", typeInfo[2]);
-				hFile:write(string.format("(%s, pData);\n", limit[1]));
-				hFile:write("\t\tif(glGetError() == GL_NO_ERROR)\n");
-				hFile:write("\t\t{\n");
-
-				hFile:write("\t\t\tprintf(\"* ", limit[2], "(%i): \", iCount);\n");
-				hFile:write("\t\t\tfor(int iLoop = 0; iLoop < iCount; iLoop++)\n");
-				hFile:write("\t\t\t{\n");
-				hFile:write("\t\t\t\tprintf(\"", typeInfo[1], "\", pData[iLoop]);\n");
-				hFile:write("\t\t\t\tif(iLoop != iCount - 1)\n\t\t\t\t\tprintf(\", \");\n")
-				hFile:write("\t\t\t}\n", "\t\t\tprintf(\"\\n\");\n");
-
-				hFile:write("\t\t}\n");
-				hFile:write("\t\tdelete[] pData;\n")
-				
-				hFile:write("\t}\n}\n");
-			else
-				hFile:write(typeInfo[2]);
-				hFile:write(string.format("(%s, %s);\n", limit[1], typeInfo[3]));
-
-				hFile:write("if(glGetError() == GL_NO_ERROR)\n");
-
-				hFile:write("\tprintf(\"* ", limit[2], ": ");
-				hFile:write(RepSep(typeInfo[1], numComponents, ", "));
-				hFile:write("\\n\", ");
-				for k = 1, numComponents do
-					hFile:write(typeInfo[3], "[", k - 1, "]");
-					if(k ~= numComponents) then hFile:write(", "); end
-				end
-				hFile:write(");\n");
-			end
+			PrintLimitNamed(hFile, limit, t)
 		end
 		
-		hFile:write([[printf("\n\n");]], "\n\n");
+		hFile:write(t(), [[printf("\n\n");]], "\n\n");
 	end
 	
 end
 local hFile = assert(io.open("caps.cpp", "w"), "Could not open file.");
 
 WritePreamble(hFile);
+local t = TabManager();
+t:Enter();
 
-WriteBasicData(hFile);
+WriteBasicData(hFile, t);
 hFile:write("\n\n");
 
-WriteNumericLimits(hFile);
+WriteNumericLimits(hFile, t);
 hFile:write("\n\n");
+t:Exit()
 
 WritePostscript(hFile);
 
 printf("* GL_SHADING_LANGUAGE_VERSION: %s\n", (const char *)glGetString(GL_SHADING_LANGUAGE_VERSION));
 
 
-printf("== Numeric Limits ==\n\n");
-printf("=== Image Limits ===\n\n");
-glGetIntegerv(GL_MAX_TEXTURE_SIZE, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Size: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* 3D Texture Size: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Cubemap Texture Size: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Renderbuffer Size: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Rectangle Texture Size: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Layers: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Buffer Size: %i\n", integers[0]);
-printf("\n\n");
+	printf("== Numeric Limits ==\n\n");
+	printf("=== Image Limits ===\n\n");
+	glGetIntegerv(GL_MAX_TEXTURE_SIZE, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Texture Size: %i\n", integers[0]);
+	glGetIntegerv(GL_MAX_3D_TEXTURE_SIZE, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* 3D Texture Size: %i\n", integers[0]);
+	glGetIntegerv(GL_MAX_CUBE_MAP_TEXTURE_SIZE, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Cubemap Texture Size: %i\n", integers[0]);
+	if(IsVersionGEQ(3, 0) || glext_ARB_framebuffer_object)
+	{
+		glGetIntegerv(GL_MAX_RENDERBUFFER_SIZE, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Renderbuffer Size: %i\n", integers[0]);
+	}
+	glGetIntegerv(GL_MAX_RECTANGLE_TEXTURE_SIZE, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Rectangle Texture Size: %i\n", integers[0]);
+	if(IsVersionGEQ(3, 0))
+	{
+		glGetIntegerv(GL_MAX_ARRAY_TEXTURE_LAYERS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Texture Layers: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_texture_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_TEXTURE_BUFFER_SIZE, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Texture Buffer Size: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Viewport Limits ===\n\n");
-glGetFloatv(GL_MAX_VIEWPORT_DIMS, floats);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Viewport Dimensions: %f, %f\n", floats[0], floats[1]);
-glGetIntegerv(GL_MAX_VIEWPORTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Num Viewports: %i\n", integers[0]);
-glGetFloatv(GL_VIEWPORT_BOUNDS_RANGE, floats);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Largest Viewport Size: %f, %f\n", floats[0], floats[1]);
-glGetIntegerv(GL_VIEWPORT_SUBPIXEL_BITS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Viewport Range Subpixel Bits: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Viewport Limits ===\n\n");
+	glGetFloatv(GL_MAX_VIEWPORT_DIMS, floats);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Maximum Viewport Dimensions: %f, %f\n", floats[0], floats[1]);
+	if(IsVersionGEQ(4, 1) || glext_ARB_viewport_array)
+	{
+		glGetIntegerv(GL_MAX_VIEWPORTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Maximum Number of Viewports: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 1) || glext_ARB_viewport_array)
+	{
+		glGetFloatv(GL_VIEWPORT_BOUNDS_RANGE, floats);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Largest Viewport Size: %f, %f\n", floats[0], floats[1]);
+	}
+	if(IsVersionGEQ(4, 1) || glext_ARB_viewport_array)
+	{
+		glGetIntegerv(GL_VIEWPORT_SUBPIXEL_BITS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Viewport Range Subpixel Bits: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Binary Programs ===\n\n");
-glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Number of Binary Formats: %i\n", integers[0]);
-{
-	int iCount = 0;
-	glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &iCount);
-	if(iCount)
+	printf("=== Binary Programs ===\n\n");
+	if(IsVersionGEQ(4, 1) || glext_ARB_get_program_binary)
 	{
-		GLint*pData = new GLint[iCount];
-		glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, pData);
+		glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, integers);
 		if(glGetError() == GL_NO_ERROR)
+			printf("* Number of Binary Formats: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 1) || glext_ARB_get_program_binary)
+	{
+		GLint iCount = 0;
+		glGetIntegerv(GL_NUM_PROGRAM_BINARY_FORMATS, &iCount);
+		if(iCount)
 		{
-			printf("* Binary Formats(%i): ", iCount);
-			for(int iLoop = 0; iLoop < iCount; iLoop++)
+			GLint*pData = new GLint[iCount];
+			glGetIntegerv(GL_PROGRAM_BINARY_FORMATS, pData);
+			if(glGetError() == GL_NO_ERROR)
 			{
-				printf("%08x", pData[iLoop]);
-				if(iLoop != iCount - 1)
+				printf("* Binary Formats(%i): ", iCount);
+				for(int iLoop = 0; iLoop < iCount; iLoop++)
+				{
+					printf("%08x", pData[iLoop]);
+					if(iLoop != iCount - 1)
 					printf(", ");
+				}
+				printf("\n");
 			}
-			printf("\n");
+			delete[] pData;
 		}
-		delete[] pData;
 	}
-}
-glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Number of Shader Formats: %i\n", integers[0]);
-printf("\n\n");
+	if(IsVersionGEQ(4, 1) || glext_ARB_ES2_compatibility)
+	{
+		glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Number of Shader Formats: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 1) || glext_ARB_ES2_compatibility)
+	{
+		GLint iCount = 0;
+		glGetIntegerv(GL_NUM_SHADER_BINARY_FORMATS, &iCount);
+		if(iCount)
+		{
+			GLint*pData = new GLint[iCount];
+			glGetIntegerv(GL_SHADER_BINARY_FORMATS, pData);
+			if(glGetError() == GL_NO_ERROR)
+			{
+				printf("* Shader Formats(%i): ", iCount);
+				for(int iLoop = 0; iLoop < iCount; iLoop++)
+				{
+					printf("%08x", pData[iLoop]);
+					if(iLoop != iCount - 1)
+					printf(", ");
+				}
+				printf("\n");
+			}
+			delete[] pData;
+		}
+	}
+	printf("\n\n");
 
-printf("=== Vertex Shader Limits ===\n\n");
-glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Vertex Attributes: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Vectors: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Blocks: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Output Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Units: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Vertex Shader Limits ===\n\n");
+	if(IsVersionGEQ(2, 0))
+	{
+		glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Vertex Attributes: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(2, 0))
+	{
+		glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 1) || glext_ARB_ES2_compatibility)
+	{
+		glGetIntegerv(GL_MAX_VERTEX_UNIFORM_VECTORS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Vectors: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_VERTEX_UNIFORM_BLOCKS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Blocks: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Output Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(2, 0))
+	{
+		glGetIntegerv(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Texture Units: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Tessellation Shader Limits ===\n\n");
-glGetIntegerv(GL_MAX_TESS_GEN_LEVEL, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Number of tessellation levels: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_PATCH_VERTICES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Vertices per patch: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Tessellation Shader Limits ===\n\n");
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_GEN_LEVEL, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Number of tessellation levels: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_PATCH_VERTICES, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Vertices per patch: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Tessellation Control Shader Limits ===\n\n");
-glGetIntegerv(GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Units: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Per vertex output components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_PATCH_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Components output per patch: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Output Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_CONTROL_INPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Input Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Blocks: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Tessellation Control Shader Limits ===\n\n");
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_CONTROL_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_CONTROL_TEXTURE_IMAGE_UNITS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Texture Units: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_CONTROL_OUTPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Per vertex output components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_PATCH_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Components output per patch: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_CONTROL_TOTAL_OUTPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Output Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_CONTROL_INPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Input Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_CONTROL_UNIFORM_BLOCKS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Blocks: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Tessellation Evaluation Shader Limits ===\n\n");
-glGetIntegerv(GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Units: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Output Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Input Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Blocks: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Tessellation Evaluation Shader Limits ===\n\n");
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_EVALUATION_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_EVALUATION_TEXTURE_IMAGE_UNITS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Texture Units: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_EVALUATION_OUTPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Output Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_EVALUATION_INPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Input Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_TESS_EVALUATION_UNIFORM_BLOCKS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Blocks: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Geometry Shader Limits ===\n\n");
-glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Units: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Per vertex output components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Output Vertices: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total component output: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_GEOMETRY_INPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Input Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_BLOCKS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Blocks: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VERTEX_STREAMS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Vertex Streams: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Geometry Shader Limits ===\n\n");
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Texture Units: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Per vertex output components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_GEOMETRY_OUTPUT_VERTICES, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Output Vertices: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total component output: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_GEOMETRY_INPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Input Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_GEOMETRY_UNIFORM_BLOCKS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Blocks: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_VERTEX_STREAMS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Vertex Streams: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Fragment Shader Limits ===\n\n");
-glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Vectors: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Texture Units: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Input Components: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Uniform Blocks: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Fragment Shader Limits ===\n\n");
+	if(IsVersionGEQ(2, 0))
+	{
+		glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 1) || glext_ARB_ES2_compatibility)
+	{
+		glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_VECTORS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Vectors: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(2, 0))
+	{
+		glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Texture Units: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Input Components: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_FRAGMENT_UNIFORM_BLOCKS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Uniform Blocks: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Combined Shader Limits ===\n\n");
-glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total number of uniform buffer binding points: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Size in bytes of a block: %i\n", integers[0]);
-glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Minimum alignment for uniform buffer sizes/offsets: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Number of uniform buffers per program: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VARYING_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Number of varying components per program.: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_VARYING_VECTORS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Number of varying vectors per program: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total number of texture image units: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_SUBROUTINES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Number of Subroutines: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Maximum subroutines per stage.: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total vertex stage uniforms: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total tess control stage uniforms: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total tex eval stage uniforms: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total geometry stage uniforms: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Total fragment stage uniforms: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Combined Shader Limits ===\n\n");
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_UNIFORM_BUFFER_BINDINGS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total number of uniform buffer binding points: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_UNIFORM_BLOCK_SIZE, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Size in bytes of a block: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Minimum alignment for uniform buffer sizes/offsets: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_COMBINED_UNIFORM_BLOCKS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Number of uniform buffers per program: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(2, 0))
+	{
+		glGetIntegerv(GL_MAX_VARYING_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Number of varying components per program.: %i\n", integers[0]);
+	}
+	glGetIntegerv(GL_MAX_VARYING_VECTORS, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Number of varying vectors per program: %i\n", integers[0]);
+	if(IsVersionGEQ(2, 0))
+	{
+		glGetIntegerv(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total number of texture image units: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_shader_subroutine)
+	{
+		glGetIntegerv(GL_MAX_SUBROUTINES, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Number of Subroutines: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_shader_subroutine)
+	{
+		glGetIntegerv(GL_MAX_SUBROUTINE_UNIFORM_LOCATIONS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Maximum subroutines per stage.: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total vertex stage uniforms: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_COMBINED_TESS_CONTROL_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total tess control stage uniforms: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_tessellation_shader)
+	{
+		glGetIntegerv(GL_MAX_COMBINED_TESS_EVALUATION_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total tex eval stage uniforms: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2))
+	{
+		glGetIntegerv(GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total geometry stage uniforms: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 1) || glext_ARB_uniform_buffer_object)
+	{
+		glGetIntegerv(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Total fragment stage uniforms: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Texture Access Limits ===\n\n");
-glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS, floats);
-if(glGetError() == GL_NO_ERROR)
-	printf("* LOD Bias: %f\n", floats[0]);
-glGetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Minimum texel offset: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Maximum texel offset: %i\n", integers[0]);
-glGetIntegerv(GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Minimum texture gather offset: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Maximum texture gather offset: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Texture Access Limits ===\n\n");
+	glGetFloatv(GL_MAX_TEXTURE_LOD_BIAS, floats);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* LOD Bias: %f\n", floats[0]);
+	if(IsVersionGEQ(3, 0))
+	{
+		glGetIntegerv(GL_MIN_PROGRAM_TEXEL_OFFSET, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Minimum texel offset: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 0))
+	{
+		glGetIntegerv(GL_MAX_PROGRAM_TEXEL_OFFSET, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Maximum texel offset: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_texture_gather)
+	{
+		glGetIntegerv(GL_MIN_PROGRAM_TEXTURE_GATHER_OFFSET, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Minimum texture gather offset: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_texture_gather)
+	{
+		glGetIntegerv(GL_MAX_PROGRAM_TEXTURE_GATHER_OFFSET, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Maximum texture gather offset: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Transform Feeback Limits ===\n\n");
-glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Components written while interleaved: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Num separate attributes: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Num components per attribute while separate: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Num buffers written to: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Transform Feeback Limits ===\n\n");
+	if(IsVersionGEQ(3, 0))
+	{
+		glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Components written while interleaved: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 0))
+	{
+		glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Num separate attributes: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 0))
+	{
+		glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Num components per attribute while separate: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(4, 0) || glext_ARB_transform_feedback3)
+	{
+		glGetIntegerv(GL_MAX_TRANSFORM_FEEDBACK_BUFFERS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Num buffers written to: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Framebuffer Limits ===\n\n");
-glGetIntegerv(GL_MAX_DRAW_BUFFERS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Num active FBO color attachments: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Num active FBO color attachments when dual source: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Framebuffer Limits ===\n\n");
+	if(IsVersionGEQ(3, 0) || glext_ARB_framebuffer_object)
+	{
+		glGetIntegerv(GL_MAX_DRAW_BUFFERS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Num active FBO color attachments: %i\n", integers[0]);
+	}
+	if(IsVersionGEQ(3, 2) || glext_ARB_blend_func_extended)
+	{
+		glGetIntegerv(GL_MAX_DUAL_SOURCE_DRAW_BUFFERS, integers);
+		if(glGetError() == GL_NO_ERROR)
+			printf("* Num active FBO color attachments when dual source: %i\n", integers[0]);
+	}
+	printf("\n\n");
 
-printf("=== Multisample Limits ===\n\n");
-glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Samples per color texture: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Samples per depth/stencil texture: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_INTEGER_SAMPLES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Samples per integer buffer: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Multisample Limits ===\n\n");
+	glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Samples per color texture: %i\n", integers[0]);
+	glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Samples per depth/stencil texture: %i\n", integers[0]);
+	glGetIntegerv(GL_MAX_INTEGER_SAMPLES, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Samples per integer buffer: %i\n", integers[0]);
+	printf("\n\n");
 
-printf("=== Drawing Limits ===\n\n");
-glGetIntegerv(GL_MAX_ELEMENTS_INDICES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Recommended max index count for glDrawRange*: %i\n", integers[0]);
-glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, integers);
-if(glGetError() == GL_NO_ERROR)
-	printf("* Recommended max vertex count for glDrawRange*: %i\n", integers[0]);
-printf("\n\n");
+	printf("=== Drawing Limits ===\n\n");
+	glGetIntegerv(GL_MAX_ELEMENTS_INDICES, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Recommended max index count for glDrawRange*: %i\n", integers[0]);
+	glGetIntegerv(GL_MAX_ELEMENTS_VERTICES, integers);
+	if(glGetError() == GL_NO_ERROR)
+		printf("* Recommended max vertex count for glDrawRange*: %i\n", integers[0]);
+	printf("\n\n");
 
 
 

caps/premake4.lua

 	
 	UseLibs {"freeglut", "glload"}
 
-	files {"main.cpp", "caps.cpp"};
+	files {"main.cpp", "caps.cpp", "caps.h"};
 	
 	configuration "windows"
 		defines {"WIN32"}