-
Couldn't load subscription status.
- Fork 41
How do I launch graphics samples from the command line? #234
-
What command line options do I use to launch the graphics samples SmallBASIC/samples/distro-examples/graphics from the command line?
Some Background
I have sbasic installed and it runs some of the text games in the samples SmallBASIC/samples/distro-examples/games but I can't get any of the graphical demos to run from the command line?
What I tried
I was able to run a few of them with sbasici but its crashing now so I want to rely on the command line.
I looked in the docs with no luck but please lmk if I missed the key documentation about this.
I also saw the output of sbasic -h and tried some of that don't know what any of it means or how to use it to launch these programs.
sbasic 3dtorus.basnothing happened. When I ransbasic -v 3dtorus.basI got this output 3dtorus.bas.error.txtsbasic ball.bassimilar story. When I ran it with -v I got this output (which is very similar to 3dtorus.bas output) ball.bas.error.txtsbasic plasma.basdoes nothingsbasic maze.basjust outputs a zerosbasic Fractal_Tree.basdoes nothingsbasic Colors.basdoes nothing and i have to ctrl-c
none of the programs in that folder have run at all so I must be doing something wrong.
What I am running
This is my sbasic version:
SmallBASIC version 12.27 Console Unix_64 2024年10月31日 - use -h for help
I'm on M1 macbook air 2020 Sonoma 14.5 with 16GB ram and ~8GB free space
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 1 comment 2 replies
-
You have several version of SmallBASIC:
- sbasic: textmode only. If you want to use graphics related plugins like raylib, you have to use this version. Also great for bash like scripting (use shebang
#!/usr/local/bin/sbasicas the first line and make your program executable) - sbasicg: textmode and graphics using SDL2. This is for most users the preferred version and will work with most of the examples. SDL2 can in principal work in a CLI-only system but a window manager is recommended.
- sbasici: textmode and graphics using FLTK: Nice editor but graphics is not as fast as with SDL2
sbasicg (SDL2-version) can be run from command line and will then open a window on the desktop: sbasicg -r MyProgram.bas
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
Thank you.
- Is there a way to use sbasic (command line) to run those graphics samples or do I need to use sbasicg for those?
- Do you have to know which programs to use with sbasic and which to use with sbasicg? Is there a way to know that in advance?
Beta Was this translation helpful? Give feedback.
All reactions
-
You have to use sbasicg. sbasic is missing most of the graphic routines. Graphics output comes only with additional plugins like raylib or nuklear.
Unfortunately there is no way to see whether a program needs sbasicg or not. But I guess, that 70% or even 80% of the examples need sbasicg to run properly.
Beta Was this translation helpful? Give feedback.