Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Standardised extended libs???
#11
I actually made most of my libraries standard, and add/update them frequently.
Then I moved them into the folder ./qb64/include/[all the library files]
Here is what I've come up with:  GitHub - AadityaParashar0901/qb64_libraries

I use it like all the time, and the best part is that I can optimize it more whenever I feel. But that makes it non-standardized (I guess).

Whatever, making a standard library set would be great, many languages use them - C, C++, Java, and a lot more.
Reply
#12
Its just an idea...so please feedback, change, give me your ideas!

Code: (Select All)
'/// initial idea for mouse input library for qb64 PE - i,e QBX_

TYPE QBX_Vector_2D '// Should it be point_2d? i always think a vecotr has position and magnitude (rotation and speed) too
  x AS SINGLE
  y AS SINGLE
END TYPE


TYPE QBX_Time_Event
  Max_Time AS DOUBLE '// Maximum timed allowed
  First_Time AS DOUBLE '// When the first occurance happened
  Last_Time AS DOUBLE '// When the second occurance happened - if this - first < max then its a double click
END TYPE


TYPE QBX_Mouse_State
  Position AS QBX_Vector_2D
  L AS _BYTE
  R AS _BYTE
  M AS _BYTE
  W AS _BYTE
  L_Tmr AS QBX_Time_Event
  R_Tmr AS QBX_Time_Event
  M_Tmr AS QBX_Time_Event
END TYPE


'// Ideal world - every program would use this
DIM SHARED QBX_Mouse(2) AS QBX_Mouse_State

'////////////////////////////////////////////////////////////////////////////////////////////////////

DO
  CLS



  _DISPLAY

LOOP

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Get_State '// Automactically fills array pos 0 with current mouse state


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Store_State '// Automactically fills array pos 1 with mouse state stored in array pos 0


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Store_State_Old '// Automactically fills array pos 2 with mouse state stored in array pos 1 - might not actually be needed - my brains unsure!



END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_L '// set double click time for left button


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_R '// set double click time for right button


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_M '// set double click time for middle button


END SUB


'////////////////////////////////////////////////////////////////////////////////////////////////////

Remember, its not for me! Its for us ALL!

Unseen
Reply
#13
(09-02-2025, 09:47 PM)Unseen Machine Wrote: Its just an idea...so please feedback, change, give me your ideas!

Code: (Select All)
'/// initial idea for mouse input library for qb64 PE - i,e QBX_

TYPE QBX_Vector_2D '// Should it be point_2d? i always think a vecotr has position and magnitude (rotation and speed) too
  x AS SINGLE
  y AS SINGLE
END TYPE


TYPE QBX_Time_Event
  Max_Time AS DOUBLE '// Maximum timed allowed
  First_Time AS DOUBLE '// When the first occurance happened
  Last_Time AS DOUBLE '// When the second occurance happened - if this - first < max then its a double click
END TYPE


TYPE QBX_Mouse_State
  Position AS QBX_Vector_2D
  L AS _BYTE
  R AS _BYTE
  M AS _BYTE
  W AS _BYTE
  L_Tmr AS QBX_Time_Event
  R_Tmr AS QBX_Time_Event
  M_Tmr AS QBX_Time_Event
END TYPE


'// Ideal world - every program would use this
DIM SHARED QBX_Mouse(2) AS QBX_Mouse_State

'////////////////////////////////////////////////////////////////////////////////////////////////////

DO
  CLS



  _DISPLAY

LOOP

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Get_State '// Automactically fills array pos 0 with current mouse state


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Store_State '// Automactically fills array pos 1 with mouse state stored in array pos 0


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Store_State_Old '// Automactically fills array pos 2 with mouse state stored in array pos 1 - might not actually be needed - my brains unsure!



END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_L '// set double click time for left button


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_R '// set double click time for right button


END SUB

'////////////////////////////////////////////////////////////////////////////////////////////////////

SUB QBX_Mouse_Set_DC_M '// set double click time for middle button


END SUB


'////////////////////////////////////////////////////////////////////////////////////////////////////

Remember, its not for me! Its for us ALL!

Unseen

Looks like you're reinventing the wheel.  Big Grin

https://qb64phoenix.com/forum/showthread.php?tid=138

That's the problem with libraries and sharing code -- getting people to make use of them rather than just roll their own.  Only difference in how you're proposing to do things, and how MBS works is it uses a bit array to basically store and report that information back to us.

It faithfully reports click events and hold events and start hold/end hold positions and scroll events... and yet, there's only a handful of people who ever use it rather than just writing their own.
Reply
#14
Nah, if its documented, agreed upon and we use it as reference to guide new users...it will become the defacto standard...we as for a hated term ("Senior") coders in QB64 should be the ones to do this pushing and in my opinion itll not only reduce repeated questions about the same subjects but also remove barriers to those who simply want to use the mouse/kb/gamepads/etc without needing to understand the intricates of how it works.  

Still...I hear you on the rolling ones own....Im me remember!

Love as always,

J
Reply
#15
(03-22-2025, 01:51 PM)mdijkens Wrote: Over time I have built a huge library of reusable functions.
Unfortunately I have to use .BI and .BM files for most.
I would love to be allowed to have Type, Const, Dim and $meta commands between functions
$IncludeOnce is a very valuable new metacommand
Would be nice if already defined Const, Type, variable can also be detected or done once...

For me those 2 additions in QB64pe would make the world for Library functions
What might be issues with existing code when we allow to have Type, Const, Dim and $meta commands between functions?
I've never understood why this restriction exists; QB could easily aggregate all main-level code outside subs and functions
45y and 2M lines of MBASIC>BASICA>QBASIC>QBX>QB64 experience
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  The reverse of _droppedfile extended function needed doppler 0 308 09-25-2025, 03:19 PM
Last Post: doppler

Forum Jump:


Users browsing this thread: