PureBasic 5.30 beta 9 released!

Developed or developing a new product in PureBasic? Tell the world about it.
User avatar
Regenduft
Enthusiast
Enthusiast
Posts: 121
Joined: Mon Mar 02, 2009 9:20 pm
Location: Germany

Re: PureBasic 5.30 beta 1 released!

Post by Regenduft »

Nice list of new features! :D
freak wrote:[*] The IDE and debugger are now full unicode programs
Yahoo! Thank you! Finally no more problems with umlauts in paths anymore!

The "#SOH" bug in the macro error report window should also be history now! ...At least when the new "only show the first letter" bug is fixed... I'll report it soon! :wink:
User avatar
luis
Addict
Addict
Posts: 3893
Joined: Wed Aug 31, 2005 11:09 pm
Location: Italy

Re: PureBasic 5.30 beta 1 released!

Post by luis »

julesd wrote:What version of Opengl is the opengl gadget capable of

It depends on how the rendering context is created and how your driver respond to its creation request since up to a certain point can be implementation dependent, also it depends on what is the highest GL version implemented by the driver.
I think PB just creates a RC using the basic, legacy way. In that case you will probably get access to the highest GL version implemented in your driver which is also able to supply a compatible profile. Usually this means 3.0, 3.1 + GL_ARB_compatibility or 3.2 compatibility profile.
To be sure we should see the code used by PB to create the context.

AFAIK glGetString_(#GL_VERSION) only returns the GL version supported by the driver but it's not indicative of what your RC is capable of, depending on how it has been created.

<EDIT>
Just found out I was wrong:
Querying the GL_VERSION string with glGetString (or the
GL_MAJOR_VERSION and GL_MINOR_VERSION values with glGetIntegerv, in
a 3.0 or later context) will return the actual version supported by
a context.
</EDIT>
Last edited by luis on Fri Jun 20, 2014 5:04 pm, edited 1 time in total.
"Have you tried turning it off and on again ?"
A little PureBasic review
User avatar
skywalk
Addict
Addict
Posts: 4210
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: PureBasic 5.30 beta 1 released!

Post by skywalk »

Very nice!
The #PB_Event_SizeWindow and #PB_Event_MoveWindow events still fire eventually and do not break my code. (I was worried about the "no longer reported in realtime in the main event loop" comment.)
The text editing feature is great too. Now I can edit my resource and txt documents within the IDE.
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
PB
PureBasic Expert
PureBasic Expert
Posts: 7581
Joined: Fri Apr 25, 2003 5:24 pm

Re: PureBasic 5.30 beta 1 released!

Post by PB »

> I no longer have access to my account and can't download updates

My account also uses an old email address that no longer exists,
but luckily I know what it is so I can log in. But, speak to Fred.
I'm sure he can work something out for you. No need to buy it
again, unless you want to think of it as a donation. ;)
I compile using 5.31 (x86) on Win 7 Ultimate (64-bit).
"PureBasic won't be object oriented, period" - Fred.
User avatar
Kuron
Addict
Addict
Posts: 1626
Joined: Sat Oct 17, 2009 10:51 pm
Location: Pacific Northwest

Re: PureBasic 5.30 beta 1 released!

Post by Kuron »

PB wrote:No need to buy it
again, unless you want to think of it as a donation. ;)
I have been out of work for five months due to a hand injury, so no, no donations. At $108 USD, I am not swinging PB anytime soon. Birthday is in January, and I have already asked for PB as a bday gift. I will have to wait until then to get things sorted as there is no way in hell I can find the purchase receipt from 10+ years ago to prove I bought it.
Best wishes to the PB community. Thank you for the memories. ♥️
User avatar
oreopa
Enthusiast
Enthusiast
Posts: 283
Joined: Sat Jun 24, 2006 3:29 am
Location: Edinburgh, Scotland.

Re: PureBasic 5.30 beta 1 released!

Post by oreopa »

skywalk wrote:Very nice!
The #PB_Event_SizeWindow and #PB_Event_MoveWindow events still fire eventually and do not break my code. (I was worried about the "no longer reported in realtime in the main event loop" comment.)
I was a little worried too about the #PB_Event_SizeWindow... I shouldn't have been. It did totally break my resize code due to it not being realtime anymore, but simply moving the related things into a Procedure and using BindEvent worked a treat. No difference to before afaics. Thx team!
Proud supporter of PB! * Musician * C64/6502 Freak
User avatar
Regenduft
Enthusiast
Enthusiast
Posts: 121
Joined: Mon Mar 02, 2009 9:20 pm
Location: Germany

