vector v
vector_init v 1 2 3 4 5
number a b c d
explode v a b c d
print "% % % %\n" a b c d
; prints 1 2 3 4
Blog
-
explode works now
-
BooBoo 3 is a big change
Almost or about half of everything will become an expression operator. Almost any builtin function returning a value will become and expression op. So instead of:
number n vector_get v n 10You do:
number n = n (vector_get v 10)This allows easier inlining for function calls etc.
However not everything will be treated this way. Like vector_add/vector_set/etc remain the same, it’s mainly things returning a value that benefit from it.
-
toptr improvements
toptr will return NULL (a new constant)if the variable doesn’t exist. == and != now support comparing pointers.
This is the new toptr.boo example which checks if the function exists before calling:
number f file_open f "word.txt" "r" string s file_read f s file_close f pointer p = p (toptr s) if (!= p NULL) go nope call `p :go print "NOPE!\n" :nope function foo { print "foo!\n" } function bar { print "bar!\n" } function baz { print "baz!" } -
BooBoo 2.5.1
- Add toptr to turn a string name into a variable/function/label pointer
- Add image_read_texture, image_to_texture and image_update for manipulating pixels directly
- Removed D3D backend
- Add pixfx example demonstrating (poorly, it can be optimised with image_update) image_read_texture/image_to_texture
- Allow non integer for loop increments (typo)
- Fix + expression op when dealing with expressions
-
toptr in BooBoo
The next version of BooBoo will have toptr which gives you a pointer from a string with a variable name in it.
number f file_open f "word.txt" "r" string s file_read f s file_close f call `(toptr s) function foo { print "foo!\n" } function bar { print "bar!\n" } function baz { print "baz!" }Now if word.txt contains “foo”, “bar” or “baz” the appropriate function is called.
-
What Do you think of some cheap reflection?
For example:
number x = x 100 string s = s (varname x) print "%\n" s ; prints "x" = `(tovar s) 777 ; x is now 777 -
Next Version of BooBoo will have lib dependent texture flipping
OpenGL uses upside down textures, D3D uses right side up. BooBoo/Shim has sheltered this for the most part, but it’s a pain in the arse so I’m storing textures in lib dependent format from now on. The 3D examples change, it will need to have a if (== TRUE D3D9) block where texture coordinates are used, and flip them vertically. Or I might just drop D3D altogether…
-
BooBoo texture access
image_read_texture reads an image into a BooBoo vector for manipulation. image_to_texture creates a new texture from such a vector (which can be fully created oneself or gotten from image_read_texture) and image_update updates an existing texture with new data (faster.)
This isn’t live yet… next version will have these 3 functions.
