Page 1 of 1

Current version of Ogre3D

Posted: Fri Apr 19, 2024 1:10 pm
by Krix
What is the current version/versions of Ogre3D used with the current version of PureBasic?

Thanks.

Re: Current version of Ogre3D

Posted: Fri Apr 19, 2024 9:03 pm
by jacdelad
Just a shot into the blue: The last entry of the help touching this is from 2012 and lists OGRE 1.82. Also the OGREs copyright text in the help is from 2012. If nobody forgot to update these, it should be 1.82.

Re: Current version of Ogre3D

Posted: Mon Apr 22, 2024 10:30 am
by Krix
Yeah...it happened a few times that the docs didn't follow every change. That's why it would be great if either Fred or Prof Shadoko could confirm that it's still 1.8.2 ?

Thanks.

Re: Current version of Ogre3D

Posted: Mon Apr 22, 2024 10:50 am
by Fred
You can enable the log in InitEngine3D() but yes I think it's 1.8.2

Re: Current version of Ogre3D

Posted: Mon Apr 22, 2024 12:22 pm
by Shardik
Ogre.log in Windows 10 x64 with PB 6.10 wrote:*-*-* Version 1.8.2 (Byatis)

Re: Current version of Ogre3D

Posted: Mon Apr 22, 2024 12:56 pm
by juergenkulow

Re: Current version of Ogre3D

Posted: Mon Apr 22, 2024 12:57 pm
by Shardik
To get your current Ogre version you may run the following cross-platform program. Unfortunately Windows is blocking the Ogre log file while executing the program, so I had to copy the log file to a temporary file to be able to read it out. This is not necessary in Linux and MacOS but it also doesn't hurt... :wink:

Code: Select all

EnableExplicit

Define FileExtension.S
Define OgreTempFile.S
Define OgreVersion.S
Define Record.S

If InitEngine3D(#PB_Engine3D_DebugLog) = 0
  CompilerSelect #PB_Compiler_OS
    CompilerCase #PB_OS_Linux
      FileExtension = ".so"
    CompilerCase #PB_OS_MacOS
      FileExtension = ".dylib"
    CompilerCase #PB_OS_Windows
      FileExtension = ".dll"
  CompilerEndSelect
  
  MessageRequester("Error",
    "Unable to find file Engine3D" + FileExtension,
    #PB_MessageRequester_Error)
Else
  CompilerIf #PB_Compiler_OS = #PB_OS_Windows
    If FileSize("Ogre.Log") < 0
      MessageRequester("Error",
        "Unable to find Ogre.Log",
        #PB_MessageRequester_Error)
      End
    EndIf

    While FileSize("Ogre.Log") < 500
      Delay(20)
    Wend
  CompilerEndIf

  OgreTempFile = GetTemporaryDirectory() + "Ogre.Log"

  If CopyFile("Ogre.Log", OgreTempFile) = 0
    MessageRequester("Error",
      "Unable to copy Ogre.Log",
      #PB_MessageRequester_Error)
    End
  EndIf

  If FileSize(OgreTempFile) < 0
    MessageRequester("Error",
      "Unable to find " +
      OgreTempFile + "!",
      #PB_MessageRequester_Error)
  Else
    If ReadFile(0, OgreTempFile) = 0
      MessageRequester("Error",
        "Unable to open " + OgreTempFile + "!")
      End
    Else
      While Eof(0) = #False
        Record = ReadString(0)

        If FindString(Record, "*-*-* Version")
          OgreVersion = StringField(Record, 4, " ")
          Break
        EndIf
      Wend

      CloseFile(0)

      If OgreVersion = ""
        MessageRequester("Error",
          "Unable to find Ogre version in Ogre.Log",
          #PB_MessageRequester_Error)
      Else
        MessageRequester("Info",
          "Ogre version: " + OgreVersion)
      EndIf
    EndIf
  EndIf

  DeleteFile(OgreTempFile)
EndIf