Re: PureBasic 5.30 beta 1 released!

Post by Regenduft »

[offtopic]
Kuron wrote:I have been out of work for five months due to a hand injury, so no, no donations. At $108 USD, I am not swinging PB anytime soon.
In Germany the sickness benefit is 70% of your last income, the disablement benefit is about 900 EUR (about 1226 USD) and the unemployment benefit for long term unemployed is about 380 EUR + rent payment = about 700 EUR (about 950 USD).

When hearing such a story about 108 USD im not sure if I should feel happy or feel ashamed...
I haven't thought that the difference between anglo-saxon economy and social market economy is THAT big! :shock:

[/offtopic]
User avatar
Bananenfreak
Enthusiast
Enthusiast
Posts: 519
Joined: Mon Apr 15, 2013 12:22 pm

Re: PureBasic 5.30 beta 1 released!

Post by Bananenfreak »

Fred wrote:Hydrax is built as an "unlimited" waterplane by design, that's why it can't be sized.
Oh, ok, sorry. I thought there was the possibility to size the waterplane.
Image
User avatar
electrochrisso
Addict
Addict
Posts: 989
Joined: Mon May 14, 2007 2:13 am
Location: Darling River

Re: PureBasic 5.30 beta 1 released!

Post by electrochrisso »

8) stuff, thanks guys.
PureBasic! Purely the best 8)
Fred
Administrator
Administrator
Posts: 18153
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: PureBasic 5.30 beta 2 released!

Post by Fred »

Beta 2 is out, with some bug fixes (mainly the OS X startup issue)
User avatar
bbanelli
Enthusiast
Enthusiast
Posts: 544
Joined: Tue May 28, 2013 10:51 pm
Location: Europe
Contact:

Re: PureBasic 5.30 beta 2 released!

Post by bbanelli »

You make it impossible to resist to make a donation, although small, but...

Great job, as always!
"If you lie to the compiler, it will get its revenge."
Henry Spencer
https://www.pci-z.com/
User avatar
grabiller
Enthusiast
Enthusiast
Posts: 309
Joined: Wed Jun 01, 2011 9:38 am
Location: France - 89220 Rogny-Les-Septs-Ecluses
Contact:

Re: PureBasic 5.30 beta 2 released!

Post by grabiller »

Thanks a lot for the OpenGLGadget()!.

A suggestion though: Could we have a GetGadgetAttribute with

Code: Select all

#PB_OpenGL_ProcAddress
(or something) so we can retrieve all the OpenGL extensions and use the full potential of the latest OpenGL versions ?

Also having a way to choose the core/profile and OpenGL version would be a plus, but the #PB_OpenGL_ProcAddress is much more vital for now.

That said, thanks again for this Gadget, this has been awaited for a longtime.

Back in business ;-)

Cheers,
Guy.
guy rabiller | radfac founder / ceo | raafal.org
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: PureBasic 5.30 beta 2 released!

Post by DK_PETER »

WOW! PB 5.30 Beta 2 ? :shock:

Thank you!!

Code: Select all

;Thank you very much team.
;The coolest release to date!

InitEngine3D()
InitSprite()
InitKeyboard()
InitMouse()


DeclareModule _TrainYard
  
  Declare.i SetResolution()  
  Declare.i RunDemo()
  
EndDeclareModule

