Beispiel #1
0
static void test_ole_menu(void)
{
	HWND hwndFrame;
	HRESULT hr;

	hwndFrame = CreateWindow(MAKEINTATOM(register_dummy_class()), "Test", 0, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, NULL, NULL);
	hr = OleSetMenuDescriptor(NULL, hwndFrame, NULL, NULL, NULL);
	todo_wine ok_ole_success(hr, "OleSetMenuDescriptor");

	DestroyWindow(hwndFrame);
}
Beispiel #2
0
struct gl_platform *gl_platform_create(gs_device_t *device, uint32_t adapter)
{
	struct gl_platform *plat = bzalloc(sizeof(struct gl_platform));
	struct dummy_context dummy;
	struct gs_init_data info = {0};
	int pixel_format;
	PIXELFORMATDESCRIPTOR pfd;

	memset(&dummy, 0, sizeof(struct dummy_context));
	init_dummy_swap_info(&info);

	if (!gl_dummy_context_init(&dummy))
		goto fail;
	if (!gl_init_extensions(dummy.hdc))
		goto fail;
	if (!register_dummy_class())
		return false;
	if (!create_dummy_window(plat))
		return false;

	/* you have to have a dummy context open before you can actually
	 * use wglChoosePixelFormatARB */
	if (!gl_getpixelformat(dummy.hdc, &info, &pixel_format, &pfd))
		goto fail;

	gl_dummy_context_free(&dummy);

	if (!init_default_swap(plat, device, pixel_format, &pfd))
		goto fail;

	plat->hrc = gl_init_context(plat->window.hdc);
	if (!plat->hrc)
		goto fail;

	if (!gladLoadGL()) {
		blog(LOG_ERROR, "Failed to initialize OpenGL entry functions.");
		goto fail;
	}

	UNUSED_PARAMETER(adapter);
	return plat;

fail:
	blog(LOG_ERROR, "gl_platform_create failed");
	gl_platform_destroy(plat);
	gl_dummy_context_free(&dummy);
	return NULL;
}