I'm trying to integrate the new Oculus SDK (for the DK2) into Game Maker Studio. I'm doing this by creating a DLL that communicates with GM and with the new SDK. I've come to a point where i just don't know what to do anymore.

Currently, i can get the oculus to turn on, and see the Health notice displayed in the oculus. The health display also seems to get drawn over the GM application window - after which the GM application draws itself over the window again - its like 2 applications are drawing in the same window.

The problem is, i need the application display to be fed into the DLL, parsed through there (to add distortion and some filters for the lenses of the oculus), and then spit it out into the Oculus device. The GM surface and oculus surface have to be combined and put in the oculus device.

I have 2 types of pointers availble - 1 for the HWND of the application (used here), and 1 DX Device pointer (i think, its used like so:

LPDIRECT3DDEVICE9 d3ddev; GMEXPORT double LinkD3D( long POINTER ){ d3ddev = (LPDIRECT3DDEVICE9)POINTER; // Enable 8x Anisotropic Filtering d3ddev->SetSamplerState(0, D3DSAMP_MAXANISOTROPY, 8); d3ddev->SetSamplerState(0, D3DSAMP_MINFILTER, D3DTEXF_ANISOTROPIC); // Enable Linear Filtering d3ddev->SetSamplerState(0, D3DSAMP_MAGFILTER, D3DTEXF_LINEAR); d3ddev->SetSamplerState(0, D3DSAMP_MIPFILTER, D3DTEXF_LINEAR); return 1; }

Now i wonder, how can i get that LPDIRECT3DDEVICE9 into the DX11 stuff of the oculus SDK.

Currently i get the healthwarning to get drawn over the existing window.

I was thinking, maybe i need the internal texture (used above, d3ddev), and put it in the Ouculus pRender device, somewhere around here; https://github.com/RobQuistNL/GMOculus/blob/master/DLL/GMOculus/GMOculus/main.cpp#L223

The source code of the project is found here; https://github.com/RobQuistNL/GMOculus/blob/master/DLL/GMOculus/GMOculus/main.cpp

I'm very sorry for the vague explaination, but please keep in mind that;

Im actually a webdeveloper

I use game maker for hobby games

Know somewhat C++

Have 0 experience with DX

I'm actually happy i can already get thehealth notice to draw on the oculus.

Its just that i can't seem to convert anything. I've tried textures, swapchains, render devices - but i keep getting errors. Am i looking in the wrong direction?

I am even willing to pay if someone can help me out.

Cheers, Rob