how do i enable directx?
-
i downloaded and installed the directx sdk. how do i use it in my project? the microsoft.directx namespace isn't available and i can't figure out to add a refernce to it. what am i missing? thanks
You should start by opening some samples and playing with them... If everything is installed right, you should just be able to click Project->Add Reference, and they should be under the .NET tab. The dlls are in C:\WINDOWS\Microsoft.NET\Managed DirectX if you need to do a direct reference
-
i downloaded and installed the directx sdk. how do i use it in my project? the microsoft.directx namespace isn't available and i can't figure out to add a refernce to it. what am i missing? thanks
Did you install the Summer 2003 update or an older one? They all install a little differently. For starters, the Microsoft.DirectX namespaces aren't available until the assembly that declares them is referenced. To reference these, first try installing the managed extensions (one one of the installations, these weren't installed while installing the SDK - don't remember which, though) from DXSDKDIR\Developer Runtime\Managed DirectX then from either the Debug or Retail directory. Start VS.NET and you should see the DirectX managed assemblies in the list now. If you don't, find the location of the installed libraries (like %WINDIR%\Microsoft.NET\Managed DirectX\v9.00.1126) and add the path to the HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\AssemblyFolders registry key using regedit.exe. I've installed three or four different versions / updates since the first managed assemblies were released over a short period of time to, unfortunately, I can't remember how they all behaved during installation. The directions above should do the trick, though.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Did you install the Summer 2003 update or an older one? They all install a little differently. For starters, the Microsoft.DirectX namespaces aren't available until the assembly that declares them is referenced. To reference these, first try installing the managed extensions (one one of the installations, these weren't installed while installing the SDK - don't remember which, though) from DXSDKDIR\Developer Runtime\Managed DirectX then from either the Debug or Retail directory. Start VS.NET and you should see the DirectX managed assemblies in the list now. If you don't, find the location of the installed libraries (like %WINDIR%\Microsoft.NET\Managed DirectX\v9.00.1126) and add the path to the HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\AssemblyFolders registry key using regedit.exe. I've installed three or four different versions / updates since the first managed assemblies were released over a short period of time to, unfortunately, I can't remember how they all behaved during installation. The directions above should do the trick, though.
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
i installed the summer 2003 update. i see the dlls in C:\WINNT\Microsoft.NET\Managed DirectX\v9.00.1126. i followed your directions, but i'm not sure if it worked. when i try and add a reference, i don't see any directx dll's on the .net tab. on the com tab, i see things like direct 1.0 type library, directx 8 for visual basic type library, among others. do i use one of these? i tried a few of them, but nothing seemed to work. thanks for your help.
-
i installed the summer 2003 update. i see the dlls in C:\WINNT\Microsoft.NET\Managed DirectX\v9.00.1126. i followed your directions, but i'm not sure if it worked. when i try and add a reference, i don't see any directx dll's on the .net tab. on the com tab, i see things like direct 1.0 type library, directx 8 for visual basic type library, among others. do i use one of these? i tried a few of them, but nothing seemed to work. thanks for your help.
Did you start/restart VS.NET? Once you add that registry key like the others you should've seen in there, VS.NET won't pick them up again if you've already opened the Add Reference dialog once before. You have to restart for the change to take effect. I wouldn't recommend using the COM interface. Developers were doing that before DirectX 9 introduced the managed assemblies and it was always a pain. There are several articles here on CP that dealt with those cases (or encapsulated the native functions). If you're still having trouble after trying all this, go to http://msdn.microsoft.com/directx[^] and check out any support articles that seem relevant. This should all work, though. I had to do it once after installing one of the versions (DirectX 9.0, then a, then b, then Summer 2003 update) and everything has worked fine after that. Now if I could only find a good DirectX development book because I have a passive interest in games development (just curiousity, mostly).
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
-
Did you start/restart VS.NET? Once you add that registry key like the others you should've seen in there, VS.NET won't pick them up again if you've already opened the Add Reference dialog once before. You have to restart for the change to take effect. I wouldn't recommend using the COM interface. Developers were doing that before DirectX 9 introduced the managed assemblies and it was always a pain. There are several articles here on CP that dealt with those cases (or encapsulated the native functions). If you're still having trouble after trying all this, go to http://msdn.microsoft.com/directx[^] and check out any support articles that seem relevant. This should all work, though. I had to do it once after installing one of the versions (DirectX 9.0, then a, then b, then Summer 2003 update) and everything has worked fine after that. Now if I could only find a good DirectX development book because I have a passive interest in games development (just curiousity, mostly).
-----BEGIN GEEK CODE BLOCK----- Version: 3.21 GCS/G/MU d- s: a- C++++ UL@ P++(+++) L+(--) E--- W+++ N++ o+ K? w++++ O- M(+) V? PS-- PE Y++ PGP++ t++@ 5 X+++ R+@ tv+ b(-)>b++ DI++++ D+ G e++>+++ h---* r+++ y+++ -----END GEEK CODE BLOCK-----
.NET Game Programming with DirectX 9, Alexandre Lobao. APress. Managed DirectX 9 Graphics and Game Programming, SAMS. Lobao's book was "panned" by lots of reviewers, and i have to admit i didn't build the projects (actually i hardly parse vb) but to me it seems like a great overview of how stuff is actually written (there are lots of technical books on 3d, kinematics etc for further reading if you get interested).