m_pDirect3D9 = Direct3DCreate9(D3D_SDK_VERSION);
int w = 1920;
int h = 1080;
D3DPRESENT_PARAMETERS d3dpp;
ZeroMemory(&d3dpp, sizeof(d3dpp));
d3dpp.BackBufferWidth = w;
d3dpp.BackBufferHeight = h;
d3dpp.BackBufferFormat = D3DFMT_UNKNOWN;
d3dpp.BackBufferCount = 1;
d3dpp.MultiSampleType = D3DMULTISAMPLE_NONE;
d3dpp.SwapEffect = D3DSWAPEFFECT_COPY;
d3dpp.hDeviceWindow = NULL;
d3dpp.Windowed = TRUE;
d3dpp.EnableAutoDepthStencil = FALSE;
d3dpp.Flags = D3DPRESENTFLAG_VIDEO;
d3dpp.PresentationInterval = D3DPRESENT_INTERVAL_DEFAULT;
LRESULT result = m_pDirect3D9->lpVtbl->CreateDevice(m_pDirect3D9, D3DADAPTER_DEFAULT, D3DDEVTYPE_HAL, NULL, D3DCREATE_SOFTWARE_VERTEXPROCESSING | D3DCREATE_MULTITHREADED, &d3dpp, &m_pDirect3DDevice);
if (SUCCEEDED(result))
{
result = m_pDirect3DDevice->lpVtbl->CreateTexture(m_pDirect3DDevice, w, h, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &managedTexture, gc->shtex_data->tex_handle);
if (result)
{
}
}