Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do I launch graphics samples from the command line? #234

JudgeGroovyman started this conversation in General
Discussion options

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.

  1. sbasic 3dtorus.bas nothing happened. When I ran sbasic -v 3dtorus.bas I got this output 3dtorus.bas.error.txt
  2. sbasic ball.bas similar story. When I ran it with -v I got this output (which is very similar to 3dtorus.bas output) ball.bas.error.txt
  3. sbasic plasma.bas does nothing
  4. sbasic maze.bas just outputs a zero
  5. sbasic Fractal_Tree.bas does nothing
  6. sbasic Colors.bas does 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

You must be logged in to vote

Replies: 1 comment 2 replies

Comment options

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/sbasic as 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

You must be logged in to vote
2 replies
Comment options

Thank you.

  1. Is there a way to use sbasic (command line) to run those graphics samples or do I need to use sbasicg for those?
  2. 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?
Comment options

Joe7M Nov 2, 2024
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /