PureBasic 6.30 beta 3 is ready !
Re: PureBasic 6.30 beta 2 is ready !
Did you run it as root ? You need admin right on Linux or you need an hid.rules file as described here: https://github.com/libusb/hidapi?tab=readme-ov-file
Re: PureBasic 6.30 beta 2 is ready !
Running compiler as sudo fixed it and all working now!
Thanks for the links also, will go and have a read.
Thanks for the links also, will go and have a read.
Re: PureBasic 6.30 beta 2 is ready !
I think it's great that there's now an HID library in PB.
Thank you very much for that!
Is there any documentation for the commands somewhere?
Thank you very much for that!
Is there any documentation for the commands somewhere?
- lazarusoft
- User
- Posts: 24
- Joined: Wed Jan 10, 2007 10:17 pm
- Location: Brasil
Re: PureBasic 6.30 beta 2 is ready !
thanks for this
HeaderSection
HeaderSection

Code: Select all
;------------------------------------------------------------------------------
; PureBasic 6.30 + backend C
;------------------------------------------------------------------------------
EnableExplicit
CompilerIf #PB_Compiler_Backend = #PB_Backend_C
;ldconfig -p | grep mongoc
ImportC "-lmongoc-1.0 -lbson-1.0" : EndImport
CompilerElse
CompilerError "Use #PB_Backend_C"
CompilerEndIf
;------------------------------------------------------------------------------
; Header C
;------------------------------------------------------------------------------
HeaderSection
#include <mongoc/mongoc.h>
EndHeaderSection
;------------------------------------------------------------------------------
; Prototypes
;------------------------------------------------------------------------------
PrototypeC mongoc_init_proto()
PrototypeC mongoc_cleanup_proto()
PrototypeC.i mongoc_client_new_proto(uri.p-ascii)
PrototypeC mongoc_client_destroy_proto(client.i)
PrototypeC.i mongoc_client_get_database_proto(client.i, name.p-ascii)
PrototypeC mongoc_database_destroy_proto(db.i)
Global mongoc_init.mongoc_init_proto
Global mongoc_cleanup.mongoc_cleanup_proto
Global mongoc_client_new.mongoc_client_new_proto
Global mongoc_client_destroy.mongoc_client_destroy_proto
Global mongoc_client_get_database.mongoc_client_get_database_proto
Global mongoc_database_destroy.mongoc_database_destroy_proto
!g_mongoc_init = &mongoc_init;
!g_mongoc_cleanup = &mongoc_cleanup;
!g_mongoc_client_new = &mongoc_client_new;
!g_mongoc_client_destroy = &mongoc_client_destroy;
!g_mongoc_client_get_database = &mongoc_client_get_database;
!g_mongoc_database_destroy = &mongoc_database_destroy;
;------------------------------------------------------------------------------
Procedure Main()
Protected client.i=0, db.i=0
Protected uri$="", dbname$=""
uri$ = "mongodb://localhost/"
dbname$ = "test"
OpenConsole()
PrintN( "Init driver...: mongodb://localhost/")
mongoc_init()
PrintN( "create client...")
client = mongoc_client_new(uri$)
If client = 0
PrintN( "ERROR: not create client")
ProcedureReturn
EndIf
PrintN( "Open database '" + dbname$ + "'...")
db = mongoc_client_get_database(client, dbname$)
If db = 0
PrintN( "ERROR: not open database")
ProcedureReturn
EndIf
PrintN( "Database open with success.")
mongoc_database_destroy(db)
mongoc_client_destroy(client)
PrintN( "Finish driver...")
mongoc_cleanup()
PrintN( "End.")
EndProcedure
If #PB_Compiler_IsMainFile
Main()
EndIf
Re: PureBasic 6.30 beta 2 is ready !
Thank you Fred!
Talking about the 3D side of things...
Why not add other shadowing modes to the current ones? I'm pretty sure the texture shadow got some updates. It would be super awesome.
Talking about the 3D side of things...
Why not add other shadowing modes to the current ones? I'm pretty sure the texture shadow got some updates. It would be super awesome.
-
- Addict
- Posts: 1575
- Joined: Wed Nov 12, 2008 5:01 pm
- Location: Russia
Re: PureBasic 6.30 beta 2 is ready !
How to use hidraw backend instead of libusb? This is what is written on Github.
On Linux, either the hidraw or the libusb back-end can be used. There are tradeoffs, and the functionality supported is slightly different. Both are built by default. It is up to the application linking to hidapi to choose the backend at link time by linking to either libhidapi-libusb or libhidapi-hidraw.
Re: PureBasic 6.30 beta 2 is ready !
ScreenGadget




