3d engine can't be initialized x64 DirectX 10 Engine3D.dll

Everything related to 3D programming
Al_the_dutch
User
User
Posts: 70
Joined: Mon Nov 11, 2013 11:07 am
Location: Portugal

3d engine can't be initialized x64 DirectX 10 Engine3D.dll

Post by Al_the_dutch »

Documentation says: Note: If you use the 3D engine of PureBasic in your projects and you intent to distribute your executable, you will have to copy the Engine3D.dll from the PureBasic/Compilers directory to your main project directory.

I wanted to use some 3D effects and on my development PC (Win 7 x86) and test it on other PC's so I made an exe and it did work fine on my PC after I copied de Engine3D.dll that came with PureBasic 5.2 (2.670.592 dating from 17-09-2013). Then I tried it on another PC (Win 7, x64). That gave me the error "3d engine can't be initialized".

So I searched the forum and discovered that one needs another Engine3D.dll for x64, yak :? . I seemed to have to download it from http://www.vdata.dk.(Shouldn't both the x86 and the x64 version be distributed with all PureBasic installations or even better :idea: , being downloadable in a seperated option?) I got an Engine3D.dll from a ogre_frontend_x64 that's from 5-11-2012 (?!) and has 13.230.080 bytes! After copying that dll onto the Win 7 x64 pc, it still gave me the same error. DirectX is present (vs 10) so that is not the problem (I think).

Of course I can download the x64 version of the PureBasic installation and try that dll, but it will not install on my x86 PC so that is not an option. And installing PureBasic x64 on the test PC with x64, sorry, thats also no option in my opinion.

1. What am I doing wrong? Do I need another x64 dll?
2. And if I try my exe on a Mac OSX or Linux, will I need yet another dll?

Thx in advance!
Al
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Samuel »

Al_the_dutch wrote: Of course I can download the x64 version of the PureBasic installation and try that dll, but it will not install on my x86 PC so that is not an option. And installing PureBasic x64 on the test PC with x64, sorry, thats also no option in my opinion.
A x86 executable will run on a x64 bit operating system, but a x64 won't run on a x86 system. So, it should be fine if you just want to stick with the x86.
The reason it didn't work for you was most likely because your (Win 7 x64 machine) lacked the proper version of directX.
You need to have DirectX9.0c on that computer.
Here's the link if you want it.
http://www.microsoft.com/en-us/download ... aspx?id=35
I think Purebasic 5.2 and up now has the required DirectX dll included with it. So, if you don't want to download it you can grab it from there.


So, check to make sure the computer has the proper version DirectX on it.
Then make sure the 3D engine.dll is the one that came with Purebasic. Don't use any other because it will give you an error.
Also make sure the engine is accessible by the executable.
If you put the engine in the same directory as the exe and you have DirectX9.0c on the computer then it should run.

Al_the_dutch wrote: And if I try my exe on a Mac OSX or Linux, will I need yet another dll?
An executable created for Windows won't run on Mac or Linux. For example to create a exe for Mac. You need to get a Mac computer and
install the proper version of Purebasic on it. Then using that you can compile your code to an executable that Mac computers will understand.

Hope this helped a little. Just ask if you need better clarification.
Al_the_dutch
User
User
Posts: 70
Joined: Mon Nov 11, 2013 11:07 am
Location: Portugal

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Al_the_dutch »

Thx for your help. It seems a bit odd to me that I should install DirectX 9.0c on a PC that already has DirectX 10 on it. And that the exe worked fine with my X86 PC with DirectX 11 without 9.0c. But I tried it on the X64 PC with your link and it did not make any difference :? :cry: . Dxdiag now reports version 11 (not DirectX9.0c, I did not have a choice what version of DirectX to install) the same as on my X86 PC so I think Microsoft updates to the most recent DirectX and it is supposed to be backwards compatible.

