Page 5 of 14

Re: PureBasic 5.30 beta 1 released!

Posted: Sat May 31, 2014 9:58 pm
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:

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 12:09 am
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>

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 12:42 am
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.

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 4:26 am
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. ;)

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 5:16 am
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.

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 6:08 am
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!

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 6:20 am
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]

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 9:08 am
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.

Re: PureBasic 5.30 beta 1 released!

Posted: Sun Jun 01, 2014 9:57 am
by electrochrisso
8) stuff, thanks guys.

Re: PureBasic 5.30 beta 2 released!

Posted: Sun Jun 01, 2014 12:14 pm
by Fred
Beta 2 is out, with some bug fixes (mainly the OS X startup issue)

Re: PureBasic 5.30 beta 2 released!

Posted: Sun Jun 01, 2014 1:08 pm
by bbanelli
You make it impossible to resist to make a donation, although small, but...

Great job, as always!

Re: PureBasic 5.30 beta 2 released!

Posted: Sun Jun 01, 2014 2:37 pm
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.

Re: PureBasic 5.30 beta 2 released!

Posted: Sun Jun 01, 2014 2:40 pm
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:

Re: PureBasic 5.30 beta 2 released!

Posted: Sun Jun 01, 2014 2:58 pm
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.)

Re: PureBasic 5.30 beta 2 released!

Posted: Sun Jun 01, 2014 3:13 pm
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