Incompatible pointers

I'm getting the following error:

Argument of ID3D11DeviceContext * is incompatible with the parameter of type ID3D11DeviceContext **


In this line:

1
2
if(FAILED(D3D11CreateDeviceAndSwapChain(NULL,  D3D_DRIVER_TYPE_HARDWARE, NULL, 0, featurelevels, numfeaturelevels, D3D11_SDK_VERSION, &sd, &g_Swapchain, &g_Device, NULL, g_Devicecontext)))
		return false;
The last parameter must be of type ID3D11DeviceContext ** and you passed ID3D11DeviceContext *. Try
1
2
if(FAILED(D3D11CreateDeviceAndSwapChain(NULL,  D3D_DRIVER_TYPE_HARDWARE, NULL, 0, featurelevels, numfeaturelevels, D3D11_SDK_VERSION, &sd, &g_Swapchain, &g_Device, NULL, &g_Devicecontext)))
		return false;

The ampersandd (&) means that you pass the adress of the variable and not variable itself
Topic archived. No new replies allowed.