I still think that my x64 version of Engine3.dll is no good as it is out of date and not supplied with PureBasic x86 but from another site. Are you saying that the Engine3.dll x86 version that came with PureBasic x86 is the proper dll to use with the 32 bit exe :?: Might very well be, but it gave the same error and that was the reason I searched for a solution on the forum. Perhaps my conclusion that I should have a x64 version on a x64 PC (but with a 32 bit exe) is wrong.
So, check to make sure the computer has the proper version DirectX on it.
Then make sure the 3D engine.dll is the one that came with Purebasic. Don't use any other because it will give you an error.
Also make sure the engine is accessible by the executable.
If you put the engine in the same directory as the exe and you have DirectX9.0c on the computer then it should run.
To me it seems the proper DirectX version, although it is version 11, it was version 10. I did not have a choice for 9.0c.
The engine3.dll (x86) gave the same error as the x64 version from the vdata site and I agree, that is not the way it should be but there seemed no better alternative.
The engine3.dll was copied in the same directory as the exe already.

Questions:
- Do you really need an older version of DirextX to work with 3D on the x64 PC while not being necessary on the x86 PC
- If so, how can it be obtained?
- If not, what is a possible reason of the error as both dll's produce the error on the x64 PC?
- What is the correct dll to use with the x86 exe on the x64 pc?

Al
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by IdeasVacuum »

And that the exe worked fine with my X86 PC with DirectX 11 without 9.0c.
9.0c will be on that PC, but the DX app will only tell you about the latest version. You can have several versions of DirectX on the same machine. For now, I suggest you compile your app as 32bit. That will run absolutely fine on x64 machines.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Al_the_dutch
User
User
Posts: 70
Joined: Mon Nov 11, 2013 11:07 am
Location: Portugal

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Al_the_dutch »

9.0c will be on that PC, but the DX app will only tell you about the latest version. You can have several versions of DirectX on the same machine. For now, I suggest you compile your app as 32bit. That will run absolutely fine on x64 machines.
Ok that explains the 9.0c part but it is 32 bit already and it does absolutely not run fine on x64, giving the error in the subject.
Fred
Administrator
Administrator
Posts: 18384
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Fred »

