On Wed, Jun 3, 2015 at 6:46 PM, William G Hatch <willgha...@gmail.com> wrote:
>
> Hello racketeers,
>
> I'm pretty new to racket, so to get some experience with it I've been
> writing a terminal emulator.  It's coming along nicely (it is one
> control code away from being able to nicely run vim), and is at
> https://github.com/willghatch/rackterm for your browsing pleasure.  I
> have run into some difficulties that I would like some advice for:
>
> Its main problem currently is that it spends a lot of time drawing.  I
> am using a canvas% and I override its dc%'s on-paint to get the contents
> and then draw them on screen.  I call the refresh method to queue a
> re-paint whenever I get new input.  If I, say, start up vim and start
> writing in it, my input lags behind as it spends all its time
> repainting.  Are there some good practices for drawing stuff quickly?

You may enjoy the mode-lambda package which is mainly designed for
games, but terminals are also sprite-based (just a rectangular display
of a fixed character set). The documentation isn't building right now,
but you can just read it:

https://github.com/jeapostrophe/mode-lambda/blob/master/mode-lambda/scribblings/mode-lambda.scrbl

> I was also wondering, before I start searching and grepping all over, if
> someone who knows can point me to where I can see how drracket formats
> the contents of its text panes (IE adds color, etc).  Whatever it's
> doing seems to be good, so perhaps I can leverage something there.
>
> My other biggest issue right now is getting the child processes to
> register window size changes, and I'm not sure whether it's a problem
> with how I'm setting things up with the child or with how I'm sending
> the resize signals through the parent.  It's all through FFI calls into
> the black box of ioctl, so it has nothing to do with racket, but if any
> of you have tips for that, I would also appreciate it.  But related to
> that, I have some C constants hard coded right now in racket for the
> FFI.  Is there a way for me to get them out of the C header file so it
> won't just break if/when the header changes?

The cleanest terminal emulator I know of is

http://www.leonerd.org.uk/code/libvterm/

You may want to bind to it or read its code to get an idea.

> Thanks in advance,
>
> William Hatch
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> For more options, visit https://groups.google.com/d/optout.



-- 
Jay McCarthy
http://jeapostrophe.github.io

           "Wherefore, be not weary in well-doing,
      for ye are laying the foundation of a great work.
And out of small things proceedeth that which is great."
                          - D&C 64:33

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to