JavaD3D
one of Jack's Hacks
There is not currently a good solution for using Direct3D with Java.
Starting with DirectX 7.0, Microsoft includes a COM type library to allow Visual Basic to use most of DirectX 7. Since COM is a language-neutral API, this type library can be imported into a COM-aware Java IDE, such as Microsoft's J++ 6.0.
Unfortunately, J++ 6.0's COM import process is not 100% effective. Several important pieces of DirectX are not imported correctly. In particular, the DDSURFACEDESC2 structure's ddsCaps field is not imported. Instead, the following comment appears:
// UNMAPPABLE: ddsCaps: Cannot be used as a structure field.
// /** @com.structmap(UNMAPPABLE ddsCaps) */
// public UNMAPPABLE ddsCaps;
Perhaps future versions of J++ and/or DirectX will fix this problem. Or perhaps someone could write a little glue code to get around this problem. It might be possible to add a COM wrapper for the Direct3DX Utility Library.
Here are step-by-step directions to import DirectX into Microsoft Visual J++ 6.0
Install the DirectX 7.0 SDK .
Install Microsoft Visual J++ 6.0.
Start Microsoft Visual J++ 6.0.
By default, you'll get a "New Project" dialog box. If you don't, choose the menu item "File:New Project".
Make sure the "Windows Application" project type is selected. (This is the default.)
Type in your project's name, and choose Open.
You'll get a dialog box "Microsoft Language Extensions", warning you that you're using non-standard extensions to the Java language. Click "Yes".
You'll get a dialog box "Microsoft Language Extensions", explaining that this project will only work on Microsoft's JVM. Click "OK".
Choose the menu item "Project:Add COM Wrapper...".
You'll get a dialog box "COM Wrappers". Scroll down and check the checkbox next to "DirectX 7 for Visual Basic Type Library". Click OK.
After a short wait, you'll see a folder "dx7vb" in your "Project Explorer" window.
(More to come, once the DDSURFACEDESC2 problem is solved.)