IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Vous êtes nouveau sur Developpez.com ? Créez votre compte ou connectez-vous afin de pouvoir participer !

Vous devez avoir un compte Developpez.com et être connecté pour pouvoir participer aux discussions.

Vous n'avez pas encore de compte Developpez.com ? Créez-en un en quelques instants, c'est entièrement gratuit !

Si vous disposez déjà d'un compte et qu'il est bien activé, connectez-vous à l'aide du formulaire ci-dessous.

Identifiez-vous
Identifiant
Mot de passe
Mot de passe oublié ?
Créer un compte

L'inscription est gratuite et ne vous prendra que quelques instants !

Je m'inscris !

PureBasic 5.30 (beta) est disponible sur votre compte

Le , par comtois

31PARTAGES

1  0 
Pas mal de nouveautés dans cette version

Hello everybody,

the first public beta version of the upcoming PureBasic version is available for download on your download account.

Some notable new features include:

A new JSON library including functions to serialize complex data structures directly from PB code to JSON and back. The same functionality has also been added to the XML library.
New functions for the 3D engine.
The IDE and debugger are now full unicode programs
Improvements for the IDE such as a "plain-text" editing mode, the highlighting of repeated occurrences of the current selection, a new 'Issues' tool to track TODOs in the source code and more.
A new /PREPROCESS compiler flag which will generate a PB code with all compiler directives and macros resolved.
... and much more!

The english documentation is already up to date for the new features, so you can find a description and examples there.

This version also includes some changes that may break compatibility with existing code:

The (X)IncludeFile and IncludeBinary have changed their behavior for relative paths.
The #PB_Event_SizeWindow and #PB_Event_MoveWindow events are no longer reported in realtime in the main event loop. This is to reduce problems with flickering on resize. To get realtime events you have to use the BindEvent() function and a callback in the future.
CreateXMLNode() has a new mandatory parameter.

This is regular release which means it brings new features and will have the regular support cycle. The 5.2x LTS release will continue to be maintained and a 5.23 LTS release is planned for shortly after this release becomes final.

As usual, please test the beta release(s) as much as you can and report any problems you have so we can have a stable final release. Please pay particular attention to problems/weird behavior in the IDE since converting it into a unicode application was quite a big change.

