Page 1 of 17

PureBasic 5.70 LTS is out !

Posted: Wed May 30, 2018 10:33 pm
by Fred
Hello everybody,

- Final version is out, thank you all for testing !

Happy New Year !



- beta 4 is out, with use usual bug fixes and the completed doc (translated). Thanks to Andre and Mesa for it !

- beta 3 is out ! The doc for the new commands is now finished feel free to check it, and the usual bugs fixes.

- beta 2 is out ! It tooks some time but we come back with the usual bug fixes and some new commands:

Code: Select all

- HTTPRequest() and HTTPRequestMemory() to call REST api easily (sponsored by c-wayne)
- UseMySQLDatabase() which use the opensource libmariadb.dll (found in purebasic\compilers\ dir) and brings MySQL and MariaDB support natively to PureBasic ! (sponsored by Paul)
- MaterialTextureAliases() which allow to bind a PureBasic texture to an alias for use in a script
After a long delay (currently due to lack of time in my personal life, which I hope will get better soon), here is the first beta of the 5.70 LTS version which brings a bunch of new things ! First, a big thanks to Timo (Fr34k) who did a brand new subsystem for Linux: QT :). Thanks to Guillot and Comtois for the new 3D functions ! Other cool stuffs are available, for example DPI support for Windows (the IDE is compiled with this switch on so you can test). Here is the full list of changes:

Code: Select all

- Added: Brand new QT subsystem for Linux
- Added: DPI aware support for Windows app (/DPIAWARE compiler switch and DPI Aware check in IDE)
- Added: #PS, #NPS, #PS$ and #NPS$ constants (Path seperator character depending of the OS)
- Added: #PB_JSON_NoClear support to ExtractJSONStructure
- Added: #PB_Path_Winding filling mode for VectorDrawing
- Added: DesktopResolutionX(), DesktopResolutionY(), DesktopScaleX(), DesktopScaleY(), DesktopUnscaleX(), DesktopUnscaleY()
- Added: an optional 'Mode' parameter for OpenConsole() to specify the string format to use
- Added: #PB_Vehicle_IsInContact, #PB_Vehicle_ContactPointX/Y/Z, #PB_Vehicle_ContactPointY/Z for GetVehicleAttribute()
- Added: #PB_Vehicle_ContactPointNormalX/Y/Z, #PB_Vehicle_ContactPointNormalY/Z, #PB_Vehicle_CurrentSpeedKmHour, #PB_Vehicle_ForwardVectorX/Y/Z
- Added: #PB_Material_ProjectiveTexturing for SetMaterialAttribute()
- Added: ParticleScaleRate(), ParticleAngle(), CameraReflection()
- Added: BuildMeshManualLod(), BuildMeshLod(), MeshVertex(), CreateDataMesh()
- Added: EntityDirection(), EntityDirectionX(), EntityDirectionY(), EntityDirectionZ()
- Added: #PB_Local/#PB_Parent/#PB_World support for ApplyEntityForce(), ApplyEntityImpulse(), ApplyEntityTorque() and ApplyEntityTorqueImpulse()
Have fun and don't hesitate to reports any found issues !

The Fantaisie Software Team

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed May 30, 2018 10:42 pm
by Fred
Here are a few example for the new 3D functions:

Code: Select all

; ----------------------------------------------------------------------------------------------------------
;   CreateDataMesh(mesh, VertexData())
; ----------------------------------------------------------------------------------------------------------

