Advertisement

Direct3D IM Problems

Started by February 24, 2000 09:03 PM
2 comments, last by ReturnZero 24 years, 6 months ago
Hello. I am having problems with D3D IM initializing. I can create the Direct3D object with no problem, and it returns ok. Here is the code for that: hret = lpdd->QueryInterface( IID_IDirect3D7, (VOID**)&lpD3D ); And that is ok, however, what I do next is try to get the D3D Device Object, and I get an error. Here is the code for that hret = lpD3D->CreateDevice( IID_IDirect3DRGBDevice, lpsurfbac, &pd3dDevice ); I get an HRESULT of DDERR_GENERIC return value and it just stops and quits the program. I dont know what is wrong becuz the SDK just says its " Unspecified Error " or something along those lines, and it does not help. This is a full screen help, so it makes Debugging fun. The only thing that I do is write to a file, which I do with fstream. anyhow, I have been working on this for a while, and no one has been able to help, and I was told to post it here, so I am praying that this will help. Please, any help would be greatly apprecitated. Thanx ReturnZero
It''s difficult to say whats going wrong, but i''m almost 100% certain it''s caused from something before either of those statements. Do you have your surfaces set up and did you set the DDSCAPS_3DDEVICE cap? It would be helpful if you posted the rest of the function, since it''s sort of hard to tell from two calls .

--TheGoop
Advertisement
Well, I dont want to make this a massive size message, but I will post some more code.
This is the code that I use to obtain my primary surface:
ddsd.dwSize = sizeof(ddsd);
ddsd.dwFlags = DDSD_CAPS / DDSD_BACKBUFFERCOUNT;
ddsd.ddsCaps.dwCaps = DDSCAPS_PRIMARYSURFACE
/ DDSCAPS_FLIP / DDSCAPS_COMPLEX
/ DDSCAPS_3DDEVICE;
ddsd.dwBackBufferCount = 1;
hret = lpdd->CreateSurface(&ddsd, &lpsurfpri, NULL);


and this is what I have for the back buffer
ddscaps.dwCaps = DDSCAPS_BACKBUFFER;
hret = lpsurfpri->GetAttachedSurface(&ddscaps, &lpsurfbac);


I also set the clipper, and Palette to the surface before I get to D3D. How can I check if the pointer objects are valid ? I use the macro FAILED and thats about it when I make any objects. is there a way that I can test to see if it is some trash value ? Let me know if you need anything else
You mentioned setting the pallete. As far as I know, the newer versions of D3D don't support palletized modes. You must use 16Bit or higher. (I think)

--TheGoop

Edited by - TheGoop on 2/25/00 7:14:35 PM

This topic is closed to new replies.

Advertisement