From: Martin K. <ma...@ja...> - 2001-10-30 00:05:46
|
> Well, this is exactlly what I mean, if you link with the DX SDK Libraries, > you still get DirectDrawCreate and/or DirectDrawCreateEx as unresolved > externals, happens if you link directlly to the DLL or the LIB file too, > the only explanation I figured out for this is that those functions are > wrapers for CoCreateInstance and the dark COM side of DX. I haven't tried, so I wouldn't know. Are you using the DX8 SDK? I wonder whether it actually includes the libs for previous versions? > absolutelly no other function comes out unresolved (I am deducting There are only a couple of other functions (Enumerate and CreateClipper) - everything else is an interface method. > I have read the list, I have searched the net, and I see this "I Use > LoadLibrary and GetProcAddress" all over the place, but I havent seen an > example of using those, which is what I am asking for, I did this: Well that looks identical to what I do. Do you get this error message in this code segment, or when you create a surface or what? > if( FAILED( hr = MDirectDrawCreateEx( NULL, > (VOID**)&m_pDD,IID_IDirectDraw7, NULL ) ) ) > return ERROR; I'm assuming you're in C++ here. For C, you need &IID_IDirectDraw7. > all the other functions I linked against ddraw.lib If you're using LoadLibrary you shouldn't need to link against the lib. I don't know whether this might be causing problems. > many people have asked me how to use > DX8a with Mingw, thats why I need to know (I use DX7 myself) This is what I do for D3D8: typedef struct IDirect3D8 * WINAPI (*D3DCREATETYPE)(UINT); /* or you could: typedef FARPROC D3DCREATETYPE; */ D3DCREATETYPE d3dcreate= NULL; HINSTANCE D3DLibrary= NULL; LPDIRECT3D8 D3D= NULL; /* load the d3d8 library */ D3DLibrary= LoadLibrary("D3D8.DLL"); if (!D3DLibrary) { DoFatal("DirectX 8 not installed"); } else { /* get the d3d8 create function */ d3dcreate= (D3DCREATETYPE) GetProcAddress(D3DLibrary, "Direct3DCreate8"); if (!d3dcreate) { DoFatal("Direct3DCreate8 not found"); } else { /* create a d3d8 interface */ D3D= (*d3dcreate)(D3D_SDK_VERSION); if (!D3D) { DoFatal("couldn't create D3D interface"); } |