Module _TrainYard
  
  #CameraSpeed = 5
  
  Structure _CamData
    id.i
    x.f
    y.f
    z.f
  EndStructure
  
  Structure _MeshData
    id.i
    mes.i
    tex.i
    mat.i
  EndStructure
  
  
  Declare.i ReturnTexture(Index.i = 0)
  
  Global Dim train._MeshData(20)
  Global Dim wagon._MeshData(15)
  Global Dim ground._MeshData(4)
  
  Global cam._CamData
  Global Win.i, Light.i
  Global node.i, smokenode.i
  Global smoke._MeshData
  Global station._MeshData
  
  Procedure.i SetResolution()
    Win = OpenWindow(#PB_Any, 0, 0, 1027, 768, "Chugga chugga choo chooooo!", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
    Scr = OpenWindowedScreen(WindowID(Win), 0, 0, 1024, 768,#False, 0, 0, #PB_Screen_SmartSynchronization)
    cam\id = CreateCamera(#PB_Any, 0, 0, 100, 100)
    node = CreateNode(#PB_Any, 0, 0, 0)
    CameraBackColor(cam\id, $F48735)
    MoveCamera(cam\id, 0, 5, -50)
    cam\x = 0
    cam\y = 5
    cam\z = -120
    CameraLookAt(cam\id, 0, 0, 0)
    CameraRange(cam\id, 0, 300)
    Light = CreateLight(#PB_Any, $FFFFFF, 50, 50, 50,#PB_Light_Directional)
    AttachNodeObject(node, LightID(Light))
  EndProcedure
  
  Procedure.i MakeWorld()
    With ground(0)
      \mes = CreatePlane(#PB_Any, 500, 500, 20, 20, 1, 1)
      \mat = ReturnTexture(3)
      ScaleMaterial(\mat, 0.1, 0.1)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), 0, -9, 0)
    EndWith
    With ground(1)
      \mes = CreateCube(#PB_Any, 2)
      \mat = ReturnTexture(4)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), 0, -8.7, 4)
      ScaleEntity(\id, 260,0.2,0.2)
    EndWith
    With ground(2)
      \mes = CreateCube(#PB_Any, 2)
      \mat = ReturnTexture(4)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), 0, -8.7, -4)
      ScaleEntity(\id, 260,0.2,0.2)
    EndWith
  EndProcedure
  
  
  Procedure.i MakeTrain()
    With train(0) 
      \Mes = CreateCylinder(#PB_Any, 3, 20, 8, 1, 0)
      \Mat = ReturnTexture(1)
      RotateMaterial(\Mat, -90,#PB_Material_Fixed)
      \id  = CreateEntity(#PB_Any, MeshID(\Mes), MaterialID(\mat), 0, -1.5, 0)
      RotateEntity(\id, 0, 0, 90)
    EndWith
    With train(1)
      \mes = CreateSphere(#PB_Any, 2.7, 10, 10)
      \mat = ReturnTexture(1)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), 8.7, -1.5, 0)
    EndWith
    With train(2)
      \mes = CreateCube(#PB_Any, 2)
      \mat = ReturnTexture(0)
      ScaleMaterial(\mat, 1, 4)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), -10.1, 0, 0)
      ScaleEntity(\id, 8, 5, 4)
    EndWith
    With train(3)
      \mes = CreateCube(#PB_Any, 2)
      \mat = ReturnTexture(1)
      ScaleMaterial(\mat, 1, 4)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), -25.1, 2.2, 0)
      ScaleEntity(\id, 7, 7, 5)
    EndWith
    With train(4)
      \mes = CreateCylinder(#PB_Any, 1, 7, 8, 0, 0)
      \mat = ReturnTexture(1)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), 8, 4, 0)
    EndWith
    With train(5)
      ;Base
      \mes = CreateCube(#PB_Any, 1)
      \mat = ReturnTexture(1)
      ScaleMaterial(\mat, 1, 4)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), -14, -5, 0)
      ScaleEntity(\id, 48, 0.5, 9)
    EndWith
    
    With train(6)
      ;Wheel
      \mes = CreateSphere(#PB_Any, 2, 10, 10)
      \mat = ReturnTexture(5)
      ScaleMaterial(\mat, 1, 4)
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), 5, -7.2, -3.4)
      ScaleEntity(\id, 0.8, 0.8, 0.2)
    EndWith
    
    train(7)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(7)\id, 0, -7.2, -3.4)
    
    train(8)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(8)\id, -9, -7.2, -3.4)
    
    train(9)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(9)\id, -14, -7.2, -3.4)
    
    train(10)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(10)\id, -23, -7.2, -3.4)
    
    train(11)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(11)\id, -28, -7.2, -3.4)
    
    train(12)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(12)\id, 5, -7.2, 3.4)
    RotateEntity(train(12)\id, 180, 0, 0)
    
    train(13)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(13)\id, 0, -7.2, 3.4)
    RotateEntity(train(13)\id, 180, 0, 0)
    
    train(14)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(14)\id, -9, -7.2, 3.4)
    RotateEntity(train(14)\id, 180, 0, 0)
    
    train(15)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(15)\id, -14, -7.2, 3.4)
    RotateEntity(train(15)\id, 180, 0, 0)
    
    train(16)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(16)\id, -23, -7.2, 3.4)
    RotateEntity(train(16)\id, 180, 0, 0)
    
    train(17)\id = CopyEntity(train(6)\id, #PB_Any)
    MoveEntity(train(17)\id, -28, -7.2, 3.4)
    RotateEntity(train(17)\id, 180, 0, 0)
    
  EndProcedure
  
  
  Procedure.i MakeStation()
    Protected fn.i
    
    fn = LoadFont(#PB_Any, "Arial", 36, #PB_Font_Bold)
    
    With station
      \tex = CreateTexture(#PB_Any, 512, 512)
      StartDrawing(TextureOutput(\tex))
      Box(0, 0, 512, 512, $908E92)
      DrawingFont(FontID(fn))
      DrawingMode(#PB_2DDrawing_Transparent)
      DrawText(150, 50, "STATION", $2D4345)
      DrawText(50, 100, "PURE BASICVILLE",$2D4345)
      DrawingMode(#PB_2DDrawing_AlphaBlend)
      For x = 0 To 512 Step 64
        Box(x, 150, 56, 100, $E1F19F59)
      Next x
      DrawingMode(#PB_2DDrawing_Outlined)
      For x = 0 To 512 Step 64
        Box(x, 150, 56, 100, $207290)
        Box(x+1, 150, 55, 99, $207290)
      Next x
      StopDrawing()
      \mes = CreatePlane(#PB_Any, 20, 20, 2, 2, 1, 1)
      \mat = CreateMaterial(#PB_Any, TextureID(\tex))
      \id  = CreateEntity(#PB_Any, MeshID(\mes), MaterialID(\mat), 0, 10, 10)
      RotateEntity(\id, -90, 0, 0)
    EndWith
    FreeFont(fn)
  EndProcedure
  
  Procedure.i ReturnTexture(Index.i = 0)
    Protected tex.i, mat.i, fn.i
    tex = CreateTexture(#PB_Any, 512, 512)
    Select Index
      Case 0 
        fn = LoadFont(#PB_Any, "MS Sans Serif", 16, #PB_Font_Bold)
        StartDrawing(TextureOutput(tex))
        DrawingFont(FontID(fn))
        DrawingMode(#PB_2DDrawing_Gradient)
        BackColor($777777)
        FrontColor($AAAAAA)
        BoxedGradient(0, 0, 512, 12)
        Box(0, 0, 512,512)
        DrawingMode(#PB_2DDrawing_Transparent)
        DrawText(140, 226, "WWW.PUREBASIC.COM",$FFFFFF)
        DrawText(50, 266, "THE BEST PROGRAMMING LANGUAGE EVER!",$FFFFFF)
        StopDrawing()
        FreeFont(fn)
      Case 1 
        StartDrawing(TextureOutput(tex))
        DrawingMode(#PB_2DDrawing_Gradient)
        BackColor($777777)
        FrontColor($AAAAAA)
        BoxedGradient(0, 0, 512, 512)
        Box(0, 0, 512,512)
        StopDrawing()
      Case 2 ; Bark - poor imitation
        StartDrawing(TextureOutput(tex))
        DrawingMode(#PB_2DDrawing_AlphaBlend)
        Box(0, 0, 512, 512, $FF095688)
        For x = 0 To 200
          LineXY(Random(511,2), Random(511,2), Random(511,2), Random(511,2),$E1041635)
        Next x
        StopDrawing()
      Case 3 ; Ground
        StartDrawing(TextureOutput(tex))
        Box(0, 0, 512, 512, $546F7C)
        FrontColor($444540)
        BackColor($AAAAAA)
        DrawingMode(#PB_2DDrawing_Gradient)
        For z = 0 To 56000
          x.i = Random(509,2)
          y.i = Random(509,2)
          r.i = Random(3,1)
          CircularGradient(x, y, r)
          Circle(x, y, r)
        Next z
        StopDrawing()
      Case 4 ; Rails
        StartDrawing(TextureOutput(tex))
        Box(0, 0, 512, 512, $4D4B53)
        FrontColor($2042A1)
        BackColor($2E19A1)
        DrawingMode(#PB_2DDrawing_Gradient)
        For z = 0 To 6000
          x.i = Random(509,2)
          y.i = Random(509,2)
          r.i = Random(3,1)
          CircularGradient(x, y, r)
          Circle(x, y, r)
        Next z
        StopDrawing()
      Case 5
        StartDrawing(TextureOutput(tex))
        Box(0, 0, 512, 512, $000000)
        For x = 0 To 512 Step 16
          LineXY(0, x, 512, 512 - x, $C6C6C6)
        Next x
        StopDrawing()
      Case 6
        StartDrawing(TextureOutput(tex))
        Box(0, 0, 64, 64, $000000)
        DrawingMode(#PB_2DDrawing_Gradient)
        FrontColor($AAAAAA)
        BackColor($333333)
        CircularGradient(32, 32, 15)
        Circle(32, 32, 15)
        StopDrawing()
    EndSelect
        
    mat = CreateMaterial(#PB_Any, TextureID(tex))
    ProcedureReturn mat
    
  EndProcedure
  
  Procedure.i DoSmoke()
    smokenode = CreateNode(#PB_Any, 0, 0, 0)
    smoke\id = CreateParticleEmitter(#PB_Any, 1, 1, 1, #PB_Particle_Point)
    smoke\mat = ReturnTexture(6)
    MaterialBlendingMode(smoke\mat, #PB_Material_Color)
    ParticleEmissionRate(smoke\id, 200)
    ParticleEmitterDirection(smoke\id, 0, 1, 0)
    ParticleMaterial(smoke\id, MaterialID(smoke\mat))
    ParticleTimeToLive(smoke\id, 0.3, 1)
    ParticleVelocity(smoke\id, 0.2, 0.5)
    MoveParticleEmitter(smoke\id,  -5, -5, -1, #PB_Absolute|#PB_Local)
    AttachEntityObject(train(4)\id, "Empty here produces an error", ParticleEmitterID(smoke\id)) 
    ;Word must be present or an error occur. ("something")
  EndProcedure
  
  Procedure.i RunDemo()
    Protected Exit.i = 0
    WorldShadows(#PB_Shadow_Additive)
    ret = MakeWorld()
    ret = MakeTrain()
    ret = DoSmoke()
    ret = MakeStation()
    
    Repeat
      
      Repeat
        ev = WindowEvent()
        If ev = #PB_Event_CloseWindow
          exit = 1
        EndIf
      Until ev = 0
      
      If ExamineKeyboard()       
        
        If KeyboardPushed(#PB_Key_A)
          cam\x = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_D)
          cam\x = #CameraSpeed 
        Else
          cam\x = 0
        EndIf
        
        If KeyboardPushed(#PB_Key_W)
          cam\y = -#CameraSpeed 
        ElseIf KeyboardPushed(#PB_Key_S)
          cam\y = #CameraSpeed 
        Else
          cam\y = 0
        EndIf
        
      EndIf

      MoveCamera(cam\id, CameraX(cam\id), CameraY(cam\id), CameraZ(cam\id), #PB_Absolute)
      MoveCamera(cam\id, cam\x, 0, cam\y)
      
      RenderWorld()
      
      FlipBuffers()
      
    Until KeyboardPushed(#PB_Key_Escape) Or Exit = 1
    
  EndProcedure
EndModule

_TrainYard::SetResolution()
_TrainYard::RunDemo()

:wink:
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
User avatar
macros
User
User
Posts: 88
Joined: Wed Mar 15, 2006 1:47 pm
Location: Munich

Re: PureBasic 5.30 beta 2 released!

Post by macros »

DK_PETER wrote:

Code: Select all

*snip*
"The debugged executable quit unexpectedly" :(
PB 5.3 Beta 2, Kubuntu 14.04 x64, AMD proprietary drivers.

The console prints:

Code: Select all

The program 'purebasic_compilation0.out' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadMatch (invalid parameter attributes)'.
  (Details: serial 633 error_code 8 request_code 156 minor_code 5)
  (Note to programmers: normally, X errors are reported asynchronously;
   that is, you will receive the error a while after causing it.
   To debug your program, run it with the --sync command line
   option to change this behavior. You can then get a meaningful
   backtrace from your debugger if you break on the gdk_x_error() function.)
User avatar
DK_PETER
Addict
Addict
Posts: 904
Joined: Sat Feb 19, 2011 10:06 am
Location: Denmark
Contact:

Re: PureBasic 5.30 beta 2 released!

Post by DK_PETER »

@macros

Sorry...I don't know what the problem is. I'm strictly using Windows and it runs just fine.
Try changing the fonts.. Arial and MS Sans Serif are used two places in the code.

Best regards
Peter
Current configurations:
Ubuntu 20.04/64 bit - Window 10 64 bit
Intel 6800K, GeForce Gtx 1060, 32 gb ram.
Amd Ryzen 9 5950X, GeForce 3070, 128 gb ram.
Post Reply