The big day has come. PureBasic 64bit finally sees the light of day! (although Windows only for now)
As promized, this version also brings an OSX x86 version, as well as the long promised Ogre updates.
From now on, even alpha and beta releases are done for all platform simultanously, and with the introduction of the 3DEngine functions and OnError library for all platforms, the amount of platform-specific functions in PureBasic has dropped below 9% giving a great boost to the crossplatform-capabilities of PureBasic.
There are many smaller news as well, so lets get to it...
We had to make some incompatible changes to make developping programs in 32bit and 64bit versions easier and while we were at it, we also made some other chanes as well, so existing code may need a little adjustment to work with the 4.30 version.
To make the transition easier, we introduced "deprecated functions". Where possible, a renamed or removed function still exists and compiles, but the compiler will issue a warning about it each time the function is used. This feature shoud not be an excuse to keep using the old functions however. Deprecated functions are likely to be removed entirely sometime in the future, so you are doing yourself a favor by adapting your code sooner than later.
Here is the list of changes in this Version:
- new PureBasic 64bit Windows version
- new PureBasic x86 version for OSX
- Ogre update, and many new commands (see below)
- Complete restructuring of the Debugger for better stability and support of the new platforms
- Added: OnError support for all platforms
- Added: Support for multiple Joysticks
- Added: Compiler warning support
- Added: Debugger warning support
- Added: Language support for Compiler and Debugger (only the compiler is translated in beta 1)
- Added: support for And/Or in CompilerIf statements
- Added: Compiler constant: #PB_Compiler_Processor (= #PB_Processor_x86, ..._x64, ..._PowerPC, ..._mc68000)
- Added: New integer type ".i" which is long/quad for 32bit/64bit respectively
- Added: Improved memory allocation for LinkedList and some other libraries
New features in the Libraries:
- Added: ArraySize()
- Added: CatchModule()
- Added: UseJPEG2000ImageDecoder() and UseJPEG2000ImageEncoder()
- Added: DesktopX(), DesktopY()
- Added: Semaphore commands (CreateSemaphore(), FreeSemaphore(), SignalSemaphore(), WaitSemaphore(), TrySemaphore())
- Added: Window events #PB_Event_WindowMaximize, #PB_Event_WindowMinimize, #PB_Event_WindowRestore
- Added: WindowBounds() to set the minimum/maximum Window size
- Added: #PB_Ignore support to AddStatusBarField()
- Changed: new style parameter for FontRequester()
- Changed: InitScintilla() parameter is now optional
- Changed: Hex(), Bin() have an optional type parameter (use #PB_Long, #PB_Quad) to change the behavior for negative numbers
- Renamed: CountList() to ListSize()
- Renamed: ClearGadgetItemList() to ClearGadgetItems()
- Renamed: CameraProjection() to CameraProjectionMode()
- Renamed: #Byte, #Long, #Word etc to #PB_Byte, #PB_Long, #PB_Word (for StrU, Hex, Bin)
- Removed: CreateGadgetList() - OpenWindow() now calls this implicitly. UseGadgetList() can be used for API windows
- Removed: ChangeListIconGadgetDisplay() - use SetGadgetAttribute(#Gadget, #PB_ListIcon_DisplayMode, Mode) instead
- Removed: StrQ(), HexQ(), BinQ(), ValQ(), IntQ(). Just use Str(), Hex(), Bin(), etc. instead, they now work with quad
- Removed: Backward compatibility behavior in ButtonImageGadget() (now works as documented since 4.20 only)
- Changed: AddElement() and similar LinkedList functions return the data pointer now (not the list header)
- Changed: OnError lib rewritten, with some commands renamed or remove (see below)
- Changed: RotateEntity(), RotateCamera() and RotateBillboard() x,y rotation axis
- Changed: The Joystick commands have an extra #Joystick parameter now. InitJoystick() returns the number of available Joysticks
- Changed: The ComboBoxGadget() "Height" parameter now affects the entry field height, not the dropdown box.
- Changed: Read now does not determine its type by the variable used, but as other commands with "Read.l", "Read.s" etc.
NOTE: "Read x.b" will now read an integer, as the default type will be used for the Read, and then converted to byte!
Renamed and new OnError library commands:
OnErrorExit() - Exit the program if an error occurs
OnErrorCall(@ErrorHandler()) - Call the given error handler if an error occurs
OnErrorGoto(?LabelAddress) - Continue execution at the given label if an error occurs
OnErrorDefault() - Uninstall any error handler so the default OS action is taken on further errors
ErrorCode() - Returns the current error code
ErrorMessage([ErrorNumber]) - Returns a string message for the current error or the given error number
ErrorLine() - Returns the line number at which the current error occured
ErrorFile() - Returns the source filename in which the current error occured
ErrorAddress() - get the Code address at which the error happened
ErrorTargetAddress() - get the Memory address for a memory access error.
ErrorRegister(Register) - get the content of a register at the time of the error
RaiseError(ErrorNumber) - Raise the given error and call the error handler or exit
- Note: Resuming the code after the OnErrorCall() handler is no longer possible
Commands removed from the OnError lib wihout replacement:
And here are some news from the Ogre front:
PureBasic 4.30 was promized to be a so called 'Ogre update release'. So let's start from the beginning. The major problem when dealing with third part projects like Ogre, is the number of dependencies needed and their maintenance/upgrade path. Up to now, we took various archives here and here and build them from their own scripts (VC solutions/nmake on Windows, ./configure makefile on linux and so on). That takes an hell of time and you ever wonder if the final build (with all the dependencies linked into a single DLL) will work at all. And basically you need to repeat these steps everytime a new version of Ogre or one of its dependencies are updated. By dependencies, we mean internal one (like the various Ogre plugins: renderer, hydrax, ogreAL, ogreODE etc.) and external one (pcre, CEGUI, FreeType, FreeImage etc.).
So we needed to find a way to maintain it, as easy and upgradable as possible. Main Ogre source repository lastly switched to SVN, so we just did a raw checkout, and we're done. To update to lastest revision is now straightforward. That's the step 1, and we repeated it for every dependencies which offer a SVN access. For other, we took the lastest source versions, and avoid every binary distribution. That's heading us to step 2: build everything yourself. Yes, that's easy to use the provided scripts when building libs one time and for one plateform, but the more PB evolves, the more different plateform we need to support. PureBasic 4.30 introduces OS X x86 and Windows x64, which mades 5 differents OS to build OGRE on. And we definitely don't want to manually do that. Our PureBasic source repository uses basic but very portable makefiles, which allow to compile every libs from the same sources to every supported plateforms. So the idea was obvious: forget the provided build scripts and redo everything with our makefiles. And for a project of the size of Ogre, it's not straightforward. It took almost a whole week to have them completed and working on the 5 plateforms. That's it, our current implementation of Ogre works on Windows x86/x64, Linux, and OSX x86 and PowerPC. And other plateform, if any, will come for free. As a special note, we reduced the Windows dependencies to the maximum, so there is only one DLL needed, no more two. Here ends the technical part of the story.
Now, we had to improve the PureBasic Ogre support. First, we updated Ogre itself, so indeed, we got immediately better internal engine and new functionalities (FSAA, DirectX9, better shadow etc.). Then, we included new plugins: 3D sound management in relation with the 3D world (basically you can create a sound and place it in the world, it will automatically handle the volume, etc.), native GUI functions to create a window and gadgets, on top of the 3D world (the commands duplicates the original PureBasic gadget and window functions), a water plane (with nice sun handling), and a new 'node' library which allow to easily groups and stack various objects like sound, entities and node. For input, we provide an easy 'mouse picking' support, so it's now easy to interact with 3D scene using the mouse. We hope it will help you to do quite some interesting applications or games.
* SoundRange3D(Min, Max)
* FreeNode() - and all its children objects
* AttachNodeObject() - Can be a node, sound, billboard, entity, camera (allow easy grouping)
* MousePick(#Camera, x, y) - return the entity under the mouse (or a special constant for the World/Terrain)
* Added absolute/relative rotation for all rotate commands
* Added absolute move for physic body (see the Shooter.pb test or SimpleCollision.pb)
And here is an archive to test the new engine: http://www.purebasic.com/Ogre1.6.zip
As usual, the documentation for these new things is done during the beta phase, so if you have questions concerning these features, just ask on the forum and the alpha testers and team members can help you.
Please test this new version as much as you can and report any problems. Make sure you read the "Incompatible changes" section above carefully before reporting a bug, as what you think is a bug could well just be a change made on purpose.
You can download the new beta version on your personal account:
We hope you enjoy these changes and updates.
The PureBasic Team