This is a library of QB64 code which I've created to fill in some "holes" that I feel QB64 has by default. Some of these "holes" stem from my laziness and growing complacency toward other languages that I've used including: PHP, Python, etc.
The code in this repo will evolve and grow over time. However, I feel that the library and approach, while not complete to my full vision, is at least usable in it's current state.
| LIBRARY | PURPOSE | NOTES |
|---|---|---|
| ANSI | ANSI text mode | Full ANSI.SYS support plus 256 and RGB color modes as well as a QB64 native ansi emulation mode. |
| ASEPRITE | ASEPRITE Image Format support | Natively use .aseprite files in QB64! |
| ARR | ARRay Library | A high level library for working with arrays of all types in QB64 |
| BBX | Bounding BoX Library | Reusable bounding box with position, resize, keyboard and mouse control |
| ADV_COLOR_PICKER | Advanced Color Selector | Krita-style hue ring + saturation/value triangle, a configurable shade selector (delta/shift line-sets, presets, per-row labels, linear/exponential curve), draggable hue-neighbor range markers, quantize-to-steps, custom background, and a color-history strip |
| COLOR | Color spaces + 3D picker | OKLab / OKLCh, CIELAB, XYZ conversions, gamut mapping, perceptual blending and OKLCh ramps; plus a rotatable 3D color-space picker (solid or point cloud, lightness slice) |
| COLOR_PICKER | Color Picker Dialog | Photoshop/Krita-style HSV/RGB/HSL color picker with hex input and posterize mode |
| CONSOLE | CONSOLE object with debugging. | |
| DICT | Dictionary object (sorta) | Custom type and support for arrays using .key and .val |
| DUMP | Debugging library | Like PHPs print_r (kind of) |
| FILE_DIALOG | File Dialog | Full-featured Open/Save/Folder dialog with list, details, and thumbnail views |
| GLSL | GLSL shaders | Vertex + fragment shaders, uniforms, attributes and texture units from SUB _GL - plus a Shadertoy-style runner for your own .frag files |
| INPUT | Input library | For lightbar menus, text boxes, etc. |
| IMGADJ | Image Adjustment library | Image operations and stuff found in GIMP, Photoshop, etc. |
| LAYOUT | Layout solver | Flexbox-style rows / columns: min / preferred / max sizes, grow / shrink with min-max freezing, overflow drop order, shared frame rows; plus LAY_place for floating windows among obstacles. Pure integer math, headless unit test |
| MISC | Miscellaneous helpful functions and subs that don't fit anywhere else :) | |
| MOUSE_PRESSURE | Mouse expression | A made-up pen pressure for a mouse: FIXED, SPEED (slow = heavy, fast = light) or WHEEL (scroll while drawing), plus taper in / out, so drawing programs give mouse users thick-and-thin and tapered strokes. Pure math, example, headless unit test |
| MSG_BOX | Message Box Dialog | Modal message boxes with OK/Cancel/Yes/No buttons, icons, and input mode |
| PIPEPRINT | ANSI string DSL | Pipe (|) Print emulates Mystic BBS pipe parsing |
| PRESSURE_DEVICE | Pen pressure | Pen / tablet pressure, tilt and eraser for QB64-PE on Windows (Windows Ink), macOS (tablet events + Force Touch trackpad) and Linux (XInput2, X11 and Wayland) by hooking the native window; a mouse reads as full pressure. Test program, example, unit test; confirmed on all three OSes with a HUION Inspiroy 2 M |
| PSD | Adds PSD Photoshop file support to QB64 | 8-bit Only |
| STEAM | Steam achievements + stats | Steamworks achievements and stats for QB64-PE on Windows, macOS and Linux: loads Valve's steam_api at runtime (no SDK or build flags), with a mock backend (in-memory / save file) when Steam isn't available. Includes a Steam Direct shipping guide, a guided end-to-end check against the real Steam client (STEAM-TEST --e2e) and a SteamPipe upload kit; test program, example, native unit test |
| STRINGS | Strings library for lazy programmers | Includes a lot of batteries and helpers for arrays, finding, parsing, etc. |
| SWATCH | Swatch sets | Load / save Photoshop .aco (RGB/HSB/CMYK/Lab/gray), .gpl (with columns, gaps, locks, groups), .act, .pal, .hex, .txt; edit with locks (delete / move / sort / dedupe the selection), guess a layout's columns |
| SYS | System stuff | Contains misc. helpful utils/tools |
| TEXT_INPUT | Text Input Widget | Reusable text input with undo/redo, clipboard, selection, and multiline support |
| VECT2D | 2D Vector support | Thanks to William Barnes and Evan Shortiss |
- Unified include for the lazy to use everything
- e.g.
'$INCLUDE:'QB64_GJ_LIB/_GJ_LIB.[BI|BM]'...
- e.g.
- Directory scaffolding that makes sense.
- Each library in its own directory.
- Tests and examples included for each library in same dir using
.BASextension to complement.BI|BM- Tests can be tested in unified mode or in isolated mode by setting
$LET GJ_LIB_UNIFIED_TESTING = 1within _GJ_LIB.BI
- Tests can be tested in unified mode or in isolated mode by setting
- Use of individual parts should work OK without including
_GJ_LIB.[BI|BM]- Each library should be as atomic as possible.
- Where needed,
$IFpre-compiler guards should provide safe isolation as well as unified inclusion.
- Coding conventions
- UPPERCASE KEYWORDS and CONST
- Comments like PHPDoc (it's working OK)
- File comment blocks
- SUB / FUNCTION comment blocks
- Whitespace
- 3 new lines after file comment blocks and global code except for metacommands
- 2 new lines between each SUB or FUNCTION
- 1 blank line at the end of every file
words_and_underscoresfor library subs and functions- Use symbols (!#$%&) only when required and prefer over
AS type
- Not guaranteed to be compatible with QB1.1 / QuickBasic 4.x / PDS / etc.
- Be compassionate
- Best effort to not clobber anything
- Use
GJ_LIB_*names for things, where it makes sense.
- Use
- Best effort to not clobber anything
Just clone the repo and refer to where you cloned it in the path_to_GJ_LIB stuff below.
Because I'm lazy you can use all the libs by just including them like so:
'At the top of your code:
'$INCLUDE:'path_to_GJ_LIB/_GJ_LIB.BI'
'...your code here...
' At the bottom of your code:
'$INCLUDE:'path_to_GJ_LIB/_GJ_LIB.BM'If you want to, you can include individual parts and not use the whole lib, in that case you'd include whatever you want like for example ANSI and DUMP:
'At the top:
'$INCLUDE:'path_to_GJ_LIB/ANSI/ANSI.BI'
'$INCLUDE:'path_to_GJ_LIB/DUMP/DUMP.BI'
'...your code here...
'At the bottom:
'$INCLUDE:'path_to_GJ_LIB/ANSI/ANSI.BM'
'$INCLUDE:'path_to_GJ_LIB/DUMP/DUMP.BM'While I have been cautious and compassionate not to include things or name things that will clobber existing things, I'm only one nerd and so if you run into any collisions or errors in your use of the library, please feel free to report them as issues in the issue tracker.
I work well with others. Feel free to participate in the usual GitHub ways.
I made this for myself, but if you want to use it just know that I may change things. I'll try to keep backwards compatibility though.
- TEXT_GUI library (menus (lightbar/mouse), dialogs?, forms?)
- More STRINGS stuff (sorting, reversing, TitleCase, printf, pipeprint, etc.)
- More ANSI stuff (file loading / displaying / ANSI music?)
- Color stuff (palette cycling /
dump_rgb) - PETSCII library