Re: PureBasic 6.30 beta 2 is ready !
Hello Fred,
do you use the libusb functions libusb_detach_kernel_driver and libusb_attach_kernel_driver when opening and closing a device in the HID library under Linux?
With Rasbperry Pi OS (P400), I can no longer access a low-speed device (Brymen BC-86X adapter) when libusb_attach_kernel_driver is used when closing the device. There are no problems with a full-speed device (Brymen BC-86P adapter).
I checked this with my own HID/libusb code. I have no problems with the LowSpeed device on normal PCs running Linux.
Could you perhaps add a parameter to ‘CloseHID()’ for attach kernel drivers?
Peter
do you use the libusb functions libusb_detach_kernel_driver and libusb_attach_kernel_driver when opening and closing a device in the HID library under Linux?
With Rasbperry Pi OS (P400), I can no longer access a low-speed device (Brymen BC-86X adapter) when libusb_attach_kernel_driver is used when closing the device. There are no problems with a full-speed device (Brymen BC-86P adapter).
I checked this with my own HID/libusb code. I have no problems with the LowSpeed device on normal PCs running Linux.
Could you perhaps add a parameter to ‘CloseHID()’ for attach kernel drivers?
Peter
Re: PureBasic 6.30 beta 3 is ready !
2025-10-06: beta 3 is out, with one big new library: ScreenGadget, thanks to pf-shadoko ! It's also the first official library 100% written in PureBasic. The Window3D and Gadget3D lib based on CEGUI will be deprecated. The examples for the new lib can be found in the Examples/Sources/ScreenGadget.pb and Examples/3D/ScreenGadgetMultipleWindow.pb files. Don't hesitate to send your feedback as the lib is very new. There is also the usual bug fixes:
Bugfixes for this version:
Code: Select all
- Added: New ScreenGadget library to create easily UI on a game screen (for 2D and 3D)
- Windows: [Done] UncompressPackFile() should preserve modification times
- Windows: [Done] PB 6.20 B3 RotateCoordinates not rotating
- Windows: [Done] PB 6.20 B3 PathCursor after RotateCoordinates
- Linux: [Done] PB 6.21 XMLNodePath() giving short path element name
- Linux: [Done] PB 6.21 Regresion in console output behaviour
- Linux: [Done] PBv6.30b2 - ‘#PB_Image_Transparent’ does not work
- Linux: [Done] OpenWindowedScreen, Autostretch and Screen Position
- Linux: [Done] QT subsystem not work #PB_Event_DeactivateWindow
- MacOS: [Done] PB v6.20 - v6.21: 3D Example BillboardGrass SkyDom
- MacOS: [Done] PB 6.20 Canvas keydown returning wrong code for some keys
- MacOS: [Done] PB 6.3 Beta 1: Lack of transparency of toolbar icons and incorrect OnErrorGoto example
- MacOS: [Done] PB 6.30 b1/b2 - #PB_Image_Transparent don't work
- MacOS: [Done] Cannot add Keypad Dot as shortcut.
- MacOS: [Done] Can not use a structure in an Import
- MacOS: [Done] Menu destroyed on dialog close
- MacOS: [Done] PB v6.xx - Wrong StatusBar Position with use ToolBar
- MacOS: [Done] Mac OS/X beta 26
- C Backend: [Done] #PB_Structure_AlignC in Linux x86
- C Backend: [Done] PB 6.21 Win x64 - large string literals in datasection.
- C Backend: [Done] Calculation result comparison differs under C backend
- C Backend: [Done] Bit-shifting uses inconsistent operand sizes versus ASM-backend
- Engine3D: [Done] Include 2D Sprites Within a 3D Environment
- marcoagpinto
- Addict
- Posts: 1064
- Joined: Sun Mar 10, 2013 3:01 pm
- Location: Portugal
- Contact:
Re: PureBasic 6.30 beta 3 is ready !
Thanks, @Fred and @Team!
<3 <3 <3 <3
<3 <3 <3 <3
Re: PureBasic 6.30 beta 3 is ready !
Exciting news! Can't wait to test the screen gadget with my new project.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: PureBasic 6.30 beta 3 is ready !
The new ScreenGadget library is brilliant!
Thanks to pf-shadoko and the PureBasic Team!

Thanks to pf-shadoko and the PureBasic Team!

Re: PureBasic 6.30 beta 3 is ready !
Thanks for the updates - The new ScreenGadget library looks like it could be a great new edition, very cool 

-
- Enthusiast
- Posts: 425
- Joined: Sat Feb 12, 2022 7:15 pm
Re: PureBasic 6.30 beta 3 is ready !
Yeah ! That is awesome on adding for features, Thanks !