BambooBasic

Version History, and general rambling! ;)

v1_2e

	- BGI works on the web! GUI programs now build for the Web target too. Windows, buttons,
	  lists, menus, tabs, tree and list views, toolbars, date/time pickers, rich text boxes,
	  canvases and the rest are drawn inside the page's canvas, in the same classic Windows
	  look, using Dear ImGui (built into the runtime, nothing extra to install). The same bgi
	  calls, handles and events work, so most GUI programs carry over as they are - the loop
	  body moves into WebLoop() like any web program. Designer (.bgi) files are built into the
	  program, so bgiLoadGizmos works straight away. See docs/web.html (BGI section), and the
	  *_web examples in examples/BambooRuntime/11 - BGI and 13 - Designer.
	- A browser can't stop and wait, so on the web message boxes and the open, save, colour
	  and font dialogs return at once and the answer arrives as an event - see the new
	  BGI_EVENT_ID_DIALOG, _FILEDIALOG, _COLORDIALOG and _FONTDIALOG in BBR_INCLUDE.bam. A web
	  page can't close itself either, so the main window's X folds it up to a little title
	  bar (X or a double-click opens it again); other windows close as normal.
	- The web RichTextBox does real formatting: bold, italic, underline, sizes and colours,
	  mouse selection, copy/paste and undo, and it reads and writes RTF, so files go back and
	  forth with the desktop version.
	- Added IGI, the Immediate Gizmo Interface: an in-game GUI built on Dear ImGui, for menus,
	  HUDs, debug panels and editors drawn over your game. Call the igi functions every frame
	  (values go in, new values come out: volume = igiSliderInt("Volume", volume, 0, 100)) -
	  windows, buttons, sliders, text boxes, drop-downs, lists, trees, tabs, menus, pop-ups,
	  images and more, 69 functions. Unlike BGI it's fully styleable: themes, all of ImGui's
	  colours (with ImGui's names, so shared ImGui themes copy across), roundings, sizes and
	  your own fonts. Same on desktop and web. See docs/igi.html and examples/BambooRuntime/27 - IGI.
	- IGI has a code editor: syntax colouring, line numbers, undo, marked lines with tooltips
	  (for errors), read-only and more. Languages are .lang text files you can write yourself;
	  BambooBasic (coloured like the IDE), C++, Lua, WGSL and HLSL come in userlibs\languages.
	  See the code editor section of docs/igi.html and example 05_CodeEditor.
	- Fixed strInstr on the web: it now counts from 1 and returns 0 when not found, like the
	  desktop and the docs (it used to return 0-based positions and -1).
	- Fixed a screen shader on the desktop leaving trails in 2D programs: b2dCls now clears to
	  the b2dSetClsColor colour under a screen shader too.
	- Fixed ToDouble / ToInt of a String array element (ToDouble(words[1])) not compiling on
	  the desktop, in a Print as well as anywhere else.
	- Game controllers work on the web! The same inpCreateController, button, D-pad, trigger,
	  stick and vibration calls as desktop, with the same XINPUT_GAMEPAD_* constants, using
	  the browser's Gamepad API. A browser only shows a pad once a button has been pressed on
	  it, so wait for that rather than quitting when none is found. Rumble works in Edge and
	  Chrome. See Controller_Down_web and Controller_Hit_web in examples/BambooRuntime/3 - Input.
	- Added fileExportWeb(), fileImportWeb() and fileImportWebResult() (web only), for any web
	  program: export downloads a file from the browser's storage to the user's computer, import
	  lets them pick a file to bring in (check fileImportWebResult each frame for its name).
	- Added bgiExportFileWeb() and bgiImportFileWeb() (web only): the same for BGI programs, with
	  the import's answer arriving as a BGI event. The RichTextBox web example has Export RTF
	  and Import RTF buttons to show them off.
	- File -> New -> BGI Application now asks Desktop or Web, and writes the right template
	  for each (the web one also switches the build target to Web). The designer keeps its
	  event dispatcher up to date wherever it lives, WebLoop() included.
	- Fixed the New BGI Application template using old calls that no longer exist, and the
	  designer's generated onSelect handlers calling a missing Str().
	- Designer fixes: switching tabs now saves the dialog to the right .bam.bgi, text with
	  quotes or < > & in it saves and loads properly, and nested submenus load correctly.
	- bgiProcessGizmoEvents: menu items now fire their own onClick, and list and combo boxes
	  fire onSelect. bgiLoadGizmos: empty tab controls, list views and toolbars load, and
	  nested submenus keep their items.
	- b2dSetMaxFPS now really caps the frame rate when vsync is off.
	- Tree view: renaming a node updates its text. Spinners take the full 32-bit range.
	- The b2d file dialogs could hand back a garbled file name; fixed.
	- Web target: s = s & Chr(13) (a string added to with &) no longer gets mistaken for a
	  number.
	- Web target: the right and middle mouse buttons were swapped (VMOUSE_RBUTTON read the
	  middle button and VMOUSE_MBUTTON the right); fixed.
	- The web server could randomly fail to send a script, so a page sometimes didn't start;
	  fixed.
	- Fixed small bugs in the Trigonometry, BackupRestore, Controller_Hit and TCP/UDP
	  transfer examples.
	- Docs: the designer page is rewritten, and docs/web.html has the new BGI section. The BGI
	  reference pages note where the web behaves differently.

v1_2d

	- Movies are real video files now! b2dLoadMovie takes an .mp4, .mkv, .webm and so on
	  directly - the old .bbv format and its converter are gone. Same calls as before (play,
	  pause, resume, stop, loop, volume, draw, draw scaled), and the picture keeps time with a
	  real clock, so a slow frame skips rather than slowing the film down. The soundtrack plays
	  through the same audio engine as everything else. Decoding is done by Windows' own Media
	  Foundation on desktop, and by HTML5 video on the web. See examples/BambooRuntime/1 - Graphics (DrawMovie...).
	- Added b2dLoadMesh(), which loads 3D models baked to .bb3d, animated ones included. The
	  runtime stores the model and blends its animation frames; your program turns and
	  projects the points and draws the faces, the 3D-in-2D way. b2dMeshAnimate will blend ANY
	  two frames, so if a model's animation clips are rubbish (some exporters make every clip
	  the whole animation) you can still loop just the frames you want. Models with no texture
	  carry their own face colours - b2dMeshFaceR/G/B. Animation frames are compressed in the
	  file, so animated models stay small. Desktop + Web. See examples/BambooRuntime/26 - 3D in 2D (Mesh...),
	  and docs/3d_in_2d.html.
	- Added b2dFreeMesh(), to free a loaded mesh (and its texture) when you're done with it.
	  Desktop + Web.
	- Added Tools -> GLB to .bb3d Mesh Converter to the IDE, to make those models. Point it at a
	  .glb, pick a folder and a name, and it writes the .bb3d plus the texture as a .png. Skeletal
	  animation is baked to frames at the rate you choose. Afterwards it offers a preview you can
	  scrub through frame by frame, which is the way to find out which frame numbers are which
	  movement when a model's clips are no help.
	- Added b2dDrawImageQuad(), which stretches an image over any four corners, and
	  b2dDrawImageQuadDepth(), the same with a depth per corner so textured faces hide each
	  other properly without sorting. The UV versions, b2dDrawImageQuadUV and
	  b2dDrawImageQuadDepthUV, let each corner show a chosen part of the image - atlases, or
	  a model's own texture mapping. Desktop + Web. See examples/BambooRuntime/26 - 3D in 2D (ImageQuad...).
	- Added b2dLoadTTF(), which loads a .ttf/.otf font and gives back a normal font handle, so
	  every text command works with it. Glyphs are drawn as they're needed, so proper Unicode
	  works too - accents, Cyrillic, Greek, even CJK. Desktop + Web.
	- b2dDrawQuadDepth now works on the web target too.
	- Debug builds of big programs compile MUCH faster. The debugger used to send every
	  global and constant after every single line, which made the generated code enormous
	  (27 MB for Anti-Tetrafied); it now sends them only when you are actually paused, which
	  took that down to 556 KB. As a bonus, globals now show in the variables panel while you
	  are paused inside a function too, not just in Main.
	- Fixed building a string with & that includes a function returning a number, like
	  s = "Score: " & GetScore(). It would not compile unless you Printed it directly. Same
	  for a plain number (s = "Lives: " & 3).
	- Fixed & inside brackets in a Print, like Print strUpper("Lives: " & lives), which came
	  out as a bitwise OR and wouldn't compile. Also Chr() and Asc() in a Print, two string
	  literals joined with & ("a" & "b"), and & with numbers on the web target.
	- Sprite sheets (b2dLoadAnimImage) and fonts (b2dLoadFont) no longer bleed into the
	  neighbouring frame or letter when drawn small.
	- Two or more movies playing at once now all move - before, only the last one played did.
	- b2dLoadMesh returns 0 for a damaged or cut-short .bb3d file instead of crashing.
	- Mesh examples no longer draw the model tinted by the help text colour.
	- Fixed the clean-up of old build files being able to delete files OUTSIDE your project,
	  if a project folder had been copied or moved. It now only touches files inside the
	  build folders, and never a .bam.
	- Web target: True/False now come out as 1/0, like desktop, so an Int flag survives being
	  turned into a string and back.
	- Builds work with Windows 11's Smart App Control switched on. It blocks MinGW's linker
	  helper (collect2.exe), which made every desktop build fail at the link step; the IDE now
	  spots this and links with ld.exe directly instead, with the exact same settings.
	- The web server no longer gives up if another program is already using port 8000 - it
	  moves on to the next free port (8001, 8002...) and shows the real address in its window.
	  It also takes the port for itself only, so it can't end up sharing one with another
	  program, and its status now says when it fails instead of always saying "Running".
	- Added the AI Assistant (View -> AI Assistant, Ctrl+Shift+A): a Claude chat window in the
	  IDE, using your own Anthropic API key. Attach your code and it can explain it, fix build
	  errors and edit attached files for you (Ctrl+Z undoes). See docs/ai_assistant.html.