Here is the full list of changes:

  • Added: New "Issue" tool for IDE to build todo/issue lists easily from comments.
  • Added: JSON library
  • Added: ParseXML(), ComposeXML(), InsertXMLArray/List/Map/Structure(), ExtractXMLArray/List/Map/Structure() to XML lib
  • Added: OpenGLGadget() with native opengl commands ande constants support for Windows, OSX and Linux
  • Added: ExamineRegularExpression() and related commands to process regex matches step by step (with group support)
  • Added: ClipOutput(), UnclipOutput(), SetOrigin(), GetOriginX(), GetOriginY()
  • Added: GetWindowData(), SetWindowData()
  • Added: AllocateStructure(), FreeStructure()
  • Added: #PB_Default support to WindowsBound() to reset min/max size
  • Added: 'Format' parameter to Read/WriteProgramString(), WriteProgramStringN() and ReadProgramError()
  • Added: /PREPROCESS compiler flag to create a big single source with all macros, compilerif and file include resolved. Can be combined with /COMMENTED to get the original source with comments as well.
  • Added: optional '#Server' parameter to NetworkServerEvent() to check events only on a specific server
  • Added: #PB_String_NoZero flag support to PokeS() to avoid writting the ending null character
  • Added: #PB_Enumeration support for Defined()
  • Added: Optional 'Type' parameter to CreateBillboardGroup()
  • Added: BillboardGroupCommonDirection(), BillboardGroupCommonUpVector()
  • Added: #PB_Entity_MinVelocity and #PB_Entity_ForceVelocity to SetEntityAttribute()
  • Added: SetMaterialAttribute() with #PB_Material_DepthCheck and #PB_Material_DepthWrite constants
  • Added: #PB_Material_DepthCheck support for GetMaterialAttribute().
  • Added: Engine3DStatus() with these constants: #PB_Engine3D_NbRenderedTriangles, #PB_Engine3D_NbRenderedBatches
    #PB_Engine3D_CurrentFPS, #PB_Engine3D_MaximumFPS, #PB_Engine3D_MinimumFPS, #PB_Engine3D_AverageFPS, #PB_Engine3D_ResetFPS
  • Added: #PB_Absolute / #PB_Relative support to CameraDirectionX/Y/Z(), CameraX/Y/Z(), EntityX/Y/Z(), LightX/Y/Z(), LightDirectionX/Y/Z()
    BillBoardGroupX/Y/Z(), NodeX/Y/Z(), ParticleEmitterX/Y/Z() and FetchOrientation()
  • Added: ParticleSpeedFactor(), DisableParticleEmitter()
  • Added: GetEntityCollisionMask(), GetEntityCollisionGroup(), SetEntityCollisionFilter()
  • Added: WaterHeight(), FreeWater()
  • Added: Fully unicode IDE
  • Added: Highlighting of repeated occurrences of the currently selected word in the IDE
  • Added: Plain-text editing mode to edit non-PB files in the IDE
  • Added: 'Issues' IDE tool to collect and display TODO/FIXME markers inside the code
  • Added: Ctrl+E and Ctrl+Shift+E shortcut to align/shift comments in a selected code block
  • Added: Ctrl+M and Ctrl+Shift+M shortcut to select the current code block (repeated presses select the next code block)
  • Added: PopupMenu to IDE error log for clear/copy operation
  • Added: %HOME and %PROJECT to IDE tool commandline options, added PB_TOOL_Project to available env vars
  • Added: Automatic code indentation can align comments at the end of code lines in the IDE
  • Added: AutoComplete remembers last selection for Structure/Module AutoComplete
  • Added: Context sensitivity for current module/procedure for variable display and expression eval in the debugger
  • Changed: FormatXML() with #PB_XML_ReFormat no longer adds newlines inside single-line elements for a more readable output
  • Changed: DeleteElement() now returns the data pointer to the new current element (if any)
  • Changed: SetXMLAttribute() to accept newline characters in attributes (will be encoded as character entities)
  • Changed: Added a mandatory "name" parameter to CreateXMLNode() as some parser needs it at node creation time
  • Changed: The way (X)IncludeFile and IncludeBinary works: it's now relative to the file which contains these statements (which is easier to handle)
  • Changed: #PB_Event_SizeWindow and #PB_Event_MoveWindow are no more realtime on Windows, use BindEvent() to get real time update. It should fixes ugly flickering when realtime resizing on Windows.
  • Changed: DataSection label within Procedure are now local labels.
  • Changed: ASM local label prefix has been changed from "l_" to "ll_" ("ll" for local label), to avoid possible clash with main labels.
  • Changed: #PB_LinkedList constant has been renamed to #PB_List for better consistancy
  • Changed: Removed the "Billboard" parameter from AddBillboard() as it was not used. Now returns the new billboard index.
  • Changed: Updated Scintilla to version 3.4.2
  • Removed: MaterialDepthWrite() (replaced by SetMaterialAttribute())
  • Removed: CountRenderedTriangles() and Engine3DFrameRate(), replaced by Engine3DStatus()


Have fun with this version, and please report all problems in the bugs forum.

The PureBasic Team

Une erreur dans cette actualité ? Signalez-nous-la !

Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 30/05/2014 à 17:46
Exemple montrant comment utiliser la nouvelle bibliothèque JSON

Code : Sélectionner tout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Structure Person
  FirstName$
  LastName$
  Age.l
  List Books.s()
EndStructure

NewList Persons.Person()

AddElement(Persons())
Persons()\FirstName$ = "John"
Persons()\LastName$  = "Smith"
Persons()\Age        = 42
AddElement(Persons()\Books()): Persons()\Books() = "Investing For Dummies"
AddElement(Persons()\Books()): Persons()\Books() = "English Grammar For Dummies"
AddElement(Persons()\Books()): Persons()\Books() = "A Little Bit of Everything For Dummies"

AddElement(Persons())
Persons()\FirstName$ = "Jane"
Persons()\LastName$  = "Smith"
Persons()\Age        = 40
AddElement(Persons()\Books()): Persons()\Books() = "A Million Random Digits with 100,000 Normal Deviates"

