FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Maybe wrong code in win32\d3d9.d

 
Post new topic   Reply to topic     Forum Index -> Bindings
View previous topic :: View next topic  
Author Message
timfang



Joined: 06 Jan 2007
Posts: 2

PostPosted: Fri Jan 12, 2007 3:41 am    Post subject: Maybe wrong code in win32\d3d9.d Reply with quote

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
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Tue Mar 13, 2007 12:02 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Bindings All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group