discussion
discussion copied to clipboard
What graphic libraries you use?
What graphic libraries you use in your forth programs?
For simple windows programs I use winlib in SP-Forth. For few complicated programs I used NodeWebkit as GUI (chromium + nodejs) via web-sockets. For linux never used graphic libraries.
None. It would be nice to have a portable GUI library for Forth. One problem that each implementation does its own way of dealing with common problems :-/
What problems? For example?
@Phantasus
Using Glade to create GTK+ Applications with FORTH.
http://www.complang.tuwien.ac.at/anton/euroforth/ef10/papers/mahlow.pdf
afaik, GTK+ also runs on MS Windows and Mac OSX.
@lowfatcomputing Looks very cool :) Where to download and test it?
Start with creating a std for calling foreign functions and you will have accomplished much more than just graphics.
I hacked together a few basics of binding to SDL2 using GForth's C foreign function interface. It was pretty straightforward. I only ported 8 or 9 calls, just enough to create a window, renderer and texture, and flip an array into the texture and that texture to the screen. I'm writing a Gameboy emulator, so it's doing all-software rendering and just needs a canvas to display the results.
See here for the code.
Good Stuff!
@shepheb There are also legacy OpenGL tutorials for gforth inspired from the excellent Nehe website https://groups.google.com/forum/m/#!topic/comp.lang.forth/yoC6Q6o7E0I
I use Allegro
For microcontrollers with only a uart, sixel graphics and mouse reporting can be useful for making a gui. Here's my scribble pad demo https://hub.darcs.net/pointfree/forth-sixel
mlterm -e gforth paint.4th
Sixels have been discussed in irc freenode #forth
quite a lot lately and @cstrotm has also explored sixels although I can't find his sixel repo.