; This is all the JSON magic!
CreateJSON(0)
InsertJSONList(JSONValue(0), Persons())
Debug ComposeJSON(0, #PB_JSON_PrettyPrint)
Code : Sélectionner tout
1
2
3
4
5
6
7
8
9
10
Dim Numbers.l(0)

; This is the magic!
ParseJSON(1, "[2, 4, 6, 8, 10, 12]")
Debug JSONArraySize(JSONValue(1))
ExtractJSONArray(JSONValue(1), Numbers())

For i = 0 To ArraySize(Numbers())
  Debug Numbers(i)
Next i
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 01/06/2014 à 11:55
un exemple montrant le 'OpenGLGadget()' en action. Avec la 5.30 c'est très simple d'inclure de l'openGL dans un code PureBasic

Code : Sélectionner tout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
EnableExplicit

OpenWindow(0, 270, 100, 640, 480, "Cross-platform OpenGL demo")
SetWindowColor(0, 0)
OpenGLGadget(0, 0, 0, WindowWidth(0) , WindowHeight(0))

Repeat
  glViewport_(0, 0, WindowWidth(0), WindowHeight(0))
  glMatrixMode_(#GL_PROJECTION)
  glLoadIdentity_()
  gluPerspective_(30.0, Abs(WindowWidth(0) / WindowHeight(0)), 0.1, 500.0)
  glMatrixMode_(#GL_MODELVIEW)
  glLoadIdentity_()
  glClear_(#GL_COLOR_BUFFER_BIT | #GL_DEPTH_BUFFER_BIT)
  glLoadIdentity_()
  glTranslatef_(0.0, 0.0, -8.0)
  glColor3f_(1.0, 1.0, 1.0)
  glBegin_(#GL_TRIANGLES)      ; Start drawing a triangle
  glColor3f_ ( 1.0,  0.0, 0.0) ; Set top point of triangle to Red
  glVertex3f_( 0.0,  1.0, 0.0) ; First point of the triangle
  glColor3f_ ( 0.0,  1.0, 0.0) ; Set left point of triangle to Green
  glVertex3f_(-1.0, -1.0, 0.0) ; Second point of the triangle
  glColor3f_ ( 0.0,  0.0, 1.0) ; Set right point of triangle to Blue
  glVertex3f_( 1.0, -1.0, 0.0) ; Third point of the triangle
  glEnd_()                     ; Done drawing the triangle
  SetGadgetAttribute(0, #PB_OpenGL_FlipBuffers, #True)
Until WaitWindowEvent() = #PB_Event_CloseWindow
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 01/06/2014 à 14:00
La beta 2 est disponible sur votre compte.

Beta 2 is out, with some bug fixes (mainly the OS X startup issue)
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 07/06/2014 à 16:12
Cette modification semble faire débat :
The #PB_Event_SizeWindow and #PB_Event_MoveWindow events are no longer reported in realtime in the main event loop. This is to reduce problems with flickering on resize.
Freak (co-développeur de PureBasic) donne quelques explications :
There seems to be a lot of disinformation/confusion about the real-time size event floating around, so let me clear this up a bit.

How it works in Windows (and also in OSX):
Windows uses callbacks to dispatch events. The main event loop is only there to dispatch events and usually not used to handle the events directly. This is generally not a problem for the PB event-loop system because you can generally also handle the events in the main loop. However, the #WM_SIZE and #WM_MOVE Windows events (and some others too) are different: Once the user starts draging the window edge to do a resize, control does not return to the main loop until the user finishes draging. Instead, Windows repeatedly calls the callback to inform about the ongoing sizing activity. The main loop only gets control at the end of the sizing.

How it worked in PB before 5.30:
Since there was no BindEvent() in PB before 5.20, this behavior presented a real problem, because there was no way to react to sizing events while the window edge was dragged with PB only means. You needed a Window callback to do it. To solve this problem, I actually did a little bit of reverse-engineering to figure out which messages Windows sends during the resizing and re-implemented my own window resizing code that mimics the Windows behavior, but gives control back to the event loop. This way, no OS specific window callback was needed to properly handle size events.

I did this way back when Windows XP was new and shiny. Since then, new Windows versions have come out which implemented their Sizing-Code differently and it is hard to keep imitating it correctly. You can see that there are differences with the PB version even since Windows Vista, because PB windows react differently to the "drag a Window to the edge of the screen" resizing functionality that was introduced there. Furthermore, since Windows 7 or 8, there are these flickering issues which are hard to overcome with our custom sizing hack. I do not have to tell you that trying to reverse-engineer such code is not a good idea in the long term. This is why we were never really happy with this solution, but before 5.20, there was simply no other way. The "flickering" issue describe in the 5.30 announcement is only the most visible result of a generally bad solution.

Why we changed it in 5.30:
I already wrote why the solution is bad. Since release 5.20 we now have the BindEvent() command which is a PB only and cross-platform method to register an event callback. This is why we removed the above hack in favor of the native solutions. This way, PB created windows once again act 100% like other Windows in terms of resiting behavior and the solution is future proof.

What changed:
All you have to do is to move your resize code from the main loop into a procedure and call BindEvent() for it. You then once again get all events like you did before. Nothing has been removed. Only the method of event delivery has changed.

> But the big advantage of the event driven system gets lost, those events fire in the middle of my other code and I have to secure anything.
This not true: The BindEvent procedures are only called while you are inside of a WaitWindowEvent() or WindowEvent() call. They are sometimes also called from functions that change the GUI (if this change directly generates an event). However, they are never called "in the middle of your code". There is no multi-threading going on here, so there is no need to secure anything in the event callbacks.
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 09/06/2014 à 17:59
La beta 3 est disponible sur votre compte.

Beta 3 is available and should solve IDE issues, and brings the following new flags for the OpenGLGadget():
  • #PB_OpenGL_NoFlipSynchronization
  • #PB_OpenGL_FlipSynchronization
  • #PB_OpenGL_NoDepthBuffer
  • #PB_OpenGL_16BitDepthBuffer
  • #PB_OpenGL_24BitDepthBuffer
  • #PB_OpenGL_NoStencilBuffer
  • #PB_OpenGL_8BitStencilBuffer
  • #PB_OpenGL_NoAccumulationBuffer
  • #PB_OpenGL_32BitAccumulationBuffer
  • #PB_OpenGL_64BitAccumulationBuffer
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 17/06/2014 à 18:59
La beta 4 est disponible sur votre compte. L'équipe de développement vous encourage à la tester pour obtenir une version finale la plus stable possible.
Beta 4 is available and should solve issues marked as [Done]. Don't hesitate to test it, we believe it's now stable enough for serious work, so we can get a stable final version.
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 30/06/2014 à 22:57
La beta 5 est disponible sur votre compte, elle corrige pas mal de bogues notamment les problèmes avec l'IDE de la version x64. Et une nouvelle constante #PB_Explorer_HiddenFiles pour montrer les fichiers cachés.
Beta 5 is available and should solve issues, mainly with the IDE x64. A new constant has been introduced:

#PB_Explorer_HiddenFiles - To show hidden files in the explorer gadgets
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 03/07/2014 à 17:48
La beta 6 est disponible sur votre compte.

Beta 6 is available, it's only a bug fix release. Don't hesitate to test the bugs maked as done to confirm the bug is really gone. Thanks !
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 08/07/2014 à 21:11
La beta 7 est disponible sur votre compte. Il est temps de tester pour ceux qui ne l'ont pas encore fait, car c'est sans doute la dernière beta avec la version finale.

Beta 7 is available, it's only a bug fix release. It's probably the last beta, as most remaining issues are now sorted out, so it's time to jump and see if everything is OK !
0  0 
Avatar de comtois
Responsable Purebasic https://www.developpez.com
Le 09/07/2014 à 19:50
Il y a au moins 1 brésilien qui a gardé son sens de l'humour malgré la défaite

Voici comment il commente son rapport de bogue pour la version beta 7 :

Code : Sélectionner tout
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
;
; BUG Purebasic 5.30 Beta 7 x 1 Brazil
;
OpenWindow(0, 0, 0, 322, 150, "EditorGadget", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
EditorGadget(1, 8, 8, 306, 133)
For a = 0 To 5
  AddGadgetItem(1, a, "Line "+Str(a))
Next
; 
WaitWindowEvent()

Define.s tx = GetGadgetText(1)

Delay(100)

Define xml = CreateXML(#PB_Any,#PB_UTF8)
;SetXMLEncoding(xml,#PB_UTF8)
Define mainNode = CreateXMLNode(RootXMLNode(xml),"Zoo")
Define item = CreateXMLNode(mainNode,"Animal")
SetXMLAttribute(item, "id", tx);Bug
;SetXMLNodeText(item, tx);OK
FormatXML(xml,#PB_XML_CutNewline)
Define xmlsize = ExportXMLSize(xml)
Define *Memx=AllocateMemory(xmlsize)
ExportXML(xml, *Memx, xmlsize);
;Debug GetXMLEncoding(xml)
Define nxml$=PeekS(*Memx, xmlsize) ; in 5.22 OK
Debug nxml$ 

Debug ComposeXML(xml);Change utf8 to ascii

End
0  0