InitEngine3D():InitSprite():InitKeyboard():InitMouse()
ExamineDesktops()
ex=DesktopWidth (0)*0.75
ey=DesktopHeight(0)*0.75
OpenWindow(0, 0,0, ex,ey, "Test 3d - [F1, F2, F3, F4] - Change sample - [F12] Wireframe -  [Esc] quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, ex, ey, 0, 0, 0)

Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures",#PB_3DArchive_FileSystem)
Parse3DScripts()

CreateCamera(0, 0, 0, 100, 100):MoveCamera(0,0,0,-20)
CreateLight(0,$777777, 10000, 10000, 0000)
AmbientColor($777777)

LoadTexture(0, "dirt.jpg")
CreateMaterial(0,TextureID(0))
SetMaterialColor(0,#PB_Material_AmbientColor,-1)
MaterialCullingMode(0,#PB_Material_NoCulling)

Procedure mesh_samples(n)
Select n
  Case 1; -------------------------------snail shell [F1]
    Dim t.PB_MeshVertex(32,128)
    Define.f ai,aj,sx,sy,c.b,   r=15,rs
    For j=0 To 128
      For i=0 To 32
        With t(i,j)  
          ai=i*2*#PI/32
          aj=j*2*#PI/32               
          sx=Sin(ai)*r+r
          sy=Cos(ai)*r
          \x=Cos(aj)*sx
          \y=15*2-r*2+sy
          \z=Sin(aj)*sx       
          \u=i/4
          \v=j/4
          c=255:If j %3=0:c=0:EndIf
          \color=RGB(c,c,c)
        EndWith 
      Next
      r*0.98
    Next
  Case 2; -------------------------------sinus [F2]
    Dim t.PB_MeshVertex(64,64)
    For j=0 To 64
      For i=0 To 64
        With t(i,j)      
          \x=(i-32)
          \z=(j-32)
          \y=Sin(i/4)*Sin(j/4)*4
          \u=i/16
          \v=j/16
          \color=RGB(i*3.9,j*3.9,0)
        EndWith 
      Next
    Next
  Case 3; ------------------------------- circles - aligned vertices [F3]
    Dim t.PB_MeshVertex(32,32)
    For j=0 To 32
      For i=0 To 32
        With t(i,j)      
          \x=(i-16)*2
          \z=(j-16)*2
          \u=i/16
          \v=j/16
        EndWith 
      Next
    Next
    For j=2 To 14 Step 4
      For i=0 To 400
        ai=i/400*2*#PI
        sx=16+Cos(ai)*j
        sy=16+Sin(ai)*j
        With t(Int(sx+0.5),Int(sy+0.5))
          \y=10
          \color=RGB(255-j*16,0,j*16)
        EndWith  
      Next
    Next
  Case 4 ; ------------------------------- circles - non-aligned vertices [F4]
    Dim t.PB_MeshVertex(32,32)
    For j=0 To 32
      For i=0 To 32
        With t(i,j)      
          \x=(i-16)*2
          \z=(j-16)*2
          \u=i/16
          \v=j/16
        EndWith 
      Next
    Next
    For j=2 To 14 Step 4
      For i=0 To 200
        ai=i/200*2*#PI
        sx=16+Cos(ai)*j
        sy=16+Sin(ai)*j
        With t(Int(sx+0.5),Int(sy+0.5))
          \x=(sx-16)*2
          \y=10
          \z=(sy-16)*2
          \color=RGB(255-j*16,0,j*16)
        EndWith
      Next
    Next   
EndSelect

CreateDataMesh(0,t())
NormalizeMesh(mesh)
CreateEntity(0,MeshID(0),MaterialID(0))
EndProcedure

dist=50
mesh_samples(1)
Repeat
  ExamineMouse()
  ExamineKeyboard()
  If KeyboardReleased(#PB_Key_F1):mesh_samples(1):EndIf
  If KeyboardReleased(#PB_Key_F2):mesh_samples(2):EndIf
  If KeyboardReleased(#PB_Key_F3):mesh_samples(3):EndIf
  If KeyboardReleased(#PB_Key_F4):mesh_samples(4):EndIf
  If KeyboardReleased(#PB_Key_F12):fdf=1-fdf:If fdf:CameraRenderMode(0,#PB_Camera_Wireframe):Else:CameraRenderMode(0,#PB_Camera_Textured):EndIf:EndIf
  a.f+0.01
  MoveCamera(0,Cos(a)*dist,dist*1,Sin(a)*dist,0)
  CameraLookAt(0,0,0,0)
  RenderWorld()
  FlipBuffers()    
Until WindowEvent() = #PB_Event_CloseWindow Or KeyboardReleased(#PB_Key_Escape)

Code: Select all

;----------------------------------------------------------------------------------------------------------
;   PBO_CreateMeshManualLod( mesh.i, meshlod.i, distance.f)
;----------------------------------------------------------------------------------------------------------

Procedure.f POM(v.f)
  ProcedureReturn (Random(v*1000)-v*500)/500
EndProcedure

;----------------------------------------------------------------------------------------------------
Define i
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
OpenWindow(0, 0, 0, 0,0, "Test 3d >>> mouse + cursor - F12 Wireframe - Esc to quit",#PB_Window_Maximize)
ex=WindowWidth (0,#PB_Window_InnerCoordinate)
ey=WindowHeight(0,#PB_Window_InnerCoordinate)
OpenWindowedScreen(WindowID(0), 0, 0, ex, ey, 0, 0, 0)

Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem):Parse3DScripts()

CreateCamera(0, 0, 0, 100, 100)
MoveCamera(0,0,0,-256)
CameraLookAt(0, 0,0,0)
CameraBackColor(0,$ff8888) 
CreateLight(0,$ffffff, 10000, 5000, 2000)
AmbientColor($444444)

LoadTexture(0, "dirt.jpg")

CreateMaterial(0,TextureID(0))
ScaleMaterial(0,1/2,1/2)


Procedure test_lod(manual)
  CreateIcoSphere(0,10,4):SetMeshMaterial(0,MaterialID(0))
  If manual
    CreateIcoSphere(1,10,3):SetMeshMaterial(1,MaterialID(0)):BuildMeshManualLod(0,1,100)
    CreateIcoSphere(2,10,2):SetMeshMaterial(2,MaterialID(0)):BuildMeshManualLod(0,2,200)
    CreateIcoSphere(3,10,1):SetMeshMaterial(3,MaterialID(0)):BuildMeshManualLod(0,3,400)
  Else
    BuildMeshLod(0,3,100,0.75)
  EndIf
  
  For i=0 To 1000
    CreateEntity(i,MeshID(0),#PB_Material_None,pom(256),pom(256),pom(256))
    ScaleEntity(i,1,1+pom(0.7),1)
    RotateEntity(i,pom(180),pom(180),pom(180))
  Next
EndProcedure

Procedure affiche3d()
  Static.f MouseX,Mousey,keyx,keyy,keyz,a,  fdf
  Protected i,event,transit=200
  
  Repeat
    event=WindowEvent()  
    ExamineMouse()
    MouseX = -MouseDeltaX() *  0.05
    MouseY = -MouseDeltaY() *  0.05
    ExamineKeyboard()
    keyx=(-Bool(KeyboardPushed(#PB_Key_Left)<>0)+Bool(KeyboardPushed(#PB_Key_Right)<>0))*0.2
    keyz=(-Bool(KeyboardPushed(#PB_Key_Down)<>0)+Bool(KeyboardPushed(#PB_Key_Up   )<>0))*0.2+MouseWheel()*10
    If KeyboardReleased(#PB_Key_F12):fdf=1-fdf:If fdf:CameraRenderMode(0,#PB_Camera_Wireframe):Else:CameraRenderMode(0,#PB_Camera_Textured):EndIf:EndIf
    RotateCamera(0, MouseY, MouseX, 0, #PB_Relative):MoveCamera  (0, KeyX, 0, -keyz)
    RenderWorld()
    FlipBuffers()
  Until event=#PB_Event_CloseWindow  Or KeyboardPushed(#PB_Key_Escape)
EndProcedure

test_lod(1)
affiche3d()

Code: Select all

;--------------------------------------------------------------
; ParticleScaleRate(particleID, scalerate.f) and other new functions
; -----------------------------------------------


InitEngine3D():InitSprite():InitKeyboard():InitMouse()
OpenWindow(0, 0, 0, 0,0, "",#PB_Window_Maximize|#PB_Window_BorderLess)
ex=WindowWidth (0,#PB_Window_InnerCoordinate)
ey=WindowHeight(0,#PB_Window_InnerCoordinate)
OpenWindowedScreen(WindowID(0), 0, 0, ex, ey, 0, 0, 0)

Add3DArchive("medias/",#PB_3DArchive_FileSystem)
Parse3DScripts()

CreateCamera(0, 0, 0, 100, 100)
CameraBackColor(0,$884444)

LoadTexture(0, "dirt.jpg")
CreateMaterial(0, TextureID(0))
CreatePlane (0,1000,1000,1,1,32,32):CreateEntity(0, MeshID(0), MaterialID(0),0,0,0)

LoadTexture(1, "smoke2.png")
CreateMaterial(1, TextureID(1))
DisableMaterialLighting(1, 1)
MaterialBlendingMode   (1, #PB_Material_AlphaBlend)
SetMaterialAttribute(1,#PB_Material_TAM,#PB_Material_ClampTAM)

LoadTexture(2, "flare.png")
CreateMaterial(2, TextureID(2))
DisableMaterialLighting(2, 1)
MaterialBlendingMode   (2, #PB_Material_Add)

LoadTexture(3, "flaretrail.png")
CreateMaterial(3, TextureID(3))
DisableMaterialLighting(3, 1)
MaterialBlendingMode   (3, #PB_Material_Add)
SetMaterialAttribute(3,#PB_Material_TAM,#PB_Material_ClampTAM)

LoadTexture(4, "water.png")
CreateMaterial(4, TextureID(4))
DisableMaterialLighting(4, 1)
MaterialBlendingMode   (4, #PB_Material_AlphaBlend)
SetMaterialAttribute(4,#PB_Material_TAM,#PB_Material_ClampTAM)


;emetteur 1 : feu
;----------------

CreateParticleEmitter(1, 0, 0, 0, 0,50,5,50)
ParticleMaterial    (1, MaterialID(1))
ParticleSize        (1, 3,3)
ParticleColorRange(1, $00ffff, $0000ff)
ParticleColorFader(1, -1, -1, -1, -0.5)
ParticleEmitterDirection(1, 0, 1, 0)
ParticleEmitterAngle(1,30)
ParticleTimeToLive  (1, 2,2)
ParticleVelocity(1, 2,20)
ParticleAcceleration(1, 0.2, 0, 0)
ParticleScaleRate(1,5)
ParticleAngle(1,-180,180,-90,90)
ParticleEmissionRate(1, 50)


;emetteur 2 : jet d'eau
;---------------------------
CreateParticleEmitter(2, 0, 0, 0, 0, -50,0,50)
ParticleMaterial    (2, MaterialID(4))
ParticleSize        (2, 1,1):ParticleScaleRate(2,5)
ParticleColorFader(2, 0, 0, 0, -0.4)
ParticleEmitterDirection(2, 0, 1, 0)
ParticleTimeToLive  (2, 2,2)
ParticleVelocity(2, 2,100)
ParticleAcceleration(2, 0, -1, 0)
ParticleEmitterAngle(2,5)
ParticleAngle(2,-180,180,-180,180)
ParticleEmissionRate(2, 100)


;emetteur 3 : neige
;------------------
CreateParticleEmitter(3, 50, 50, 0, 0, 50,40,-50)
ParticleMaterial    (3, MaterialID(2))
ParticleSize        (3, 2, 2)
ParticleEmitterDirection(3, 0, 1, 0)
ParticleTimeToLive  (3, 4,4)
ParticleVelocity(3, 2,-10)
ParticleEmissionRate(3, 50)


;emetteur 4 : feu d'artifice
;---------------------------
CreateParticleEmitter(4, 0, 0, 0, 0, -50,5,-50)
ParticleMaterial    (4, MaterialID(3))
ParticleSize        (4, 10,10)
ParticleColorRange(4, $ff0088, $0088ff)
ParticleEmitterDirection(4, 0, 1, 0)
ParticleEmitterAngle(4,30)
ParticleTimeToLive  (4, 1.5,1.5)
ParticleVelocity(4, 2,80)
ParticleAcceleration(4, 0, -1, 0)
ParticleAngle(4,0,0,0,360)
ParticleEmissionRate(4, 100)

;emetteur 5 : torche multicolor
;-----------------------------
CreateParticleEmitter(5, 0, 0, 0, 0, 0,0,0)
ParticleMaterial    (5, MaterialID(1))
ParticleSize        (5, 1,1)
ParticleEmissionRate(5, 25)
ParticleColorRange(5, $00ff00, $ffff00)
ParticleColorFader(5, 0.5, 0, 0, -0.5)
ParticleTimeToLive  (5, 2, 2)
ParticleVelocity(5, 2,30)
ParticleEmitterAngle(5,5)
ParticleScaleRate(5,8)
ParticleAngle(5,-180,180,-90,90)
ParticleEmitterDirection(5, 0, 1, 0)

;emetteur 6 : circulaire rouge
;-----------------------------
CreateParticleEmitter(6, 0, 0, 0, 0, 0,0,0)
ParticleMaterial    (6, MaterialID(2))
ParticleSize        (6, 4,4)
ParticleEmissionRate(6, 40)
ParticleColorRange(6, $0000ff, $0000ff)
;ParticleColorFader(6, -0.5, -0.5, -0.5, 0)
ParticleScaleRate(6,-2)
ParticleTimeToLive  (6, 2, 2)
ParticleVelocity(6, 2,0)


Repeat
  ExamineKeyboard()
  a.f+0.005
  MoveCamera(0,Cos(a)*120,30,Sin(a)*120,0)
  ParticleEmitterDirection(5, Sin(a*5), 1, Cos(a*5))
  MoveParticleEmitter(6, Sin(a*5)*20, 2, Cos(a*5)*20,#PB_Absolute)
  CameraLookAt(0,0,0,0)
  RenderWorld()
  FlipBuffers()    
Until WindowEvent() = #PB_Event_CloseWindow Or KeyboardReleased(#PB_Key_Escape)
End

Code: Select all

;----------------------------------------------------------------------------------------------------------
;   CameraReflection(cameraR,cameraP,EntityID)
;----------------------------------------------------------------------------------------------------------

#PB_UNIT_Y=1

Procedure.f POM(v.f)
  ProcedureReturn (Random(v*1000)-v*500)/500
EndProcedure

;----------------------------------------------------------------------------------------------------
Global ex,ey,r.f=0.8
Define i
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
  ExamineDesktops()
  ex=DesktopWidth(0)*r
  ey=DesktopHeight(0)*r
OpenWindow(0, 0, 0,ex,ey, "Test 3d >>> cursor up/down: height of the reflection plan ,  left/right: angle of the reflection plan  - Esc to quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, ex, ey, 0, 0, 0)

Procedure material(n,nom.s,scale.f=1)
   LoadTexture(n, nom)
  CreateMaterial(n,TextureID(n))
  ScaleMaterial(n,0.5/scale,1/scale)
EndProcedure

Procedure test_reflexion()
  Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
  Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Packs/desert.zip", #PB_3DArchive_Zip)
  Parse3DScripts()
  
  SkyBox("desert07.jpg")
  
  CreateCamera(0, 0, 0, 100, 100)
  MoveCamera(0,0,20,-40)
  CameraLookAt(0, 0,0,0)
  CreateLight(0,$ffffff, 10000, 5000, 2000)
  AmbientColor($888888)
  
  CreateCamera(1,0,0,100,100)  
  CreateRenderTexture(0,CameraID(1),ex/1,ey/1)
  CreateMaterial(1,TextureID(0))
  DisableDebugger
  SetMaterialAttribute(1,#PB_Material_ProjectiveTexturing,1)
  EnableDebugger
  LoadTexture(1, "MRAMOR6X6.jpg")
  AddMaterialLayer(1,TextureID(1),#PB_Material_Modulate)
  CreatePlane(1,100,100,1,1,4,4)
  CreateEntity(1,MeshID(1),MaterialID(1))
  
  material(2, "RustySteel.jpg",2)
  material(3, "dirt.jpg",2)
  material(4, "soil_wall.jpg",2)
  material(5, "wood.jpg",8)

  CreateIcoSphere(0,3,3)
   For i=100 To 150
    CreateEntity(i,MeshID(0),MaterialID(2+Random(3)),pom(32),pom(4),pom(32))
    ScaleEntity(i,1,1+pom(0.7),1)
    RotateEntity(i,pom(180),pom(180),pom(180))
  Next
  
EndProcedure


Procedure affiche3d()
  Protected.f MouseX,Mousey,  a, ap,dp,  co,si
  Protected event,  fdf
  
  Repeat
    event=WindowEvent()  
    ExamineMouse()
    MouseX = -MouseDeltaX() *  0.05
    MouseY = -MouseDeltaY() *  0.05
    ExamineKeyboard()
    ap+(-Bool(KeyboardPushed(#PB_Key_Left))+Bool(KeyboardPushed(#PB_Key_Right)))*0.01
    dp-(-Bool(KeyboardPushed(#PB_Key_Down))+Bool(KeyboardPushed(#PB_Key_Up   )))*0.1
    If KeyboardReleased(#PB_Key_F12):fdf=1-fdf:If fdf:CameraRenderMode(0,#PB_Camera_Wireframe):Else:CameraRenderMode(0,#PB_Camera_Textured):EndIf:EndIf
    a+0.002
    MoveCamera(0,Cos(a)*50,10,Sin(a)*50,#PB_Absolute)
    CameraLookAt(0,0,0,0)
       
    co=Cos(ap)
    si=Sin(ap)
    MoveEntity(1,si*dp,-co*dp,0,0)
    ;EntityDirection(1, si, co, 0, #PB_World, 2)
    EntityDirection(1, si, co, 0, #PB_World, #PB_UNIT_Y)
    
    CameraReflection(1,0,EntityID(1))  
    RenderWorld()
    FlipBuffers()
  Until event=#PB_Event_CloseWindow  Or KeyboardPushed(#PB_Key_Escape)
EndProcedure

test_reflexion()
affiche3d()

Code: Select all

; ----------------------------------------------------------------------------------------------------------
;   #PB_Material_ProjectiveTexturing
; ----------------------------------------------------------------------------------------------------------

Procedure.f POM(v.f)
  ProcedureReturn (Random(v*1000)-v*500)/500
EndProcedure

;----------------------------------------------------------------------------------------------------
Global ex,ey,r.f=0.8
Define i
InitEngine3D():InitSprite():InitKeyboard():InitMouse()
ExamineDesktops()
ex=DesktopWidth(0)*r
ey=DesktopHeight(0)*r
OpenWindow(0, 0, 0,ex,ey, "Test 3d >>> arrow keys to move the projector - Esc to quit",#PB_Window_ScreenCentered)
OpenWindowedScreen(WindowID(0), 0, 0, ex, ey, 0, 0, 0)

Procedure material(n,nom.s,scale.f=1)
  LoadTexture(n, nom)
  CreateMaterial(n,TextureID(n))
  ScaleMaterial(n,1/scale,1/scale)
EndProcedure

Procedure test()
  Add3DArchive(#PB_Compiler_Home + "examples/3d/Data/Textures", #PB_3DArchive_FileSystem)
  Parse3DScripts()
  
  material(1, "grass.jpg",2)
  material(2, "dirt.jpg",2)
  material(3, "RustySteel.jpg",2)
  
  CreateCamera(0, 0, 0, 100, 100)
  MoveCamera(0,0,80,-80)
  CameraLookAt(0, 0,0,0)
  CreateLight(0,$ffffff, 10000, 5000, 2000)
  AmbientColor($888888)
  
  CreateCamera(1,0,0,2,4)  
  CameraFOV(1,40)
  MoveCamera(1,0,80,0)
  SwitchCamera(1,0)  
  
  For i=1 To 3
    LoadTexture(0,  "Valetcoeur.jpg")
    AddMaterialLayer(i,TextureID(0),#PB_Material_Add)
    SetMaterialAttribute(i,#PB_Material_ProjectiveTexturing,1,1)
    SetMaterialAttribute(i,#PB_Material_TAM,#PB_Material_BorderTAM,1)
  Next
  CreatePlane(1,200,200,1,1,4,4)
  CreateEntity(1,MeshID(1),MaterialID(1))
  CreateIcoSphere(0,15,3)
  For i=2 To 50
    CreateEntity(i,MeshID(0),MaterialID(Random(3,2)),pom(80),pom(0),pom(80))
    ScaleEntity(i,1+pom(0.5),0.5,1+pom(0.5))
    RotateEntity(i,0,pom(180),0)
  Next
  
EndProcedure

Procedure affiche3d()
  Protected.f MouseX,Mousey, cx,cz=1
  Protected event,  fdf
  
  Repeat
    event=WindowEvent()  
    ExamineMouse()
    MouseX = -MouseDeltaX() *  0.05
    MouseY = -MouseDeltaY() *  0.05
    ExamineKeyboard()
    cx-(-Bool(KeyboardPushed(#PB_Key_Left))+Bool(KeyboardPushed(#PB_Key_Right)))*1
    cz+(-Bool(KeyboardPushed(#PB_Key_Down))+Bool(KeyboardPushed(#PB_Key_Up   )))*1
    If KeyboardReleased(#PB_Key_F12):fdf=1-fdf:If fdf:CameraRenderMode(0,#PB_Camera_Wireframe):Else:CameraRenderMode(0,#PB_Camera_Textured):EndIf:EndIf
    CameraLookAt(1,cx,0,cz)   
    CreateLine3D(100,CameraX(1),CameraY(1),CameraY(1),$ffffff,cx,0,cz,$ffffff)
    RenderWorld()
    FlipBuffers()
  Until event=#PB_Event_CloseWindow  Or KeyboardPushed(#PB_Key_Escape)
EndProcedure

test()
affiche3d()

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed May 30, 2018 10:45 pm
by MrMat
Nice job!

The DPI scaling isn't quite right (compare old and new toolbar):
https://postimg.cc/image/67quk0trv/
Menu icons aren't scaled properly either.

But the text is so much clearer now! Thank you!

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed May 30, 2018 10:48 pm
by Fred
About the DPI aware feature, it's currently Windows only and works automatically: all GUI elements are scaled automatically depending of the monitor DPI settings. That means than you can still create your GUI using absolute values, it will scale correctly. That said, some gadget (like CanvasGadget(), ImageGadget() etc.) won't scale their content automatically, so you will need to use the new Desktop DPI functions to allow proper support. The IDE has been adapted for DPI support in a very short time, with only canvas based gadget which needed some adjustment. Dialog library is also fully DPI compliant ! :)

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed May 30, 2018 11:01 pm
by MrMat
Thanks Fred.

The autocomplete window gets a bit lost too:
https://postimg.cc/image/rehr8pgtn/

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed May 30, 2018 11:04 pm
by IdeasVacuum
DPI aware support for Windows - that's much needed Fred, many thanks.

Personal life? I thought PB was your first love.........

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed May 30, 2018 11:05 pm
by Kuron
Wow!!! Thank you Fred and team!!! An awesome update!!!

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Wed May 30, 2018 11:33 pm
by walbus
A first test on Win x64 looks, it run fine with the GFX_Wizzard_BF
Tested with 170 different demo codes, no bugs or problems found to time

The GIF invisible color bug is apparently not fixed
So the post processing of the GIF frames will remain difficult because the invisible color cannot be determined.

Whether the color of the canvas can now be pre-set I could not test ?

After this code about 1.9GB are not free, it looks, its the =<562 string bug

Code: Select all

a$=Space(1e9)
a$=""
Repeat
ForEver

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Thu May 31, 2018 3:58 am
by Josh
Fred wrote:

Code: Select all

- Added: an optional 'Mode' parameter for OpenConsole() to specify the string format to use
Would make sense, if this Parameter would be available for other Console-commands too. I.E. see here

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Thu May 31, 2018 6:29 am
by davido
Looks great. :D
Thanks, Fred and team.

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Thu May 31, 2018 6:36 am
by HanPBF
Thanks for 5.70b1

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Thu May 31, 2018 7:02 am
by marc_256
Thanks to the team for the new version...
for me especially thanks to Guillot and Comtois for the new 3D functions ! :D
love it ...

marc

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Thu May 31, 2018 7:23 am
by TI-994A
Fred wrote:

Code: Select all

- Added: DPI aware support for Windows app (/DPIAWARE compiler switch and DPI Aware check in IDE)
- Added: DesktopResolutionX(), DesktopResolutionY(), DesktopScaleX(), DesktopScaleY(), DesktopUnscaleX(), DesktopUnscaleY()
That's simply lovely! Thank you Team PureBasic. :D

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Thu May 31, 2018 7:24 am
by djes
Thank you all ! Hey, a family needs time, and is first on the ToDo list !

Re: PureBasic 5.70 LTS beta 1 is out !

Posted: Thu May 31, 2018 7:44 am
by useful
Ubuntu 18.04(64) start IDE = segmentation fault
XUbuntu 16.04(64) start IDE = segmentation fault
Lubuntu 18.04(32) start IDE = segmentation fault

checkinstall.sh OLD!!!!!!!
What has changed in the dependencies for QT???