How to get Direct X 8 in Dev-CPP

A forum to store posts deemed exceptionally wise and useful
stoffe
Posts: 18
Joined: Tue Jan 27, 2004 2:42 pm

How to get Direct X 8 in Dev-CPP

Post by stoffe »

The really easy and fast way:

First, in Dev-CPP, open Tools->Check for Updates/Packages and download the DirectX 9 Devpak (this contains what you need for DX8 as well).

Then, unzip the Irrlicht sources and open the Irrlicht.dev project file.

Go to Project->Project Options (ALT+P) and go to the parameters tab, and add this line:

-D_IRR_COMPILE_WITH_DIRECTX_8_=1

to Compiler and C++ compiler options, under -DIRRLICHT_EXPORTS=1 (maybe only C++ is needed, but it doesn't hurt). This tells Irrlicht to build the driver for Direct X 8.

Then, add this line to the linker options:

-ld3dx8d

This tells the linker to include the Direct X library into the DLL.

Then, go to the Directories tab, and change the library directories to:

jpeglib
zlib

- Those are local paths to the libs included in the source zip.

Change the include directory to simply:

include

- also the local path.

Now, all you should need to do is hit CTRL+F9 and go get some coffee while it builds. You will need to copy the d3dx8d.dll file to either the system dir or to the dir you are executing your programs in... I'm not sure if it is possible to build this statically, but this will have to do for now - at least we have DX support, as all the examples run just fine. :)

Now, doing this sadly means that you need the Direct X DLL no matter what driver you are building for - I was planning to include this DLL in the DevPak instead, but now I'm not so sure. Maybe I should just supply both or something, I'll have to think about it.

I couldn't get the same procedure to work for DirectX 9 no matter what I tried - it builds and links alright, but it looks for the wrong DLL (d3d9.dll I think) that I don't have. Anybody has any clues? I've only downloaded and used the DX9 DevPak, no other SDK:s or anything.
L_Draven
Posts: 21
Joined: Sun Mar 07, 2004 11:36 am

Post by L_Draven »

Thanks stoffe but when i run my code with EDT_DIRECTX8 i get this message in the msdos window:

DirectX Driver was not compiled into this dll. Try OpenGL
Error: Could not load built-in Font.

I have installed directx9 DEVPACK.
I configre the project options.
I put the d3dx8d.dll into system32 folder and in the same folder of the project.

Any idea????
Guest

Post by Guest »

Did you move your newly built DLL (in the source directory) to where you have the project?
L_Draven
Posts: 21
Joined: Sun Mar 07, 2004 11:36 am

Post by L_Draven »

I put the d3dx8d.dll and the irrlicht.dll (from new compilation of irrlicht source) into the same folder of the project .

Now the system gives me aplication has encountered an error and close it (windows error message)

I need the miscrosoft directx9 SDK or something more ????

:-(
James

Problem with compilation

Post by James »

Thanks for the instructions - my machine doesn't like OpenGL much, so DirectX would be great.

But, although dev-cpp claims to have compiled - 'Compilation successful,' but no dll is made, and looking at the compile log,

'C:\PROGRA~1\DEV-CPP\BIN\DLLWRAP.EXE: Must provide at least one of -o or --dllname options'

This seems to be despite -o IRRLICHT.dll being on the linker command:
Compiler: Default compiler
Building Makefile: "C:\IRRLIC~1.6\SOURCE\SOURCE\Makefile.win"
Executing make...
make.exe -f "C:\IRRLIC~1.6\SOURCE\SOURCE\Makefile.win" all
dllwrap.exe --output-def libIRRLICHT.def --driver-name c++ --implib libIRRLICHT.a CAnimatedMeshMD2.o CAnimatedMeshMS3D.o CAnimatedMeshSceneNode.o CBillboardSceneNode.o CBspTree.o CBspTreeSceneNode.o CCameraMayaSceneNode.o CCameraSceneNode.o CColorConverter.o CDirectX8Texture.o CFileList.o CFileSystem.o CFPSCounter.o CGUIButton.o CGUIEnvironment.o CGUIFileOpenDialog.o CGUIFont.o CGUIImage.o CGUIListBox.o CGUIMeshViewer.o CGUIScrollBar.o CGUISkin.o CGUIStaticText.o CGUIWindow.o CIrrDeviceWin32.o CLightSceneNode.o CLimitReadFile.o CMemoryReadFile.o CMeshSceneNode.o COctTreeSceneNode.o COpenGLTexture.o CQ3LevelMesh.o CReadFile.o CSceneManager.o CSceneNodeAnimatorFlyCircle.o CSceneNodeAnimatorRotation.o CSoftwareTexture.o CStaticMeshOBJ.o CTestSceneNode.o CTRFlat.o CTRFlatWire.o CTRGouraud.o CTRGouraudWire.o CTRTextureFlat.o CTRTextureFlatWire.o CTRTextureGouraud.o CTRTextureGouraudWire.o CVideoDirectX8.o CVideoNull.o CVideoOpenGL.o CVideoSoftware.o CZBuffer.o CZipReader.o Irrlicht.o os.o CCameraFPSSceneNode.o CGeometryCreator.o CSceneNodeAnimatorFlyStraight.o CSceneNodeAnimatorTexture.o CDefaultMeshFormatLoader.o CSkyBoxSceneNode.o CShadowVolumeSceneNode.o C3DSMeshFileLoader.o CSceneCollisionManager.o CIrrDeviceStub.o CParticleSystemSceneNode.o CParticleFadeOutAffector.o CParticleBoxEmitter.o CParticlePointEmitter.o CParticleGravityAffector.o CDummyTransformationSceneNode.o CGUIInOutFader.o CIrrDeviceLinux.o CMeshManipulator.o CMetaTriangleSelector.o COctTreeTriangleSelector.o CSceneNodeAnimatorCollisionResponse.o CSceneNodeAnimatorDelete.o CTriangleBBSelector.o CTriangleSelector.o CVideoModeList.o CWaterSurfaceSceneNode.o CGUIMessageBox.o CGUIModalScreen.o CEmptySceneNode.o CImage.o CImageLoaderBmp.o CImageLoaderJPG.o CImageLoaderPCX.o CImageLoaderPSD.o CImageLoaderTGA.o CLogger.o CTerrainSceneNode.o CDirectX9Texture.o CGUIContextMenu.o CGUIEditBox.o CGUIMenu.o CGUITabControl.o COSOperator.o CSceneNodeAnimatorFollowSpline.o CVideoDirectX9.o CXAnimationPlayer.o CXFileReader.o CXMeshFileLoader.o CTextReader.o CXMLReader.o CWriteFile.o CGUIComboBox.o CGUIToolBar.o CXMLWriter.o CGUICheckBox.o IRRLICHT_private.res -L"C:/PROGRAM FILES/DEV-CPP/lib" -L"C:/irrlicht-0.6/source/source/jpeglib" -L"C:/irrlicht-0.6/source/source/zlib" --no-export-all-symbols --add-stdcall-alias -lgdi32 -lglu32 -lopengl32 -ljpeg -lz -ld3dx8d -o IRRLICHT.dll
Any suggestions as to what is going on, and how to fix it. Alternatively, is there a dll for dev-cpp with DirectX 8 already compiled in?

Yours

James Packer
darkraven
Posts: 29
Joined: Sat Mar 06, 2004 5:54 am
Location: Florida
Contact:

Post by darkraven »

First I'd like to thank stoffe for the instructions. It has been driving me nuts trying to find of a way to use directx under dev c++.

I do have a question that someone may possibly be able to help on. I'm trying to get directx9 to work with dev c++. I've got the devpack for dx9 and I've also tried by creating my own libs with the sdk files but for some reason irrlicht can't create the mip map levels from anything I compile from here so I was just wondering if anyone knew how to resolve this problem or know of a way to link directx9 using something like these instructions that stoffe posted? I tried do it with these instruction and directx9 will work with out causing those file needs to shut down errors but none of the mip map levels are being created.
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

I can't seem to get the Devpack from the updater. When I select it to download I get an erro that says vUpdate.servebeer.com/DirectX9.Devpack does not exist. Any ideas? Maybe the site is just downright now.
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Never mind, sorry about that. Other Devpacks don't seem to download either so nothing wrong with that particular one. Sorry for taking up space here.
gonzo

Post by gonzo »

Hi!
Thanks for the nice tut!

I followed all steps but when compiling I get the following error:

\DevCpp\Bin\..\lib\gcc-lib\mingw32\3.2\..\..\..\..\mingw32\bin\ld.exe F:\Programming\irrlicht-0.6\source\D
cannot find -ljpeg

I hope this isn´t sounding to stupid, I´m just starting with Dev-C++ and I don´t have a clue what all the linker options do ... any help with this is really appreciated!

Cheers!
gonzo

Post by gonzo »

Ah, nevwer mind, I found out why I didn´t work! Sorry for wasting space! Delete both posts so ...
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Thanks very much Stoffe. I've got DirectX support for my Irrlicht projects compiled with Dev-cpp
by the way, the d3d9 dll is included in the Devpack (at least what I downloaded.) However, Using DirectX 9 in the Techdemo compiled with Dev-cpp and using a dll modified to support DirectX9 thru d3d9.dd gave me rather fuzzy rendering. OpenGl and DirectX 8 gave much better results
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Thanks very much Stoffe. I've got DirectX support for my Irrlicht projects compiled with Dev-cpp
by the way, the d3d9 dll is included in the Devpack (at least what I downloaded.) However, Using DirectX 9 in the Techdemo compiled with Dev-cpp and using a dll modified to support DirectX9 thru d3d9.dd gave me rather fuzzy rendering. OpenGl and DirectX 8 gave much better results
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

Thanks very much Stoffe. I've got DirectX support for my Irrlicht projects compiled with Dev-cpp
by the way, the d3d9 dll is included in the Devpack (at least what I downloaded.) However, Using DirectX 9 in the Techdemo compiled with Dev-cpp and using a dll modified to support DirectX9 thru d3d9.dd gave me rather fuzzy rendering. OpenGl and DirectX 8 gave much better results
alexem
Posts: 35
Joined: Sun Feb 29, 2004 4:55 pm

Post by alexem »

Can you just upload the .dll I followed the instruction but my WindowsXP give me error
Yours sencerely,
Alexander Milanoff
Electron
Posts: 874
Joined: Sun Mar 14, 2004 12:05 am
Location: Massachusetts USA

Post by Electron »

precisely what error are you getting? Have you recompiled the Irrlicht dll, making sure that D_IRR_COMPILE_WITH_DIRECTX_8_ and D_IRR_COMPILE_WITH_DIRECTX_9_ are defined?
Post Reply