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)
{
}
}
The C language invokes the instance code of Direct3D, which is done through the LPVTBL field