Could you post your Ogre.log file ? (add #PB_Engine3D_DebugLog to InitEngine3D())
Al_the_dutch
User
User
Posts: 70
Joined: Mon Nov 11, 2013 11:07 am
Location: Portugal

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Al_the_dutch »

Ah, that works fine!

The problem seems to be related not to x64 but to a missing jpg file:
OGRE EXCEPTION(6:FileNotFoundException): Cannot locate resource lensflare5.jpg in resource group General or any other group. in ResourceGroupManager::openResource at OgreResourceGroupManager.cpp (line 756)

Code: Select all

If InitEngine3D(#PB_Engine3D_DebugLog) ; #PB_Engine3D_DebugLog zorgt voor ogre.log
  
  Add3DArchive("Data/Textures", #PB_3DArchive_FileSystem)
  Add3DArchive("Data/fonts", #PB_3DArchive_FileSystem)
  Parse3DScripts()
  
  InitSprite()
  InitKeyboard()
  InitMouse()
  Alg::MyMsgBox ("Druk op escape", "ESCAPE!", 0)
  
  If Screen3DRequester(#True)
     
    AddWindowTimer (#WINDOW_Screen3DRequester, 998 , 10000) ; 10.000 ms druk gedoe op scherm
    CreateCube(0, 2) ; maak een dobbelsteen
    
    CreateMaterial(0, LoadTexture(0, "lensflare5.jpg")) ; caisse.png ; flare
I have put the exe with the dll in another folder (TESTEXE) on the x86 PC and it comes with the same problem. When I add a Data\Textures folder to the TESTEXE folder with the jpg file the last line of the log changes in:
Texture: lensflare5.jpg: Loading 1 faces(PF_R8G8B8,128x128x1) Internal format is PF_X8R8G8B8,128x128x1.
But the exe crashes after that and it the last line in the log. And I solved that, it needs also the fonts folder in the Data folder.

Now working on both the x86 and the x64 PC!!

Hmm :? Is there a way to be warned that you should deliver such files with the exe?

Thx so much,
Al
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by electrochrisso »

It is much better to use OpenGL, instead of DirectX, this makes it easier when people run the final product, no need for them to piss around installing DirectX9c, just to run a little bit of 3D. :)
PureBasic! Purely the best 8)
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Samuel »

electrochrisso wrote:It is much better to use OpenGL, instead of DirectX, this makes it easier when people run the final product, no need for them to piss around installing DirectX9c, just to run a little bit of 3D. :)
You don't need to install DirectX9.0c. You just need to include the required d3dx9_42.dll with your apps. Now even Purebasic includes this dll.
So, if you want it you can just copy it from Purebasic.

It also depends on what he's making. If he's just playing around with the 3D then it doesn't really matter what he uses, but
if he plans on making a nice game. Then he's probably better off sticking with Direct3D.
Al_the_dutch
User
User
Posts: 70
Joined: Mon Nov 11, 2013 11:07 am
Location: Portugal

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Al_the_dutch »

Thx all for your help. I want to summarize our findings.

If you want to distribute a x86 exe with some 3D stuff one has to add:

- D3dx9_42.dll that comes with PureBasic (x86). Same folder as the exe. No need to install a(n older) DirectX.
- Engine3.dll that comes with PureBasic (x86). Same folder as the exe. No need for a x64 version on a x64 PC.
- A folder structure and the files used in statements Add3DArchive and LoadTexture (and perhaps more?)

In your code, always use InitEngine3D(#PB_Engine3D_DebugLog) ; #PB_Engine3D_DebugLog makes the engine fill a ogre.log.
Test the exe in a complete different folder, drive or/and PC. If you get 3D errors, look in the ogre.log.

Any comments?

Al
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Bananenfreak »

Additional:
If you want to use selfcompiled Libraries (.dll) then you´ll have to compile it with x86-Compiler or with both Compilers.
Image
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by electrochrisso »

@Samuel,
@Al_the_dutch,
Thanks for the info, will try this out. :)

@Bananenfreak,
Handy tip to know. :wink:
PureBasic! Purely the best 8)
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by electrochrisso »

electrochrisso wrote: @Samuel,
@Al_the_dutch,
Thanks for the info, will try this out.
Even with the D3dx9_42.dll in System32, I still get an invalid address error on RenderWorld() when run from PB, does this only work for a compiled exe and not run from PB, any ideas. :?:
PureBasic! Purely the best 8)
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 756
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Samuel »

electrochrisso wrote: Even with the D3dx9_42.dll in System32, I still get an invalid address error on RenderWorld() when run from PB, does this only work for a compiled exe and not run from PB, any ideas. :?:
What's the graphic card your using? If it's an older card then it's possible the card doesn't support DirectX9.0c.
Al_the_dutch
User
User
Posts: 70
Joined: Mon Nov 11, 2013 11:07 am
Location: Portugal

Re: 3d engine can't be initialized x64 DirectX 10 Engine3D.d

Post by Al_the_dutch »

I get this error too on some (but most of them work fine) of the examples. Bridge.pb is one of them. Line 146. Invalid memory access. (read error at address 318287904). And I did not choose anything else (window 800*600) as with the examples that do work.

I changed line 18 in

Code: Select all

If InitEngine3D(#PB_Engine3D_DebugLog)
The last part of the ogre.log:
11:44:40: RenderSystem capabilities
11:44:40: -------------------------
11:44:40: RenderSystem Name: Direct3D9 Rendering Subsystem
11:44:40: GPU Vendor: ati
11:44:40: Device Name: Monitor-1-ATI Radeon HD 4600 Series
11:44:40: Driver Version: 8.17.10.1129
11:44:40: * Fixed function pipeline: yes
11:44:40: * Hardware generation of mipmaps: yes
11:44:40: * Texture blending: yes
11:44:40: * Anisotropic texture filtering: yes
11:44:40: * Dot product texture operation: yes
11:44:40: * Cube mapping: yes
11:44:40: * Hardware stencil buffer: yes
11:44:40: - Stencil depth: 8
11:44:40: - Two sided stencil support: yes
11:44:40: - Wrap stencil values: yes
11:44:40: * Hardware vertex / index buffers: yes
11:44:40: * Vertex programs: yes
11:44:40: * Number of floating-point constants for vertex programs: 256
11:44:40: * Number of integer constants for vertex programs: 16
11:44:40: * Number of boolean constants for vertex programs: 16
11:44:40: * Fragment programs: yes
11:44:40: * Number of floating-point constants for fragment programs: 224
11:44:40: * Number of integer constants for fragment programs: 16
11:44:40: * Number of boolean constants for fragment programs: 16
11:44:40: * Geometry programs: no
11:44:40: * Number of floating-point constants for geometry programs: 0
11:44:40: * Number of integer constants for geometry programs: 0
11:44:40: * Number of boolean constants for geometry programs: 0
11:44:40: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
11:44:40: * Texture Compression: yes
11:44:40: - DXT: yes
11:44:40: - VTC: no
11:44:40: - PVRTC: no
11:44:40: * Scissor Rectangle: yes
11:44:40: * Hardware Occlusion Query: yes
11:44:40: * User clip planes: yes
11:44:40: * VET_UBYTE4 vertex element type: yes
11:44:40: * Infinite far plane projection: yes
11:44:40: * Hardware render-to-texture: yes
11:44:40: * Floating point textures: yes
11:44:40: * Non-power-of-two textures: yes
11:44:40: * Volume textures: yes
11:44:40: * Multiple Render Targets: 4
11:44:40: - With different bit depths: yes
11:44:40: * Point Sprites: yes
11:44:40: * Extended point parameters: yes
11:44:40: * Max Point Size: 256
11:44:40: * Vertex texture fetch: yes
11:44:40: * Number of world matrices: 0
11:44:40: * Number of texture units: 8
11:44:40: * Stencil buffer depth: 8
11:44:40: * Number of vertex blend matrices: 0
11:44:40: - Max vertex textures: 4
11:44:40: - Vertex textures shared: no
11:44:40: * Render to Vertex Buffer : no
11:44:40: * DirectX per stage constants: yes
11:44:40: DefaultWorkQueue('Root') initialising on thread main.
11:44:40: Particle Renderer Type 'billboard' registered
11:44:40: Texture: Wood.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) Internal format is PF_X8R8G8B8,256x256x1.
11:44:40: Texture: Dirt.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) Internal format is PF_X8R8G8B8,256x256x1.
11:44:40: Texture: ground_mask.png: Loading 1 faces(PF_A8R8G8B8,512x512x1) Internal format is PF_A8R8G8B8,512x512x1.
11:44:40: Texture: ground_diffuse.png: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
11:44:40: Texture: desert07_rt.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
11:44:40: Texture: RustySteel.jpg: Loading 1 faces(PF_R8G8B8,256x256x1) Internal format is PF_X8R8G8B8,256x256x1.
11:44:40: Texture: spheremap.png: Loading 1 faces(PF_R8G8B8,256x256x1) Internal format is PF_X8R8G8B8,256x256x1.
11:44:40: Texture: desert07_fr.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
11:44:40: Texture: desert07_bk.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
11:44:40: Texture: desert07_lf.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
11:44:40: Texture: desert07_up.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.
11:44:40: Texture: desert07_dn.jpg: Loading 1 faces(PF_R8G8B8,512x512x1) Internal format is PF_X8R8G8B8,512x512x1.

Al
Post Reply