PB 5.20 3D Engine Fail

Everything related to 3D programming
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

PB 5.20 3D Engine Fail

Post by IdeasVacuum »

[PB5.20x86 WinXP]
Long time since I needed to code anything 3D. My first point of call was to run an app (exe) I wrote in Feb2013 - it failed on 3D Engine initialisation, which it had not done before. Ran compile/run in PB5.20. The failure is still there but where should the Ogre log be found?

I'm not sure why there is a failure, but I have changed my anti-virus this year. Are there any files for 3D that the anti-virus should be told not to touch?

Code: Select all

If InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput)

      igInitEngineOK = #True
          InitSprite()
        InitKeyboard()
        Add3DArchive(sgScriptsFolder,#PB_3DArchive_FileSystem)
        Add3DArchive(sgTextureFolder,#PB_3DArchive_FileSystem)
      Parse3DScripts()
Else
      igInitEngineOK = #False
      MessageRequester("Oh dear", "3D Engine initialisation failure", #MB_ICONERROR)
EndIf
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: PB 5.20 3D Engine Fail

Post by DK_PETER »

@IdeasVacuum
You don't need to take special precautions..

The error arises as you refer to a folder without using quotes.

Code: Select all

If InitEngine3D(#PB_Engine3D_DebugLog | #PB_Engine3D_DebugOutput)

      igInitEngineOK = #True
          InitSprite()
        InitKeyboard()
        Add3DArchive("sgScriptsFolder",#PB_3DArchive_FileSystem)
        Add3DArchive("sgTextureFolder",#PB_3DArchive_FileSystem)
      Parse3DScripts()
Else
      igInitEngineOK = #False
      MessageRequester("Oh dear", "3D Engine initialisation failure", #MB_ICONERROR)
EndIf
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB 5.20 3D Engine Fail

Post by IdeasVacuum »

Hi DK_PETER, I will check that, but sgScriptsFolder and sgTextureFolder are global vars containing the full path to the respective folders.

Nope, the paths are correct (and the files expected are in the folders). As I mentioned, the app was working fine........
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: PB 5.20 3D Engine Fail

Post by DK_PETER »

IdeasVacuum wrote:Hi DK_PETER, I will check that, but sgScriptsFolder and sgTextureFolder are global vars containing the full path to the respective folders.

Nope, the paths are correct (and the files expected are in the folders). As I mentioned, the app was working fine........
@IdeasVacuum

Then your example is incomplete and doesn't show the problem.
The only error I get is a bad parameter type: String expected.

Anyway.. I hope you solve it.
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: PB 5.20 3D Engine Fail

Post by Samuel »

If InitEngine3D() is failing then I'd guess your missing DirectX9.0c or your hardware doesn't support it. Unless are you using OpenGL?
Do Purebasic's 3D examples still run on your computer?
IdeasVacuum wrote: The failure is still there but where should the Ogre log be found?
The Ogre log should be created in the same location as your executable or pb file depending on what your currently using.
marc_256
Addict
Addict
Posts: 835
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: PB 5.20 3D Engine Fail

Post by marc_256 »

Hi IdeasVacuum,

what I do, and mostly a error,
I copy the Engine3D.dll to my creating directory, when I make an .exe file,
and when I upgrade PB, I forget, and get an error.

Maybe check in your creation directory for the 3D dll (older version)
and if so, replace it with the 5.20 3D dll.

marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: PB 5.20 3D Engine Fail

Post by Kuron »

Unless are you using OpenGL?
If you are on Windows, you still need DX9 installed even if you are using OpenGL for the 3D engine.
Best wishes to the PB community. Thank you for the memories. ♥️
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB 5.20 3D Engine Fail

Post by IdeasVacuum »

Maybe check in your creation directory for the 3D dll
....and that was indeed 'it'. I think it was possibly snaffled away by Avast, which this weekend complained about an app (one of mine for internal use only) that it was happy with for months previously. I do very much like Avast, but it does get terribly confusing from time to time.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
bmon
User
User
Posts: 54
Joined: Sat May 24, 2008 8:51 pm
Location: U.S.

Re: PB 5.20 3D Engine Fail

Post by bmon »

Also make sure to be careful if you store a copy of the "Engine3d.dll" inside the same directory as your source files. When you compile/run a program from the editor, if it finds that the "Engine3d.dll" exists in the same location, then it will try to use that DLL rather then the one associated with the version of PureBasic you are using. If they are different then the editor might throw an exception/error on perfectly good code or may just crash the editor all together. So if you wish to store this DLL file in the same location then just make sure that it is the same version as the version of PureBasic you are using. If no DLL is found at the same location then the editor will automatically load the correct version for the version of PureBasic you are using.

You can also specify which DLL version you want to use by supplying the second argument to the InitEngine3d() command:
- Result = InitEngine3D([Flags [, LibraryName$]) -
Where "LibraryName$" can be the new name of the "Engine3d.dll" you wish to use.

Of course once an EXE is created then it is NECESSARY to place a copy of the "Engine3d.dll" (or whatever you decide to change the name to) inside the same location in order for the program to work.

Hope that helps ... Bruce
marc_256
Addict
Addict
Posts: 835
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: PB 5.20 3D Engine Fail

Post by marc_256 »

Bruce,

You are right ...
In the beginning I forgot this and I had a lot of problems, by starting my .exe files.
Now I know for good ... it is hard to learn sometimes. :mrgreen:

marc,
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
User avatar
Samuel
Enthusiast
Enthusiast
Posts: 755
Joined: Sun Jul 29, 2012 10:33 pm
Location: United States

Re: PB 5.20 3D Engine Fail

Post by Samuel »

Kuron wrote: If you are on Windows, you still need DX9 installed even if you are using OpenGL for the 3D engine.
If this is true that would mean the D3D9 plugin is being loaded at start up even when it's not being used.

According to Sinbad OgreMain does not rely on DirectX in anyway. So, unless Fred has a reason for it being there it should be changed.

I wonder if Fred has a reason for this or if it's just a mistake?
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: PB 5.20 3D Engine Fail

Post by Kuron »

Samuel wrote:If this is true that would mean the D3D9 plugin is being loaded at start up even when it's not being used.
DX9 is required on Windows even when using OpenGL because of the use of DirectInput for keyboard/mouse handling.

Years ago, MS told developers to quit using DirectInput for keyboard/mouse for compatibility reasons (it is not 100% reliable on all systems) and instead to use WM_Input. Unfortunately, many products (PB, GLBasic, etc) still use DirectInput.
Best wishes to the PB community. Thank you for the memories. ♥️
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PB 5.20 3D Engine Fail

Post by IdeasVacuum »

Good advice Bruce, thank you. 8)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Post Reply