Jump to page: 1 2
Thread overview
direct3d9 lib frustrations
Re: direct3d9 lib frustrations - ATTACHMENT
Aug 11, 2004
k2
Aug 11, 2004
Mike Parker
Aug 11, 2004
J C Calvarese
Re: direct3d9 lib frustrations -WOOOOOOOO
Aug 11, 2004
Lars Ivar Igesund
Aug 11, 2004
k2
August 11, 2004
i'd first like to thank Ilya Minkov for all the help she (he?) has given me through email :)

attached is a simple program that i'm trying to write.  i'm using the d3d9 header file from mr. tomino's page (http://hp.vector.co.jp/authors/VA031566/d_direct3d9/).

here's the problem.  these headers load the d3d9.dll as a dynamic lib and load the functions out of it.  this has two problems.  one, it's kind of awkward, and forgetting to load a function results in an access violation.  i'd like to be able to just directly use the directx libraries.  two, it limits me to using basic d3d functionality, and i can't use any of the cool stuff like the HLSL compiler in the d3d extensions library, which is provided only as a static lib with the DX SDK.

well i haven't gotten very far.  i took the original COFF d3d9.lib (i included it in this zipfile) and ran the microsoft LIB /CONVERT on it to convert it to the older style COFF, then ran it through the old coff2omf provided on the digitalmars FTP server.  it made an OMF lib alright (d3d99.lib in this archive), and it links alright, but every time i try to call the Direct3DCreate9() function, i get an access violation.

i've tried every combination of tools and linkers and i'm really getting frustrated.  i can't get this to work when it seems like it would be so simple.

would anyone like to take a shot at it :P

contained in the archive:

all lib files - can go in the dmd\lib folder
the win32 folder - goes in the dmd\src\phobos folder
the bat and other d files and the def file - my "project" :P

August 11, 2004
oooookay forgot the attachment.

August 11, 2004
When you use .lib, change as follows:

//extern (Windows) IDirect3D9 function (UINT SDKVersion) Direct3DCreate9;
extern(Windows) export IDirect3D9 Direct3DCreate9(UINT SDKVersion);


August 11, 2004
k2 wrote:
> When you use .lib, change as follows:
> 
> //extern (Windows) IDirect3D9 function (UINT SDKVersion) Direct3DCreate9;
> extern(Windows) export IDirect3D9 Direct3DCreate9(UINT SDKVersion);
> 
> 
That doesn't help him in this case. The D3D dll is being loaded explicitly, not through an import library. His problem is with D3DX, which is a /static/ library. And to the best of my knowledge there's no way it's going to work.
August 11, 2004
> > //extern (Windows) IDirect3D9 function (UINT SDKVersion)
Direct3DCreate9;
> > extern(Windows) export IDirect3D9 Direct3DCreate9(UINT SDKVersion);

*bangs head on desk* of course.  defining a function pointer isn't going to work :P  thanks for that.  unfortunately it still won't work.

> That doesn't help him in this case. The D3D dll is being loaded explicitly, not through an import library.

no, i'm trying to load it with an import library.

> His problem is with D3DX,
> which is a /static/ library. And to the best of my knowledge there's no
> way it's going to work.

why not?


August 11, 2004
oh thank you k2 :)  ignore my last post about it not working.  i forgot to change something in my bat file :P  it works now!  only problem is, now i get a switch error on a switch.  i think it might have something to do with using an enum as the parameter.

it WORKS!  :D


August 11, 2004
Jarrett Billingsley wrote:
> oh thank you k2 :)  ignore my last post about it not working.  i forgot to
> change something in my bat file :P  it works now!  only problem is, now i
> get a switch error on a switch.  i think it might have something to do with
> using an enum as the parameter.
> 
> it WORKS!  :D
> 
> 

Or you haven't handled the default case correctly. (You need a break or something.)

Lars Ivar Igesund
August 11, 2004
As Lars Ivar Igesund has said, a default is not in switch. You have to add a default break to WinProc of d3dtest.d.


August 11, 2004
In article <cfd6up$p1p$1@digitaldaemon.com>, Jarrett Billingsley says...
>> His problem is with D3DX,
>> which is a /static/ library. And to the best of my knowledge there's no
>> way it's going to work.
>
>why not?

Apparently, the static library for D3DX only works with Microsoft's compiler.

I've read that the Borland users found a way to create a .lib for the Borland compiler, so I'm optimistic that something similar can be done for the Digital Mars compilers.

If you want more information on the issue, read this: http://www.dsource.org/forums/viewtopic.php?t=288

jcc7
August 11, 2004
that was it.  thanks.


« First   ‹ Prev
1 2