v1_2c

	- Added b2dDrawQuadDepth - like b2dDrawQuad but each corner takes its own depth
	  (0..1), interpolated per-pixel by the GPU. This is what proper "3D in 2D" wants:
	  interpenetrating and steeply-tilted faces now resolve correctly per pixel, so
	  you can draw everything in any order with no backface culling. (b2dSetDepth gives
	  a whole quad ONE flat depth, which can't separate a solid's own overlapping
	  faces - that's what this fixes.) Desktop + Web; see the "3D in 2D" doc.
	  NOTE: feed perspective-correct corner depths (a + b/z), not raw view-z.
	- New examples: "26 - 3D in 2D Stress" (rotating-cube benchmark) and
	  "27 - Quad Depth" (flat vs per-corner depth toggle), desktop + web.

v1_2b

	- Big one: the runtime is now 2D across the board. The 3D (b3d*) engine has been
	  retired so every target (Windows, Web, Linux) sits on the same 2D runtime and
	  the same API. The old 3D runtime stays available but won't be updated.
	- The handful of functions worth keeping have been renamed from b3d* to b2d*
	  (display setup, cls, flip, the frame loop, and the full-screen shaders).
	- 3D-in-2D! A few small 2D additions make real 3D possible with 2D commands:
		- b2dDrawQuad - draw an arbitrary 4-point polygon (not just rectangles)
		- b2dSetDepth - a proper per-pixel GPU depth buffer for 2D primitives, so you
		  can draw in any order and let the hardware sort out what's in front (see docs
		  + the new "3D in 2D" tutorial)
	- b2dSetClipRect / b2dClearClipRect - 2D scissor clipping.
	- Indexed images now build a full mipmap chain (no more shimmer when scaled down)
	  and the 2D texture limit is up from 256 to 512.
	- BGI canvases are now 2D-only (bgiCreateCanvas).
	- Removed the 3D tools from the IDE's Tools menu.
	- Fixes: palette-cycling text draw order, F1 detailed-help lookup, and web
	  key-repeat firing key-hits every frame.

