PureBasic 4.60 Beta 1 released! (for real)

Developed or developing a new product in PureBasic? Tell the world about it.
freak
PureBasic Team
PureBasic Team
Posts: 5929
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

PureBasic 4.60 Beta 1 released! (for real)

Post by freak »

Hello everybody!

You probably saw the fake April 1 announcement, but as we all know: real releases happen on a Monday! :P So here it is, after a longer than usual period: The first beta of the upcoming PureBasic 4.60 release. It is available for download on your personal account.

This release is mostly about the 3D side of things, but there are new features for application programmers as well. The OGRE engine was updated to version 1.7.0 and we switched the physics engine from ODE to Bullet. Furthermore, there are a ton of new 3D libraries and commands. You can see the full list below. The 3D commands are not documented yet, but we will put up some examples to demonstrate them.

A special thanks to G-Rom and TMyke from the french forum for their help on the new 3D commands!

Note: It may be required that you update your DirectX 9 runtimes to work with this new version. If you get a missing DLL error when running the 3D examples, then install this: http://www.microsoft.com/downloads/en/d ... laylang=en

On the application side of things, the most notable addition is the CanvasGadget() command. It is a simple drawing surface that provides detailed mouse and keyboard events to easily implement custom data views or controls (all cross-platform of course). You can see this new gadget in action in the IDE already: The new file panel and the new color picker tool both make use of it. Other than that, there are some smaller new commands like additions to the LinkedList library for example. All new non-3D commands are already documented in the manual.

The IDE got some additions as well, like the ability to build projects directly from the command-line, or the option to be warned when a file is changed on disk while open in the IDE. Unfortunately, the automation framework that I talked about here on the forum did not make it into this release. It wasn't finished in time, and its not a big enough priority to justify delaying this release any longer.

Finally, we are in the process of changing the PureBasic documentation to be more precise and readable when it comes to function parameters and return values. This is still a work in progress which should be finished for the final release. Comments on the new structure are welcome.

Here is the full list of changes:

Code: Select all

Libraries:
- added CanvasGadget(), CanvasOutput()
- added SetGadgetItemData() for PanelGadget
- added MoveElement(), MergeLists(), SplitList() commands
- added RandomizeList(), RandomizeArray()
- added PushListPosition(), PopListPosition(), PushMapPosition(), PopMapPosition()
- added ImageID parameter to OpenSubMenu()
- added #PB_ListIcon_ThreeState and #PB_ListIcon_Inbetween
- added #PB_Tree_ThreeState and #PB_Tree_Inbetween
- added crossplatform ComboBox events
- added 'Joint' library
- added 'SpecialEffect' library
- added 'StaticGeometry' library
- added CameraPitch(), CameraRoll(), CameraYaw(), SwitchCamera()
- added ApplyEntityForce(), ApplyEntityImpulse(), EntityPitch(), EntityRoll(), EntityYaw(), GetEntityAttribute(), 
        GetEntityMaterial(), SetEntityAttribute(), SetEntityMaterial()
- added LightDiffuseColor(), SpotLightRange(), LightLookAt(), LightPower(), DisableLightShadows()
- added MaterialDepthWrite(), MaterialSelfIlluminationColor(), MaterialShininess(), GetScriptMaterial()
- added BuildMeshShadowVolume(), CreateLine3D(), CreateCube(), CreateSphere(), CreateCylinder(), CreatePlane(), AddSubMesh()
        MeshVertexCount(), UpdateMeshBoundingBox(), MeshRadius(), AddMeshVertex(), MeshVertexNormal(), MeshVertexColor()
        MeshVertexTextureCoordinate(), AddMeshFace(), FinishMesh(), NormalizeMesh(), SaveMesh(), SetMeshMaterial(), SubMeshCount()
        TransformMesh()
- added NodePitch(), NodeRoll(), NodeYaw()

- changed FindString() 'StartPosition' parameter to be optional
- changed WebGadget to use WebKitGtk on Linux
- changed ContainerGadget with #PB_Container_Borderless to no longer add a 2px invisible border on Linux
- changed EntityPhysicBody(), CreateLight(), RenderWorld(), ShowGUI, WorldShadows()
- changed EntityMaterial() to SetEntityMaterial()

