Beispiel #1
0
static bool gl_init_extensions(device_t device)
{
	GLenum errorcode = glewInit();
	if (errorcode != GLEW_OK) {
		blog(LOG_ERROR, "glewInit failed, %u", errorcode);
		return false;
	}

	if (!GLEW_VERSION_2_1) {
		blog(LOG_ERROR, "OpenGL 2.1 minimum required by the graphics "
		                "adapter");
		return false;
	}

	if (!GLEW_ARB_framebuffer_object) {
		required_extension_error("GL_ARB_framebuffer_object");
		return false;
	}

	if (!WGLEW_ARB_pixel_format) {
		required_extension_error("WGL_ARB_pixel_format");
		return false;
	}

	if (GLEW_ARB_copy_image)
		device->copy_type = COPY_TYPE_ARB;
	else if (GLEW_NV_copy_image)
		device->copy_type = COPY_TYPE_NV;
	else
		device->copy_type = COPY_TYPE_FBO_BLIT;

	return true;
}
Beispiel #2
0
static bool gl_init_extensions(HDC hdc)
{
	if (!wgl_LoadFunctions(hdc)) {
		blog(LOG_ERROR, "Failed to load WGL entry functions.");
		return false;
	}

	if (!wgl_ext_ARB_pixel_format) {
		required_extension_error("ARB_pixel_format");
		return false;
	}

	if (!wgl_ext_ARB_create_context) {
		required_extension_error("ARB_create_context");
		return false;
	}

	if (!wgl_ext_ARB_create_context_profile) {
		required_extension_error("ARB_create_context_profile");
		return false;
	}

	return true;
}
Beispiel #3
0
static bool gl_init_extensions(device_t device)
{
	glewExperimental = true;
	GLenum errorcode = glewInit();
	if (errorcode != GLEW_OK) {
		blog(LOG_ERROR, "glewInit failed, %u", errorcode);
		return false;
	}

	if (!WGLEW_ARB_pixel_format) {
		required_extension_error("WGL_ARB_pixel_format");
		return false;
	}

	return true;
}