v1_2
	
	- Another one for the codgers amongst us; Palette Cycling & Indexed Colour functions (see docs)
	- Fixed a few editor loose ends
	- Fixed FileCopy bug that would always return 0, even if the file was copied successfully
	- Added "PreCalc" block, this runs at build time, inside the transpiler, and bakes its 
	  results into your program as an array literal. (See docs) 
	- Added "AutoCall", which calls a function once/every specified amount of milliseconds... Think
	  Amstrad CPC's software interrupt mechanism... Sorry, I had to do it! ;)
	- Added With...EndWith block, for adding data to type and element fields (syntax sugar really),
	  again, see docs.
	- Added string interpolation for string variables/objects fields e.g. 
		
		Local age:Int = 49
		Print "My age is {%age}"
		
		Output: My age is 49
		
	- Added "Sequence"'s, which are BambooBasic's version of proper list containers (See docs)
	- Added Elements, which can we used with Sequence lists (Like Types, but not, again, see docs) 
	- Hopefully fixed intergrated/discrete combo GPU device crashes (and stop Window
	  updates breaking settings), also, a fall back to WARP, so the app shouldnt die when opened
	  on less-spec'd machines, though, it will probably run like shit! :D

v1_1
	
	- Added "Experimental" web target
	- Fixed screen shader code as I had hardcoded values in them when testing with the CRT shader
	- Fixed mid-frame GPU buffer resizing when dynamically adding entities.
	- Transpiler fix, detects unclosed blocks (If, Select etc etc)
	- Fixed type iteration crash when removing objects from the internal list in a For Each loop
	- Fixed jsonGetArrayCount returning the wrong value.
	- Added b3dCenterMesh(), b3dOpenFileDialog(), b3dSaveFileDialog and b3dOpenFolderDialog.
	- Fixed b3dCountTriangles for GPU meshes
	- Fixed DXGI shutdown crash (Cheers Amon)
	- Fixed b3dLoadBRSFile() function in regards to rotation.

v1_0

	- Full release... To much to add since I added 3D stuff, but, this IS the baseline now!