Page 1 of 4

PureBasic 4.60 Beta 1 released! (for real)

Posted: Sun Apr 03, 2011 11:41 pm
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

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

Posted: Sun Apr 03, 2011 11:46 pm
by eddy
great @ !!

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

Posted: Sun Apr 03, 2011 11:49 pm
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

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

Posted: Sun Apr 03, 2011 11:50 pm
by ts-soft
:D
thanks, great news.

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

Posted: Sun Apr 03, 2011 11:57 pm
by LuCiFeR[SD]
Good news indeed! I shall enjoy experimenting I think :P

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

Posted: Sun Apr 03, 2011 11:58 pm
by Arctic Fox
Nice one!
Thanks a lot :D

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

Posted: Mon Apr 04, 2011 12:04 am
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.

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

Posted: Mon Apr 04, 2011 12:17 am
by eddy

Code: Select all

EffectName$
Is it an external script ?

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

Posted: Mon Apr 04, 2011 4:37 am
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

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

Posted: Mon Apr 04, 2011 5:28 am
by idle
thanks, thats quite an update.

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

Posted: Mon Apr 04, 2011 6:11 am
by eesau
Thank you x1000, great work! I guess I'll port my 3D project to native PureBasic now 8)

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

Posted: Mon Apr 04, 2011 7:20 am
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!

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

Posted: Mon Apr 04, 2011 10:31 am
by c4s
Thanks! 8)

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

Posted: Mon Apr 04, 2011 12:51 pm
by marc_256
Thanks,

it is great, the update to ogre 1.7.0

Good work...

Marc

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

Posted: Mon Apr 04, 2011 1:20 pm
by Trond
I'm looking forward to trying the canvas. And what is the difference between ODE and Bullet?