Exemplo n.º 1
0
// Main program entry point
int WINAPI WinMain(HINSTANCE hInstance,HINSTANCE hPrevInstance,LPSTR lpCmdLine,int nShowCmd)
{

	int nRet=0;

	(void)hPrevInstance; // Unused parameters
	hAppInst=hInstance;
	nAppShowCmd=nShowCmd;

	AppDirectory(); // Set current directory to be the applications directory

	// Make version string
	if (nBurnVer & 0xFF)
	{
		// private version (alpha)
		sprintf (szAppBurnVer, "%x.%x.%x.%x", nBurnVer >> 20, (nBurnVer >> 16) & 0x0F, (nBurnVer >> 8) & 0xFF, nBurnVer & 0xFF);
	}
Exemplo n.º 2
0
void CApplication::DumpGLInfo()
{
	gl3wInit();

	std::ifstream i(GetAppDataDirectory(AppDirectory(), "glinfo.txt").c_str());
	if (i)
		return;
	i.close();

	std::ofstream o(GetAppDataDirectory(AppDirectory(), "glinfo.txt").c_str());
	if (!o || !o.is_open())
		return;

	o << "Vendor: " << (char*)glGetString(GL_VENDOR) << std::endl;
	o << "Renderer: " << (char*)glGetString(GL_RENDERER) << std::endl;
	o << "Version: " << (char*)glGetString(GL_VERSION) << std::endl;

	char* pszShadingLanguageVersion = (char*)glGetString(GL_SHADING_LANGUAGE_VERSION);
	if (pszShadingLanguageVersion)
		o << "Shading Language Version: " << pszShadingLanguageVersion << std::endl;

	char* pszExtensions = (char*)glGetString(GL_EXTENSIONS);
	tstring sExtensions;
	if (pszExtensions)
		sExtensions = pszExtensions;
	tvector<tstring> asExtensions;
	strtok(sExtensions, asExtensions);
	o << "Extensions:" << std::endl;
	for (size_t i = 0; i < asExtensions.size(); i++)
		o << "\t" << asExtensions[i].c_str() << std::endl;

	typedef struct
	{
		const char* pszName;
		int iParameter;
	} GLParameter;

	GLParameter aParameters[] =
	{
		MAKE_PARAMETER(GL_MAX_TEXTURE_SIZE),
		MAKE_PARAMETER(GL_MAX_VIEWPORT_DIMS),
		MAKE_PARAMETER(GL_MAX_3D_TEXTURE_SIZE),
		MAKE_PARAMETER(GL_MAX_ELEMENTS_VERTICES),
		MAKE_PARAMETER(GL_MAX_ELEMENTS_INDICES),
		MAKE_PARAMETER(GL_MAX_TEXTURE_LOD_BIAS),
		MAKE_PARAMETER(GL_MAX_DRAW_BUFFERS),
		MAKE_PARAMETER(GL_MAX_VERTEX_ATTRIBS),
		MAKE_PARAMETER(GL_MAX_TEXTURE_IMAGE_UNITS),
		MAKE_PARAMETER(GL_MAX_VERTEX_UNIFORM_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_FRAGMENT_UNIFORM_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_VARYING_FLOATS),
		MAKE_PARAMETER(GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS),
		MAKE_PARAMETER(GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS),
		MAKE_PARAMETER(GL_MAX_CLIP_DISTANCES),
		MAKE_PARAMETER(GL_MAX_ARRAY_TEXTURE_LAYERS),
		MAKE_PARAMETER(GL_MAX_VARYING_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_TEXTURE_BUFFER_SIZE),
		MAKE_PARAMETER(GL_MAX_RECTANGLE_TEXTURE_SIZE),
		MAKE_PARAMETER(GL_MAX_GEOMETRY_TEXTURE_IMAGE_UNITS),
		MAKE_PARAMETER(GL_MAX_GEOMETRY_UNIFORM_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_GEOMETRY_OUTPUT_VERTICES),
		MAKE_PARAMETER(GL_MAX_GEOMETRY_TOTAL_OUTPUT_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_VERTEX_OUTPUT_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_GEOMETRY_INPUT_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_GEOMETRY_OUTPUT_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_RENDERBUFFER_SIZE),
		MAKE_PARAMETER(GL_MAX_COLOR_ATTACHMENTS),
		MAKE_PARAMETER(GL_MAX_SAMPLES),
		MAKE_PARAMETER(GL_MAX_VERTEX_UNIFORM_BLOCKS),
		MAKE_PARAMETER(GL_MAX_GEOMETRY_UNIFORM_BLOCKS),
		MAKE_PARAMETER(GL_MAX_FRAGMENT_UNIFORM_BLOCKS),
		MAKE_PARAMETER(GL_MAX_COMBINED_UNIFORM_BLOCKS),
		MAKE_PARAMETER(GL_MAX_UNIFORM_BUFFER_BINDINGS),
		MAKE_PARAMETER(GL_MAX_UNIFORM_BLOCK_SIZE),
		MAKE_PARAMETER(GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_COMBINED_GEOMETRY_UNIFORM_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS),
		MAKE_PARAMETER(GL_MAX_COLOR_TEXTURE_SAMPLES),
		MAKE_PARAMETER(GL_MAX_DEPTH_TEXTURE_SAMPLES),
		MAKE_PARAMETER(GL_MAX_INTEGER_SAMPLES),
	};

	// Clear it
	glGetError();

	o << std::endl;

	for (size_t i = 0; i < sizeof(aParameters)/sizeof(GLParameter); i++)
	{
		GLint iValue[4];
		glGetIntegerv(aParameters[i].iParameter, &iValue[0]);

		if (glGetError() != GL_NO_ERROR)
			continue;

		o << aParameters[i].pszName << ": " << iValue[0] << std::endl;
	}
}