Page 1 of 1
PB 5.20 3D Engine Fail
Posted: Sun Jun 08, 2014 11:36 pm
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
Re: PB 5.20 3D Engine Fail
Posted: Sun Jun 08, 2014 11:42 pm
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
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 12:12 am
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........
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 12:53 am
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.
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 3:53 am
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.
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 8:40 am
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
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 9:02 am
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.
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 1:11 pm
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.
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 2:55 pm
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
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 3:43 pm
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.
marc,
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 5:33 pm
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?
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 5:56 pm
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.
Re: PB 5.20 3D Engine Fail
Posted: Mon Jun 09, 2014 6:58 pm
by IdeasVacuum
Good advice Bruce, thank you.