- removed: Get/SetEntityMass(), Get/SetEntityFriction()
- removed: SetMeshData() (temporary, needs to be updated)

IDE:
- added IDE options for commandline project building
- added monitoring of files for changes on disk while they are open in the IDE
- added FilePanel custom implementation with Drag & Drop, Dropdown menu, scrolling also on OSX
- added Diff tool for directories/files
- added Html help viewer for Linux/OSX
- added Help viewer in toolspanel
- new Color Picker tool
- enabled font selection in IDE for OSX
- ProjectPanel now remembers node expanded states

Debugger:
- added maximize button to all debugger windows
- added all IsXxx() and XxxID() functions to the expression parser (for data breakpoints)

Manual:
- The manual is being updated to a new format which more clearly describes
 individual function parameters and return values. This is not yet complete,
 but will be finished for the final release.

This is a detailed list of the new 3D commands:

Code: Select all

Quick help for new 3D commands:
-------------------------------

CameraPitch(#Camera) - Retrieve the pitch of the #Camera.
CameraRoll(#Camera) - Retrieve the roll of the #Camera.
CameraYaw(#Camera) - Retrieve the yaw of the #Camera.
SwitchCamera(#Camera, #NewCamera) - Change the active #Camera with the #NewCamera.

ApplyEntityForce(#Entity, x, y, z []) - Apply a force to #Entity
ApplyEntityImpulse(#Entity, x, y, z []) - Apply a force to #Entity
EntityPhysicBody(#Entity, Type [, Mass [, Restitution, Friction]]) - Change the #Entity physic body
EntityPitch(#Entity) - Return the pitch of the #Entity.
EntityRoll(#Entity) - Return the roll of the #Entity.
EntityYaw(#Entity) - Return the yaw of the #Entity.
GetEntityAttribute(#Entity, Attribute) - Get the #Entity attribute value
GetEntityMaterial(#Entity) - Get the #Entity material
SetEntityAttribute(#Entity, Attribute, Value) - Set an #Entity attribute value
SetEntityMaterial(#Entity, MaterialID) - Set the #Entity material

PointJoint(#Entity, PivotX, PivotY, PivotZ [, #Entity2, PivotX2, PivotY2, PivotZ2])
GetJointAttribute, Long, Long, (#Entity, Attribute)
SetJointAttribute, Long, Long, Float, (#Entity, Attribute, Value)
FreeJoint(#Entity)
HingeJoint(#Entity, PivotX, PivotY, PivotZ, AxisX, AxisY, AxisZ, #Entity2, PivotX2, PivotY2, PivotZ2, AxisX2, AxisY2, AxisZ2)
ConeTwistJoint(#Entity, FxA, FyA, FzA, #Entity2, FxB, FyB, FzB)
SliderJoint(#Entity, FxA, FyA, FzA, #Entity2, FxB, FyB, FzB)

CreateLight(#Light, Color [, x, y, z [, Flags]]) - Create a new #Light.
LightDiffuseColor(#Light, Color)
SpotLightRange(#Light, InnerAngle, OutterAngle [, FallOff])
LightLookAt(#Light, x, y, z)
DisableLightShadows(#Light, Disable)

MaterialDepthWrite(#Material, Enable) - Enable or disable the #Material depth write.
MaterialSelfIlluminationColor(#Material, Color) - Change the #Material self illumination color.
MaterialShininess(#Material, Shininess) - Change the #Material shininess.
GetScriptMaterial(#Material, Name$) - Get a material defined in scripts files.

BuildMeshShadowVolume(#Mesh)
CreateLine3D(#Mesh, x, y, z, Color, x2, y2, z2, Color2)
CreateCube(#Mesh, Size)
CreateSphere(#Mesh, Radius [Segments, Rings])
CreateCylinder(#Mesh, Radius, Length [, Tesselation, CloseTop, Oblique])
CreatePlane(#Mesh, TileSizeX, TileSizeZ, TileCountX, TileCountZ, TextureRepeatCountX, TextureRepeatCountY)
AddSubMesh()
MeshVertexCount(#Mesh [, SubMesh])
UpdateMeshBoundingBox(#Mesh)
MeshRadius(#Mesh)
AddMeshVertex(x, y, z)
MeshVertexNormal(x, y, z)
MeshVertexColor(Color)
MeshVertexTextureCoordinate(u, v)
AddMeshFace(Vertex1, Vertex2, Vertex3)
FinishMesh()
NormalizeMesh(#Mesh [, SubMesh])
SaveMesh(#Mesh, Filename$)
SetMeshMaterial(#Mesh, MaterialID [, SubMesh])
SubMeshCount(#Mesh)
TransformMesh(#Mesh, x, y, z, ScaleX, ScaleY, ScaleZ, RotateX, RotateY, RotateZ [, SubMesh])

NodePitch(#Node) - Return the x position of the #Node.
NodeRoll(#Node) - Return the y position of the #Node.
NodeYaw(#Node) - Return the z position of the #Node.

CreateCompositorEffect(#Effect, CameraID, EffectName$)
CreateRibbonEffect(#Effect, MaterialID, NodeID, NbChains, NbElements, InitialWidth, Length)
FreeEffect(#Effect) - Free the specified #Effect.
HideCompositorEffect(#Effect, State)
CompositorEffectParameter(#Effect, CameraID, EffectName$, DataType, *Data)
IsEffect(#Effect) - Tests if the given '#Effect' is an initialized effect object.
RibbonEffectColor(#Effect, Color, FadeoutColor)

AddStaticGeometryEntity(#StaticGeometry, EntityID, x, y, z [, ScaleX, ScaleY, ScaleZ])
BuildStaticGeometry(#StaticGeometry)
CreateStaticGeometry(#StaticGeometry, Width, Height, Length, EnableShadows)
FreeStaticGeometry(#StaticGeometry) - Free the specified #StaticGeometry.
IsStaticGeometry(#StaticGeometry) - Tests if the given '#StaticGeometry' is an initialized effect object.

RenderWorld([ElapsedPhysicTime]) - Renders the 3D world on the screen.
ShowGUI(Intensity, ShowMouseCursor [#Camera, Enable]) - Shows or hides the GUI
WorldShadows(ShadowType [, Distance]) - Change the shadow handling in this world.
As usual: This is a beta version. Don't be surprised if you find bugs. Please report them all, so we can reach a solid version for the final release.

Have fun with this new version!

The PureBasic Team
quidquid Latine dictum sit altum videtur
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by eddy »

great @ !!
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by Fred »

2 examples to test the new Joint lib (to be saved in the PB Sources dir):

A point join test:

Code: Select all


#CameraSpeed = 5

IncludeFile "Screen3DRequester.pb"

Define.f KeyX, KeyY, MouseX, MouseY

If InitEngine3D()
  
  Add3DArchive("Data", #PB_3DArchive_FileSystem)
  
  InitSprite()
  InitKeyboard()
  InitMouse()
  
  If Screen3DRequester()
    
    ;==================================
    ; create single material
    CreateMaterial(1, LoadTexture(0, "clouds.jpg"))
    MaterialAmbientColor(1, #PB_Material_AmbientColors)
    ; 
    CreateMaterial(2, LoadTexture(0, "clouds.jpg"))
    MaterialAmbientColor(2, #PB_Material_AmbientColors)
    
    
    ;==================================
    ; create cube
    CreateCube(1, 1.0)
    cube1=CreateEntity(#PB_Any, MeshID(1), MaterialID(1))
    EntityLocate(cube1, 2,0,0)
    cube2=CreateEntity(#PB_Any, MeshID(1), MaterialID(1))
    EntityLocate(cube2, 2,-3,0)
    
    ;==================================
    ; create sphere
    CreateSphere(2, 0.66)
    sphere=CreateEntity(#PB_Any, MeshID(2), MaterialID(1))
    EntityLocate(sphere, 2,-6,0)
    
    
    
    ; create cube3 (socle)
    CreateCube(2, 10.0)
    socle=CreateEntity(#PB_Any, MeshID(2), MaterialID(2))
    EntityLocate(socle, 5,4,0)
    ScaleEntity(socle, 1,0.1,1)
    
    
    EntityPhysicBody(cube1, #PB_Entity_BoxBody, 1.0)
    EntityPhysicBody(cube2, #PB_Entity_BoxBody, 1.0)
    EntityPhysicBody(sphere, #PB_Entity_SphereBody, 1.0)
    EntityPhysicBody(socle, #PB_Entity_StaticBody)
    
    
    PointJoint(cube1,  0, 7, 0)
    PointJoint(cube2,  0, 0, 0, cube1, 0, -3,0)
    PointJoint(sphere,  0, 2, 0, cube2, 0, -2,0) 
    
    ApplyEntityImpulse(cube1,  10, 0, 0)
    
    
    ;==================================
    CreateCamera(0, 0, 0, 100, 100)
    CameraLocate(0,0,2,25)
    
    Repeat
      
      If ExamineKeyboard()
        
        If KeyboardPushed(#PB_Key_O)
          ApplyEntityImpulse(cube2,  0.2, 0, 0)
        EndIf
        
        If KeyboardPushed(#PB_Key_Left)
          KeyX = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Right)
          KeyX = #CameraSpeed 
        Else
          KeyX = 0
        EndIf
        
        If KeyboardPushed(#PB_Key_Up)
          KeyY = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Down)
          KeyY = #CameraSpeed 
        Else
          KeyY = 0
        EndIf
        
      EndIf
      
      If ExamineMouse()
        MouseX = -(MouseDeltaX()/10)*#CameraSpeed/2
        MouseY = -(MouseDeltaY()/10)*#CameraSpeed/2
      EndIf
      MoveCamera  (0, KeyX, 0, KeyY)
      RotateCamera(0,  MouseY, MouseX, 0)  
      
      Screen3DEvents() 
      ; main render loop
      RenderWorld()
      FlipBuffers()
      
    Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
    
  EndIf
  
Else
  MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf

End
and a slider joint test:

Code: Select all


#PB_PointJoint_Tau = 1
#PB_PointJoint_Damping = 2
#PB_SliderJoint_LowerLimit = 3
#PB_SliderJoint_UpperLimit = 4
#PB_ConeTwistJoint_SwingSpan = 5
#PB_ConeTwistJoint_SwingSpan2 = 6
#PB_ConeTwistJoint_TwistSpan = 7


#CameraSpeed = 5

IncludeFile "Screen3DRequester.pb"

Define.f KeyX, KeyY, MouseX, MouseY

If InitEngine3D()
  
  Add3DArchive("Data", #PB_3DArchive_FileSystem)
  
  InitSprite()
  InitKeyboard()
  InitMouse()
  
  If Screen3DRequester()
    
    ;==================================
    ; create single material
    CreateMaterial(1, LoadTexture(0, "clouds.jpg"))
    MaterialAmbientColor(1, #PB_Material_AmbientColors)
    ; 
    CreateMaterial(2, LoadTexture(0, "clouds.jpg"))
    MaterialAmbientColor(2, #PB_Material_AmbientColors)
    
    
    ;==================================
    ; create cube
    CreateCube(1, 1.0)
    cube1 = CreateEntity(#PB_Any, MeshID(1), MaterialID(1))
    EntityLocate(cube1, -1, -0.5,0)
    RotateEntity(cube1, 0,0,10)
    
    ;==================================
    ; create cube2
    cube2 = CreateEntity(#PB_Any, MeshID(1), MaterialID(2))
    EntityLocate(cube2, 2,0,0)
    RotateEntity(cube2,0,0,10)
    
    ; create cube3 (socle)
    CreateCube(2, 10.0)
    Ground = CreateEntity(#PB_Any, MeshID(2), MaterialID(2))
    EntityLocate(Ground, 5,-8,0)
    ScaleEntity(Ground, 2,0.2,2)
    
    
    EntityPhysicBody(cube1, #PB_Entity_BoxBody, 1.0)
    EntityPhysicBody(cube2, #PB_Entity_BoxBody, 0.0)
    
    SliderJoint(cube1,  0,0.7,0,  cube2,  0,1.1,0)
    SetJointAttribute(cube1, #PB_SliderJoint_LowerLimit, -3)
    SetJointAttribute(cube1, #PB_SliderJoint_UpperLimit, 4)
    
    
    ;==================================
    CreateCamera(0, 0, 0, 100, 100)
    CameraLocate(0,0,2,25)
    
    Repeat
      
      If ExamineKeyboard()
        
        If KeyboardPushed(#PB_Key_O)
          ApplyEntityImpulse(cube1,  0.1, 0, 0)
        EndIf
        
        If KeyboardPushed(#PB_Key_Left)
          KeyX = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Right)
          KeyX = #CameraSpeed 
        Else
          KeyX = 0
        EndIf
        
        If KeyboardPushed(#PB_Key_Up)
          KeyY = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_Down)
          KeyY = #CameraSpeed 
        Else
          KeyY = 0
        EndIf
        
      EndIf
      
      If ExamineMouse()
        MouseX = -(MouseDeltaX()/10)*#CameraSpeed/2
        MouseY = -(MouseDeltaY()/10)*#CameraSpeed/2
      EndIf
      MoveCamera  (0, KeyX, 0, KeyY)
      RotateCamera(0,  MouseY, MouseX, 0)  
      
      Screen3DEvents() 
      ; main render loop
      RenderWorld()
      FlipBuffers()
      
    Until KeyboardPushed(#PB_Key_Escape) Or Quit = 1
    
  EndIf
  
Else
  MessageRequester("Error", "The 3D Engine can't be initialized",0)
EndIf

End
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by ts-soft »

:D
thanks, great news.
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
LuCiFeR[SD]
666
666
Posts: 1033
Joined: Mon Sep 01, 2003 2:33 pm

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by LuCiFeR[SD] »

Good news indeed! I shall enjoy experimenting I think :P
User avatar
Arctic Fox
Enthusiast
Enthusiast
Posts: 609
Joined: Sun Dec 21, 2008 5:02 pm
Location: Aarhus, Denmark

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by Arctic Fox »

Nice one!
Thanks a lot :D
rsts
Addict
Addict
Posts: 2736
Joined: Wed Aug 24, 2005 8:39 am
Location: Southwest OH - USA

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by rsts »

Thanks :D

Even though I'm not a user of 3d, it's nice to see the continuing development of the language.

Best to you.
User avatar
eddy
Addict
Addict
Posts: 1479
Joined: Mon May 26, 2003 3:07 pm
Location: Nantes

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by eddy »

Code: Select all

EffectName$
Is it an external script ?
Imagewin10 x64 5.72 | IDE | PB plugin | Tools | Sprite | JSON | visual tool
User avatar
greyhoundcode
Enthusiast
Enthusiast
Posts: 108
Joined: Sun Dec 30, 2007 7:24 pm

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by greyhoundcode »

Fantastic, particularly excited about CanvasGadget() - is this inspired by this thread?

Going to do some playing around, looking forward to some docs and examples. Excellent work as always. :D
User avatar
idle
Always Here
Always Here
Posts: 5042
Joined: Fri Sep 21, 2007 5:52 am
Location: New Zealand

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by idle »

thanks, thats quite an update.
Windows 11, Manjaro, Raspberry Pi OS
Image
eesau
Enthusiast
Enthusiast
Posts: 589
Joined: Fri Apr 27, 2007 12:38 pm
Location: Finland

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by eesau »

Thank you x1000, great work! I guess I'll port my 3D project to native PureBasic now 8)
User avatar
bembulak
Enthusiast
Enthusiast
Posts: 572
Joined: Mon Mar 06, 2006 3:53 pm
Location: Austria

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by bembulak »

Thanks a lot!

Edit: the new Webgadget on Linux works like a charm out of the box on Linux Mint 10/Julia! Great!
cheers,

bembulak
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by c4s »

Thanks! 8)
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
marc_256
Enthusiast
Enthusiast
Posts: 743
Joined: Thu May 06, 2010 10:16 am
Location: Belgium
Contact:

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by marc_256 »

Thanks,

it is great, the update to ogre 1.7.0

Good work...

Marc
- every professional was once an amateur - greetings from Pajottenland - Belgium -
PS: sorry for my english I speak flemish ...
Trond
Always Here
Always Here
Posts: 7446
Joined: Mon Sep 22, 2003 6:45 pm
Location: Norway

Re: PureBasic 4.60 Beta 1 released! (for real)

Post by Trond »

I'm looking forward to trying the canvas. And what is the difference between ODE and Bullet?
Post Reply