Re: Hiw to use graphics in gforth?

paul.ortais-WGBUbHxT2D9Wk0Htik3J/[email protected] Mon, 23 May 2022 19:37:34 +0200
Newsgroups gmane.comp.lang.forth.gforth
Message-ID <[email protected]>
Thank you Anton for your calm contribution. I was in sort of a despair.
I understand that since Windows differ from Linux, I have to design my 
own Windows pixels and lines if I want to produce anything I can 
interact with.
Paul

Le 2022-05-22 10:13, Anton Ertl a écrit :

> On Fri, May 20, 2022 at 07:11:31PM +0200, paul.ortais-WGBUbHxT2D9Wk0Htik3J/[email protected] 
> wrote:
> 
>> Hello Anton, Joe,
>> 
>> I wasn't the initiator of this request, but it directly relates to a 
>> concern
>> of mine.
>> Though I can live with just at-xy and and scarce polices, the lack of
>> graphics words in Gforth, and the reluctance to provide them in 
>> general in
>> Forth, has something extremely bizarre that I concluded is a part of 
>> an
>> "elite" club wanting to remain tiny.
> 
> Not at all, more a reflection that this topic has a bewildering
> multitude of incompatible and aften complex APIs in the world outside
> Forth, so what should our (one) graphics API target?
> 
> By contrast, text I/O has pretty much one API on the C level, even
> though what's behind that can be quite diverse (display on a serial
> terminal, the console, a local terminal emulator window (with lots of
> terminal emulators available), through ssh on a remote terminal
> emulator, on a local terminal emulator with a display on a remote X
> server, an emacs terminal buffer, etc.), so it's relatively easy to
> support.
> 
>> Anton, in your answer to Joe,  I can hardly figure what "open a pipe" 
>> means
>> in reality for me,
> 
> https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/Pipes.html
> 
> And I just rediscovered an example of how to use that for graphics:
> 
> http://www.complang.tuwien.ac.at/forth/programs/ps-example.fs
> 
>> or "through the C interface" etc.
> 
> For Gfoth 0.7:
> https://www.complang.tuwien.ac.at/forth/gforth/Docs-html/C-Interface.html
> 
> It's slightly different in the current development version:
> https://gforth.org/manual/C-Interface.html
> 
> Then you look at the C graphics API you want to use, and call the C
> functions through the C interface.
> 
>> Reading this I imagined that if only there is a single (Forth) word, 
>> for a
>> given OS ok, to draw a pixel where I need it with graphic attributes, 
>> That
>> would be cataclysmic in the Forth world. Like:
>> : Pix. ( RGB i j --)
>> ????????
>> ;
>> Then many would be in heaven.
> 
> When I posted about ps-example.fs in 2010, there was not much
> reaction; maybe once you are in heaven, there is no desire to post.:-)