ncurses graphics in xterm
ncurses graphics in xterm
I am trying to use freebasic in an xterm to create simple (blocky) graphics. I assume that in principle ncurses could provide this capability. I cannot figure out how to do this if it is possible. I am not interested in complicated programs. I am trying to re-create the look and feel (and simplicity) of an old Apple IIe BASIC for teaching programming to kids. Any help appreciated. When I use any graphics modes I get errors saying -lX11 etc cannot be found but I have no xserver running, I am using an xterm and/or console.
Re: ncurses graphics in xterm
Hi d11031971,
there is a contradiction in your post: xterm or graphics? It's different.
A better approach would be: post the code (you have) here, for all to see ...
Note: put it in between code tags (5th Button from left, above the edit window).
there is a contradiction in your post: xterm or graphics? It's different.
A better approach would be: post the code (you have) here, for all to see ...
Note: put it in between code tags (5th Button from left, above the edit window).
Re: ncurses graphics in xterm
@d11031971: you don't need any graphics mode to display block elements. They are special (graphical) characters and you simply can use print to write them to the console (see also the links below). All commands you need are probably Print, Color and Locate.
@MrSwiss: it is called 'block graphics' or 'terminal graphics'
See https://en.wikipedia.org/wiki/Semigraph ... k_graphics and https://en.wikipedia.org/wiki/Block_Elements
@MrSwiss: it is called 'block graphics' or 'terminal graphics'
See https://en.wikipedia.org/wiki/Semigraph ... k_graphics and https://en.wikipedia.org/wiki/Block_Elements
Re: ncurses graphics in xterm
Could you stop the "hair-splitting" on a reply, to a first time poster?St_W wrote:@MrSwiss: it is called 'block graphics' or 'terminal graphics'
It's only one thing, digressing from main issue.
Re: ncurses graphics in xterm
Yes what I am trying to do is a contradiction in modern times and might not make much sense, but with an Apple IIe you could do low res graphics with plot command, etc., and the resolution was not very different from a modern xterm. I will follow the suggestions below with terminal graphics and experiment a bit, and then perhaps wrap the print/locate commands into a plot command with a few mods to freebasic. What I am trying to accomplish is not just to create graphics, but to have the same look and feel of the older systems which I think were great for teaching (simple interface, simple language, simple graphics to motivate kids to be creative). I am familiar with most modern teaching tools and find them lacking for some reason, e.g., the hour of code stuff tries too hard to make programming a game. Again, this is not for serious coding, just for teaching. Thank you for the quick response, and helping me know I am not just missing a library or command line flag. Freebasic looks like a great starting point for what I want to do, and I appreciate all the efforts that go into it.
Re: ncurses graphics in xterm
FreeBASIC has something similar to the "plot" you've mentioned, it's called "Draw" ... may be a starting point ...
However, you need a graphic's screen, to run it. (Terminal/Console is no good)
However, you need a graphic's screen, to run it. (Terminal/Console is no good)
-
- Posts: 606
- Joined: Nov 28, 2012 1:27
- Location: CA, USA moving to WA, USA
- Contact:
Re: ncurses graphics in xterm
You probably haven't installed several libraries FB needs for linux.
Install libx11-dev
You probably will run into more libraries missing.
FB loads what it needs, and if graphics aren't used in your test program, you may think all is well.
Also, all terminal/console programs do not behave the same, especially for those graphic block charachters.
David
Install libx11-dev
You probably will run into more libraries missing.
FB loads what it needs, and if graphics aren't used in your test program, you may think all is well.
Also, all terminal/console programs do not behave the same, especially for those graphic block charachters.
David
Re: ncurses graphics in xterm
I do not know how that low-resolution mode worked on the Apple II (I only used DOS PCs), but according to the documentation the resolution is so low that you can just use graphical characters as mentioned above.d11031971 wrote:[...] with an Apple IIe you could do low res graphics with plot command, etc., and the resolution was not very different from a modern xterm.
From http://www.calormen.com/jsbasic/reference.html :
However, if you need a higher resolution or graphics commands you'll have to install X11. Although FB's graphics library can use the framebuffer device on Linux the compiler wants to link the X11 libraries.PLOT aexpr, aexpr
Plot lores point (x = 0...39, y = 0...39/47)