discussion icon indicating copy to clipboard operation
discussion copied to clipboard

What graphic libraries you use?

Open VoidVolker opened this issue 9 years ago • 10 comments

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.

VoidVolker avatar Mar 12 '15 19:03 VoidVolker

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 :-/

ghost avatar Mar 13 '15 19:03 ghost

What problems? For example?

VoidVolker avatar Mar 13 '15 19:03 VoidVolker

@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 avatar Mar 13 '15 20:03 lowfatcomputing

@lowfatcomputing Looks very cool :) Where to download and test it?

VoidVolker avatar Mar 13 '15 21:03 VoidVolker

Start with creating a std for calling foreign functions and you will have accomplished much more than just graphics.

DRuffer avatar Mar 13 '15 21:03 DRuffer

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.

bshepherdson avatar Apr 07 '15 13:04 bshepherdson

Good Stuff!

cwpjr avatar Apr 07 '15 19:04 cwpjr

@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

Lecrapouille avatar Jun 30 '17 00:06 Lecrapouille

I use Allegro

RogerLevy avatar Jun 30 '17 15:06 RogerLevy

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.

lowfatcomputing avatar Dec 17 '18 02:12 lowfatcomputing