Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

rroach

Direct3D Interface Problem

This topic is 6938 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I have run into an error and was hoping someone would have some insight. Basically, I create a direct draw object and then attempt to create the d3d device. When I try to create the d3d device, I get a linker error that states that ddraw does not recognize the given interface. But I think the problem is arising in the call creating the direct 3d device. The pointer is still set to null(0) when the call returns. I am at work so I don''t remeber exactly what I wrote but it is basically directdraw7->QueryInterface(IID_IDirect3DDevice, &d3dPointer) where d3d pointer is an LPDIRECT3DDEVICE (I think). I have not tried to trash the INITGUID and link with the dxgiud.lib but this should be equivalent, as far as I know.

Share this post


Link to post
Share on other sites
Advertisement
your problem is that u try to create the d3d device before u create the d3d object to create d3d object do that:

LPDIRECT3D7 D3DObj = NULL;
hRet = DDrawObj->QueryInterface(IID_IDirect3D7, (void **)&D3DObj);

and then create the d3d device:

LPDIRECT3DDEVICE7 D3DDevice = NULL;
hRet = D3DObj->CreateDevice(IID_IDirect3DHALDevice, RenderSurface, &D3DDevice);


Share this post


Link to post
Share on other sites
very important:
before u create the d3d device u need to create the primary surface and the render surface, the render surface is ddraw surface that u do ot it all the render stuff...

Share this post


Link to post
Share on other sites
In response:

LPDIRECT3D7 D3DObj = NULL;
hRet = DDrawObj->QueryInterface(IID_IDirect3D7, (void **)&D3DObj);

This is what I am doing. I am not looking at the code now so I got it backwards. It is in the QueryInterface call that the problem is. When this call returns the pointer D3DObj is still null(0, so basically it is never being assigned. So when the next call is made, of course I get an exception that kills the program. Problem is I cannot figure out why this is happening.

Share this post


Link to post
Share on other sites
can u post the orginal code here?
so i can check it??
it will very help.

thanks

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!