<html><div style='background-color:'><DIV>
<P>Here is the problem - I'm using the tutorial here ( <A href="http://www.wksoftware.com/publications/d3dim.html">http://www.wksoftware.com/publications/d3dim.html</A> ) to create a 3D triangle that spins. The problem I have is this... I am getting errors that tell me that "struct IDirect3D has no member named lpVtbl". I am 100% sure this is because in C++ you pass a REFERENCE to a GUID to IDirectDraw::QueryInterface. For example:</P>
<P>C code:</P><PRE>// pass address of IID_IDirect3D to QueryInterface
lpDD->lpVtbl->QueryInterface( lpDD, &IID_IDirect3D, ( LPVOID * ) &lpD3D );
</PRE>
<P>Whereas in C++ you must have code like this: <PRE>// pass reference to IID_IDirect3D
lpDD->QueryInterface( IID_IDirect3D, ( LPVOID * ) &lpD3D ) ;
</PRE>
<P>Below are the troublemakers - HOW DO I FIX THEM?</P>
<P> </P>
<P>Failing that has anybody wrote a tutorial about putting 3D images on screen in C++ that works on Dev-C++ ?</P>
<P><BR><BR>hRes = lpdd->lpVtbl->SetCooperativeLevel(lpdd, hwnd, DDSCL_NORMAL);</P>
<P>hRes = lpdd->lpVtbl->QueryInterface(lpdd, &IID_IDirect3D, &lpd3d);</P>
<P>lpd3d->lpVtbl->Release(lpd3d);</P>
<P>lpdd->lpVtbl->Release(lpdd);</P>
<P>hRes = lpdd->lpVtbl->CreateSurface(lpdd, &ddsd, &lpddPrimary, NULL);</P>
<P>hRes = lpddClipper->lpVtbl->SetHWnd(lpddClipper, 0UL, hwnd);</P>
<P>lpddClipper->lpVtbl->Release(lpddClipper);</P>
<P>hRes = lpddPrimary->lpVtbl->SetClipper(lpddPrimary, lpddClipper);</P>
<P>lpddClipper->lpVtbl->Release(lpddClipper);</P>
<P>lpddClipper->lpVtbl->Release(lpddClipper);</P>
<P>hRes = lpddPrimary->lpVtbl->GetSurfaceDesc(lpddPrimary, &ddsd);</P>
<P>hRes = lpdd->lpVtbl->CreatePalette(lpdd,<BR> DDPCAPS_8BIT,<BR> peColorTable,<BR> &lpddPalette,<BR> NULL);</P>
<P>hRes = lpddPrimary->lpVtbl->SetPalette(lpddPrimary, lpddPalette);</P>
<P>return lpddPrimary->lpVtbl->Restore(lpddPrimary);</P>
<P>lpddPalette->lpVtbl->Release(lpddPalette);</P>
<P>lpddPrimary->lpVtbl->Release(lpddPrimary);</P>
<P>hRes = lpddPrimary->lpVtbl->GetSurfaceDesc(lpddPrimary, &ddsd);</P>
<P>hRes = lpd3d->lpVtbl->EnumDevices(lpd3d, EnumDeviceCallback, &fDeviceFound);</P>
<P>hRes = lpdd->lpVtbl->CreateSurface(lpdd, &ddsd, &lpddDevice, NULL);</P>
<P>hRes = lpdd->lpVtbl->CreateSurface(lpdd, &ddsd, &lpddZBuffer, NULL);</P>
<P>hRes = lpddDevice->lpVtbl->AddAttachedSurface(lpddDevice, lpddZBuffer);</P>
<P>hRes = lpddDevice->lpVtbl->QueryInterface(lpddDevice,<BR> &guidDevice,<BR> &lpd3dDevice);</P>
<P>hRes = lpddZBuffer->lpVtbl->Restore(lpddZBuffer);</P>
<P>hRes = lpddDevice->lpVtbl->Restore(lpddDevice);</P>
<P>lpd3dDevice->lpVtbl->Release(lpd3dDevice);</P>
<P>lpddZBuffer->lpVtbl->Release(lpddZBuffer);</P>
<P>lpddDevice->lpVtbl->Release(lpddDevice);</P>
<P>hRes = lpd3dExecuteBuffer->lpVtbl->Lock(lpd3dExecuteBuffer, &d3dExeBufDesc);</P>
<P>lpd3dExecuteBuffer->lpVtbl->Unlock(lpd3dExecuteBuffer);</P>
<P>hRes = lpd3d->lpVtbl->CreateLight(lpd3d, &lpd3dLight, NULL);</P></DIV></div><br clear=all><hr>Get your FREE download of MSN Explorer at <a href='http://go.msn.com/bql/hmtag_itl_EN.asp'>http://explorer.msn.com</a><br></html>
|