DBP is DirectX 9 so it will not run on Mac/Linux, but it might work on WINE. DBP is 32-bit so PureBasic can only access it as a 32-bit executable.
PureGDK is a replacement for DBP. It lets you write everything in PureBasic just like you would in DBP but using the powerful PureBasic language instead. It's similar to DarkGDK but it differs in that it's compatible with all DBP plugins, it has an improved command library (many functions have been re-written/improved/replaced, and because it's a BASIC dialect it's much easier to program.
I've made many changes to several of the DarkBasic Professional libraries to add improvements. For example, I've eliminated vector and matrix IDs in favor of structure pointers, you now only need to call one command to retrieve the capabilities of the user's 3D hardware, all of the "Perform Checklist" command names have been shortened (yay!), and many useful commands that were hidden have been exposed and documented.
You can download DBP and PureGDK compiled examples with sources on the examples page of the PureGDK website:
http://puregdk.com/index.php?f=examples
Have a look at the fire demo (the first one on in the list). The demo demonstrates how to embed the DarkBasic render window into another and how to catch mouse input from the parent window using an API callback.
It also showcases several features of PureBasic including:
Threads
Window callbacks
Linked lists
Enumeration
MDI windows
Gadgets
Windows API
With Direct3D callbacks for a lost render device you can backup and restore important data in your game/application and prevent it from crashing if someone resets their screen resolution, changes desktops/workspaces, or if the screen saver pops up. With a DBP application your program would just crash when all of the data gets wiped from video memory.
PureGDK provides custom error handling so that you can capture and resolve runtime errors yourself. For example, if your program crashes you can prompt the user for information about the crash and send the data to yourself with the internal error number, line number, source file, and any other information that might allow you to locate the source of the problem. Or maybe you'll ask user's to optionally input their e-mail so you can follow-up.
PureGDK makes application programming using DarkBasic Professional realistic and easy. It also has a complete GUI library that is superior to BlueGUI. You also have complete access to the Windows API for adding advanced functionality to your program. With the addition of threads it's now possible to perform complex calculations in the background without the cursor lagging or mouse-clicks becoming lost.
On the topic of threads, PureGDK is 100% thread safe. That means you can run one thread for your rendering, one thread for input, and another thread for physics. PureGDK handles all of the additional code required for threaded programming using the DBP engine for you.
PureGDK comes with support for 21 plugins right out of the box:
Licensed Plugins:
2D Plugin Kit
3D Cloth & Particles Physics
Advanced Terrain
Dark Physics
Dark AI
Dark Lights
Enhanced Animations
eXtends
EZ Rotate Enhanced
STYX
TextureMax
Unity
Free Plugins:
D3DFunc
DarkSide Starburst
DBP Collisions
DKAVM
DKSHOP
EZ Rotate Basic
Multisync
Newton Game Dynamics
zParticles
The real advantage is the power of the PureBasic language. Things that would be cumbersome and in some cases impossible in DBP are easily done in PureBasic.
Some examples of useful things:
Structured linked lists:
http://www.purebasic.fr/english/viewtopic.php?t=34139
Loading icon resources:
http://www.purebasic.fr/english/viewtopic.php?t=35534
Changing the cursor at runtime:
http://www.purebasic.fr/english/viewtopic.php?t=35069
There are also a lot of fundamental changes to the way DBP works to make it easier to use. To highlight a few things:
Data structures to replace vector and matrix IDs
Quote: "PureGDK uses structures to instead of IDs to pass vector and matrix data between functions. To pass a vector to a function it must first be passed by address using the " @ " operator. The following example will create two variables with vector 2 structures and then add them together.
;/ Declare variables with pre-defined structures
Vector2a.Vector2
Vector2b.Vector2
;/ Set vector data
Vector2ax=3: Vector2bx=7
Vector2ay=5: Vector2by=5
;/ Add vectors together
dbAddVector2(@Vector2Result, @Vector2a, @Vector2b)
;/ Output results
Debug Vector2Resultx ; 3 + 7 = 10
Debug Vector2Resulty ; 5 + 5 = 10
"
How to use optional flags
Quote: "PureBasic uses optional parameter flags in some functions like OpenWindow(). To use these optional flags simply use the bitwise OR operator " | " to separate each flag. This example will open the DarkBasic render window with a titlebar and center it on the screen by using a combination of the #PB_Window_SystemMenu and #PB_Window_ScreenCentered flags.
WindowID = OpenWindow(#PB_Any, 0 ,0, 320, 240, "Window Title", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
"
How to change the resolution:
Quote: "Unlike DBP, PureGDK does not stretch the resolution of the render window by default. If you want to use a lower resolution at a higher screen size then you can resize the window yourself:
;/ Initialize PureBasic desktop library
ExamineDesktops()
;/ Show the PureGDK render window
OpenWindow(0,0,0,DesktopWidth(0),DesktopHeight(0),"DarkBasic Professional - PureGDK",#PB_Window_BorderLess)
hDBWnd=OpenDBWnd(WindowID(0),0,0,640,480)
MoveWindow_(hDBWnd,0,0,DesktopWidth(0),DesktopHeight(0),1)
;/ Resize the PureBasic window
dbSetWindowSize(DesktopWidth(0),DesktopHeight(0))
dbMakeObjectCube(1,3)
;/ Rotate the cube and update the screen
Repeat
x.f+0.2: y.f+0.4: z.f+0.8
dbRotateObject(1,x.f,y.f,z.f)
dbText(15,15,Str(dbscreenfps()))
dbSync()
Until WindowEvent()=#WM_CLOSE Or Not dbInKey()=""
End
"
Quote: "Identifying supported resolutions is also very easy using the Win32 API. Consider this example which lists all resolutions supported by the user's monitor that is of the same frequency and aspect ratio:
;/ Initialize PureBasic desktop library
ExamineDesktops()
;/ Iterate through supported display settings and display only select criteria
While EnumDisplaySettings_(0,i,@DevMode.DEVMODE)
If DesktopWidth(0)*1.0/DesktopHeight(0)=DevModedmPelsWidth*1.0/DevModedmPelsHeight And DevModedmDisplayFrequency=DesktopFrequency(0) And DevModedmBitsPerPel=DesktopDepth(0)
Debug Str(DevModedmPelsWidth)+" "+Str(DevModedmPelsHeight)+" "+Str(DevModedmDisplayFrequency)
EndIf
i+1
Wend
"
Function improvements:
Quote: "All of the functions for retrieving hardware capabilities have been reduced to a single function so you can now do call one function and check the user's hardware by transversing a structure (just like a DBP type):
hDBWnd=OpenDBWnd(0,0,640,480,32,#GDK_Window_SystemMenu|#GDK_Window_ScreenCentered)
dbGetD3DCapabilities(@Result.D3DCaps)
Debug "TnL Captable: "+Str(ResultTnL)
Debug "ZFog Captable: "+Str(ResultZFog)
dbWaitKey()
End
"
Automatic ID association:
Quote: "PureGDK has automatic ID association when passing #GDK_Any or -1 as the ID. For example:
ObjectID=dbMakeObjectCube(#GDK_Any,3)
Where ObjectID is automatically assigned as the next free ID available. I've found this to be very convenient for keeping track of assets. You can do this, for example:
ObjectID=GameData_AddObject(dbMakeObjectPlain(#GDK_Any,TileWidth,TileWidth))
dbRotateObject(ObjectID,90,0,0)
dbPositionObject(ObjectID,x*TileWidth,0,y*TileWidth)
dbTextureObject(ObjectID,*GameDataImagesLevel1FloorMetal)
This way it's easy to capture IDs in your own lists for enumeration without all of those cumbersome FindFree..() functions."