View previous topic :: View next topic |
Author |
Message |
timfang
Joined: 06 Jan 2007 Posts: 2
|
Posted: Fri Jan 12, 2007 3:41 am Post subject: Maybe wrong code in win32\d3d9.d |
|
|
At the last line of d3d9.d:
extern (Windows) IDirect3D9* Direct3DCreate9(UINT SDKVersion);
I can't get it work. If change to:
extern (Windows) IDirect3D9 Direct3DCreate9(UINT SDKVersion);
It will work properly.
Test code:
import win32.d3d9;
import win32.d3d9types;
import std.stdio;
pragma (lib, "d3d9.lib");
void main()
{
IDirect3D9 d3d9 = Direct3DCreate9(D3D_SDK_VERSION);
uint numAdapter = d3d9.GetAdapterCount();
writefln(numAdapter);
D3DADAPTER_IDENTIFIER9 adapterID;
d3d9.GetAdapterIdentifier(0,0,&adapterID);
writefln(adapterID.Driver);
writefln(adapterID.Description);
writefln(adapterID.DeviceName);
} |
|
Back to top |
|
|
doob
Joined: 06 Jan 2007 Posts: 367
|
Posted: Tue Mar 13, 2007 12:02 pm Post subject: |
|
|
I can confirm that and I don't think that is the only place in the code where it's wrong. What I've read and understood is that interfaces in D is always references and not pointers, so everywhere where it's an interface and a pointer (IName*) it should be just the name (IName) and where it's a pointer to a pointer (IName**) it should be just a pointer (IName*). The only interfaces I've checked with are IDirect3DDevice9 and IDirect3D9.
It would be great if someone could, I don't know, look in to this or confirm and then change/update the necessary files in the svn. |
|
Back to top |
|
|
|