Hello everybody,
Christmas is near, so is the next major version of PureBasic ! This release is a major step to keep PureBasic updated and relevant for the future, with the big update of OGRE 3D (to the lastest version, including all its dependencies for all OS) and the new Windows arm64 support. It also features some highly expected commands like TLS sockets and native PureLibrary creation directly using PureBasic ! Changes:
Ogre3D changes:
Example to create a PureLibrary
Christmas is near, so is the next major version of PureBasic ! This release is a major step to keep PureBasic updated and relevant for the future, with the big update of OGRE 3D (to the lastest version, including all its dependencies for all OS) and the new Windows arm64 support. It also features some highly expected commands like TLS sockets and native PureLibrary creation directly using PureBasic ! Changes:
- Updated: OGRE 3D to lastest 14.3 version (big thanks for the help Pf Shadoko) !
- Added: Windows 11 arm64 support !
- Added: TLS support for Network library (Thanks Idle for the tips) !
- Added: PureLibrary creation in PureBasic (C Backend only) !
- Added: WebWiewProxy() to enable proxy support (Sponsored by Kukulkan)
- Added: #PB_Editor_TabNavigation support to EditorGadget() (Sponsored by Quin)
- Added: #PB_Entity_InheritScale support Get/SetEntityAttribute()
- Added: DLL support to UsePostgreSQL() (Sponsored by wayne-c)
- Added: Windows 10+ mode to link directly to UCRT.dll to have smaller executables and up-to-date CRT
- Added: IsPack()
- Added: PureBasic-CLI.cmd to easily open a commandline environment (Windows)
Ogre3D changes:
- Added: Get/SetWorldAttribute() to control water and sky
- Optimized: BuildMeshLOD() now uses a much better algorithm for automatic lod creation
- Modified: SaveRenderTexture() -> only .png format is supported
- Modified: reworked SkyDome() and CreateWater() fonction to have better and faster rendering
- Modified: Add3DArchive() always needs to be after OpenScreen()
- Modified: filenames are now case-sensitive even on Windows and OS X
- Removed: Sun() has been removed -> replacement with CreateLight()
- Removed: LoadWord() which was based on old BSP tech
- Removed: WaterHeight()
- Removed: SwitchCamera() which makes no sense
Example to create a PureLibrary
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 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 | DisablePureLibrary Test ; Needed to avoid function conflict if the lib is already loaded Global Test$ Global NewMap a() Procedure InitPureLibrary() MessageRequester("Init","Init") EndProcedure Procedure FreePureLibrary() MessageRequester("End","End") EndProcedure ; QuickHelp MyMax(Min [, Max [, Flags, Mode]]) - A standard min/max function ProcedureDLL MyMax3(a, b, c, d) Static cc = 16 Test$ = "Hello" ProcedureReturn OpenWindow(#PB_Any, 10, 10, 200, 200, "Test") EndProcedure ProcedureDLL MyMax2(a, b) ; version 2, 3, 4 .... allow to create optional parameter functions (PureBasic default values are not accepted) ProcedureReturn MyMax3(a, b, 0, 0) EndProcedure ProcedureDLL MyMax(a) ProcedureReturn MyMax2(15, 20) EndProcedure ; QuickHelp GetTest() - Returns the test content ProcedureDLL.s GetTest() ProcedureReturn Test$+Right(" World", 4) EndProcedure ProcedureDLL.s GetFloat(a.f, b.i, c.d) ProcedureReturn StrF(a) + ", "+ Str(b)+ ", "+StrD(c) EndProcedure ProcedureDLL.s GetString(a$, b$, c.d, d$) ; MessageRequester(a$ + b$ + c + d$, "") ProcedureReturn a$ + b$ + " " + c +" " + d$ EndProcedure ProcedureDLL GetArray(Array myArray(1)) ReDim myArray(20) a = myArray(3) ProcedureReturn ArraySize(myArray()) EndProcedure ProcedureDLL GetList(List myList()) AddElement(myList()) AddElement(myList()) ProcedureReturn ListSize(myList()) EndProcedure ProcedureDLL GetMap(Map myMap()) AddMapElement(myMap(), "Test") AddMapElement(myMap(), "Test2") AddMapElement(myMap(), "Test3") ProcedureReturn MapSize(myMap()) EndProcedure ProcedureDLL.d GetDouble(a.d, b.d) b$ = "World" a$ = GetString("aaa", "bbb"+b$, 4545, b$+b$) ProcedureReturn a*b EndProcedure |
For now, it can only be compiled using the commandline, with the C backend.
On Windows, open PureBasic-CLI.cmd (On Windows arm64, use 'pbcompiler' instead of 'pbcompilerc'):
pbcompilerc LibTest.pb --purelibrary --output Test
On Linux/OSX/Raspberry, set the PUREBASIC_HOME variable to your PureBasic root installation and add $PUREBASIC_HOME/compilers to the PATH. On Linux x86 or Linux x64, use 'pbcompilerc' instead of 'pbcompiler'.
pbcompiler LibTest.pb --purelibrary --output Test
If all goes well, you should have your new library installed and after a compiler restart you should be able to test it.
There is some limitation for PureBasic purelibrary:
- No debugger support (in progress)
- All functions are compiled in the same object, which means the library will always includes all the functions in the final executable.
- No help support (in progress)
Don't hesitate to check the new 3D examples, there is some cool stuff from Pf Shadoko here !
On Windows, open PureBasic-CLI.cmd (On Windows arm64, use 'pbcompiler' instead of 'pbcompilerc'):
pbcompilerc LibTest.pb --purelibrary --output Test
On Linux/OSX/Raspberry, set the PUREBASIC_HOME variable to your PureBasic root installation and add $PUREBASIC_HOME/compilers to the PATH. On Linux x86 or Linux x64, use 'pbcompilerc' instead of 'pbcompiler'.
pbcompiler LibTest.pb --purelibrary --output Test
If all goes well, you should have your new library installed and after a compiler restart you should be able to test it.
There is some limitation for PureBasic purelibrary:
- No debugger support (in progress)
- All functions are compiled in the same object, which means the library will always includes all the functions in the final executable.
- No help support (in progress)
Don't hesitate to check the new 3D examples, there is some cool stuff from Pf Shadoko here !